Skip to main content

Module discovery

Module discovery 

Source
Expand description

Project discovery: turning a directory tree into the set of source units the Fast source-audit engine will analyse.

Discovery is filesystem-only. It reads source files, Cargo manifests and, if present, a compile_commands.json; it never executes build scripts, procedural macros or any target code. It is also where files are pre-suppressed: generated files, binary files and files over the size ceiling are excluded before any clone candidate is generated, and every excluded file is accounted for so nothing is dropped silently. Each result is attributed to a single implicit BuildVariant, so results from different variants are never conflated.

Structs§

BuildVariant
The context a set of results belongs to.
CargoLayout
The recognised Cargo packages in a scanned tree.
Classification
The result of classifying one file: its language and whether it is a header.
CompileCommands
A parsed compilation database with duplicate translation units removed.
CompileCommandsDiagnostic
A compilation database that discovery found but could not read.
CompileEntry
A single translation unit from the compilation database.
ContentHash
A stable content fingerprint of a file.
CppBuild
What a C or C++ translation unit was compiled with.
DiscoveryConfig
Settings that control a discovery run.
DiscoveryReport
The outcome of a discovery run.
GeneratedMarkers
A configured set of generated-file markers.
HeaderEvidence
A tally of the files whose extension names their language outright, used to settle the bare .h headers whose extension does not.
LanguageSelection
The languages a discovery run is allowed to enumerate.
PackageInfo
A package discovered in the tree, for reporting.
Partition
One variant and everything analysed under it.
RustBuild
What a Rust crate was built with.
Setting
One thing a compiler was told, under the name it is recorded by.
SkipReport
Counts of files excluded for reasons other than being generated.
SourceUnit
One physical source file selected for analysis.

Enums§

AnalysisMode
The analysis mode a run was performed under.
BuildConfiguration
The build configuration a variant was resolved under.
CompileCommandsError
A failure while reading the compilation database.
DiscoveryError
A failure that prevents discovery from running at all.
HeaderPolicy
How to classify a bare .h header, which C and C++ share.
Language
A source language codehelion can enumerate.
Shape
The three shapes a build setting comes in.
TargetKind
The role a source file plays in its package.

Constants§

DEFAULT_MARKERS
Markers recognised by default in a generated file’s header, in lower case.
DEFAULT_MAX_FILE_BYTES
Default per-file size ceiling, in bytes.
DEFAULT_SCAN_LINES
Number of leading lines scanned for a marker by default.
EXCLUDED
Arguments dropped from a compilation before it becomes an identity.
EXCLUDED_WITH_VALUE
Arguments dropped together with the value that follows them.
NORMALIZATION_VERSION
Version of the lexing/normalization ruleset.

Functions§

content_hash
A stable hex hash of a file’s contents, for the build inputs that are identified by what they say rather than by where they are.
discover
Discover the source units under root.
partition
Groups units by the variant they were analysed under.