Skip to main content

Crate cha_core

Crate cha_core 

Source

Re-exports§

pub use config::Config;
pub use config::DebtWeights;
pub use config::LanguageConfig;
pub use config::LayersConfig;
pub use config::Strictness;
pub use config::TierConfig;
pub use config::builtin_language_profile;
pub use reporter::JsonReporter;
pub use reporter::LlmContextReporter;
pub use reporter::Reporter;
pub use reporter::SarifReporter;
pub use reporter::TerminalReporter;

Modules§

config
graph
html_reporter
plugins
reporter
wasm

Structs§

AnalysisContext
Analysis context passed to plugins.
Baseline
A baseline is a set of finding fingerprints representing known/accepted issues.
ClassInfo
Extracted class/struct info from AST.
CommentInfo
A comment extracted from source code by the language parser.
Finding
A single analysis finding.
FunctionInfo
Extracted function info from AST.
HealthScore
Per-file health score.
ImportInfo
Extracted import info.
Location
Source location of a finding.
PluginRegistry
Manages plugin registration and lifecycle.
ProjectCache
Unified project cache: parse results + findings.
SourceFile
Raw source file content.
SourceModel
Unified source model produced by parsing.
TypeRef
A function parameter’s (or return value’s) type, with resolved origin. Produced by parsers after combining AST type text with the file’s imports.

Enums§

FileStatus
Result of checking a file against cache.
Grade
Health grade A–F for a file, based on issue density.
Severity
Severity level for a finding.
SmellCategory
Smell category from refactoring literature.
TypeOrigin
Where a referenced type is defined, from the perspective of the file that uses it. Used by abstraction-boundary analyses to distinguish “own domain” types from “pulled in from a library” types.

Traits§

Plugin
Core trait that all analyzers implement.

Functions§

class_location
Build a Location pointing at a class/struct’s name identifier.
env_hash
Compute environment hash from config + plugins + cha binary fingerprint.
filter_ignored
Filter out findings suppressed by cha:ignore comments in source code, and re-evaluate findings against cha:set threshold overrides.
findings_json_schema
Generate JSON Schema for the analysis output (list of findings).
func_location
Build a Location pointing at a function’s name identifier.
hash_content
Compute a content hash.
is_zero_f64
Helper for serde skip_serializing_if on f64 fields.
is_zero_usize
Helper for serde skip_serializing_if on usize fields.
prioritize_findings
Sort findings by priority descending (most important first). Writes the computed score back to Finding::risk_score so reporters can show why a finding ranks where it does. priority = severity_weight × overshoot × compound_factor
score_files
Compute health scores grouped by file.