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§
- Build
Variant - The context a set of results belongs to.
- Cargo
Layout - The recognised Cargo packages in a scanned tree.
- Classification
- The result of classifying one file: its language and whether it is a header.
- Compile
Commands - A parsed compilation database with duplicate translation units removed.
- Compile
Commands Diagnostic - A compilation database that discovery found but could not read.
- Compile
Entry - A single translation unit from the compilation database.
- Content
Hash - A stable content fingerprint of a file.
- CppBuild
- What a C or C++ translation unit was compiled with.
- Discovery
Config - Settings that control a discovery run.
- Discovery
Report - The outcome of a discovery run.
- Generated
Markers - A configured set of generated-file markers.
- Header
Evidence - A tally of the files whose extension names their language outright, used to
settle the bare
.hheaders whose extension does not. - Language
Selection - The languages a discovery run is allowed to enumerate.
- Package
Info - A package discovered in the tree, for reporting.
- Partition
- One variant and everything analysed under it.
- Rust
Build - What a Rust crate was built with.
- Setting
- One thing a compiler was told, under the name it is recorded by.
- Skip
Report - Counts of files excluded for reasons other than being generated.
- Source
Unit - One physical source file selected for analysis.
Enums§
- Analysis
Mode - The analysis mode a run was performed under.
- Build
Configuration - The build configuration a variant was resolved under.
- Compile
Commands Error - A failure while reading the compilation database.
- Discovery
Error - A failure that prevents discovery from running at all.
- Header
Policy - How to classify a bare
.hheader, which C and C++ share. - Language
- A source language codehelion can enumerate.
- Shape
- The three shapes a build setting comes in.
- Target
Kind - 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.