Skip to main content

Crate sloc_core

Crate sloc_core 

Source

Re-exports§

pub use baseline::BaselineEntry;
pub use baseline::BaselineStore;
pub use baseline::check_against_baseline;
pub use baseline::resolve_baselines_path;
pub use coverage::FileCoverage;
pub use coverage::aggregate_line_coverage;
pub use coverage::lookup_coverage;
pub use coverage::parse_lcov;
pub use delta::FileChangeStatus;
pub use delta::FileDelta;
pub use delta::MultiFileDelta;
pub use delta::MultiScanComparison;
pub use delta::MultiScanPoint;
pub use delta::ScanComparison;
pub use delta::SummaryDelta;
pub use delta::compute_delta;
pub use delta::compute_multi_delta;
pub use history::CleanupPolicy;
pub use history::CleanupPolicyStore;
pub use history::RegistryEntry;
pub use history::ScanRegistry;
pub use history::ScanSummarySnapshot;
pub use history::WatchedDirsStore;
pub use maintenance::PrunePlan;
pub use maintenance::PruneReport;
pub use maintenance::PrunedRun;
pub use maintenance::copy_tree;
pub use maintenance::dir_size_bytes;
pub use maintenance::execute_run_prune;
pub use maintenance::plan_run_prune;
pub use maintenance::resolve_output_root;
pub use maintenance::resolve_registry_path;
pub use maintenance::rotate_log;
pub use maintenance::rotated_log_paths;
pub use maintenance::run_output_dir;

Modules§

baseline
Named baseline snapshots — save a scan result as a pinned reference point and compare future scans against it.
coverage
delta
history
maintenance
Disk-hygiene primitives for reclaiming space taken by old scan artifacts and log files.

Structs§

AnalysisRun
AttributionEstimate
A cheap up-front estimate of the attribution (git blame) cost for a repository, computed from git metadata alone (no filesystem walk, no file reads) so it can run while the user is still configuring the scan. Self::blameable_files counts tracked files — including submodule working trees via --recurse-submodules — whose name maps to a supported language, which is exactly the set the blame pass would process.
Author
A resolved contributor: one human, possibly spanning several raw git identities that were auto-merged because they share a normalized email. Cross-email merges (corporate login vs. full name vs. last name) are a follow-up interactive step; Phase 1 only auto-merges the high-confidence same-email case, which is always safe.
AuthorLineCounts
Line tallies bucketed the same three ways as LineCategory. total_lines is the sum of the three category counts (i.e. physical lines owned).
AuthorMergeGroup
One operator-defined merge: several email identities that are actually one person.
CocomoEstimate
COCOMO I (Basic) cost-estimation result derived from total code SLOC.
EffectiveCounts
EnvironmentMetadata
FileOwnership
One author’s ownership of a single file. author_id indexes into AnalysisRun::authors.
FileRecord
IdentityMap
A persisted collection of AuthorMergeGroups. Applied to a run’s authors at display time.
LanguageStyleGroup
Per-language-family style aggregation within a StyleSummary.
LanguageSummary
ProgressCounters
Atomics shared between analyze() and the caller so the caller can poll scan progress.
RawIdentity
A raw (name, email) pair exactly as recorded in git history (post-.mailmap). Multiple raw identities can be folded into one Author when they share a normalized email.
RepositoryLayout
Summary of the git-repository shape under a selected scan root.
StyleSummary
Aggregate multi-language style-guide adherence across all analysed files.
SubmoduleSummary
Per-submodule aggregated stats produced when submodule_breakdown is enabled.
SummaryTotals
ToolMetadata

Enums§

AttributionSeverity
How costly the per-author attribution (git blame) pass is expected to be for a repository, used to warn the user and to auto-default attribution off on pathologically large trees.
CocomoMode
COCOMO I (Basic) project mode — determines the a/b/c/d exponent coefficients.
FileStatus

Functions§

analyze
Errors
apply_identity_map
Fold a run’s authors according to map, in place: contributors whose email belongs to the same merge group are combined (counts summed, aliases merged, per-file ownership remapped and re-aggregated). Authors are re-sorted by code lines owned and re-indexed. A no-op when the map is empty or the run has no authors.
auto_merge_noreply_identities
Fold each GitHub users.noreply.github.com identity into a real-email identity of the same person, matched by display name, keeping the real email as canonical. Repos routinely carry both a contributor’s private-email GitHub address and their real email, splitting one person across two rows; this collapses them so the ownership view shows a single identity. Matching is by normalized display name, so distinct bots/people (e.g. copilot-swe-agent[bot]) never collapse into an unrelated author. Runs automatically at scan time and is a no-op when nothing matches — the operator-driven apply_identity_map still handles arbitrary cross-account merges on top.
detect_repository_layout
Inspect root for independent git repositories nested beneath it.
detect_submodules
Parse .gitmodules in root and return (name, relative_path) for each submodule found.
estimate_attribution_cost
Estimate the attribution cost for root from git metadata alone. Best-effort and fast (two git calls, no walk): a non-git path or any git failure yields a zero-cost, attribution-on estimate so nothing is ever blocked. See AttributionEstimate.
read_json
Errors
write_json
Errors

Type Aliases§

CppStyleSummary
Backward-compatible alias kept so that sloc-report and sloc-web can migrate incrementally without a breaking change on the same release.