Skip to main content

Module explain

Module explain 

Source
Expand description

Metric and rule definitions for explainable CLI output.

Provides structured metadata that describes what each metric, threshold, and rule means, consumed by the _meta object in JSON output and by SARIF fullDescription / helpUri fields.

Structs§

RuleDef
Rule definition for SARIF fullDescription and JSON _meta.
RuleGuide
Extra educational content for the standalone fallow explain <issue-type> command. Kept separate from RuleDef so SARIF and _meta payloads remain compact while terminal users and agents can ask for worked examples on demand.

Constants§

AUDIT_RULES
Rule definitions for the diff-risk rules of fallow audit.
CHECK_RULES
Rule definitions for every dead-code family finding.
DUPES_RULES
Rule definitions for duplication findings.
FLAGS_RULES
Rule definitions for feature-flag findings.
HEALTH_RULES
Rule definitions for complexity and health findings.
MUTATION_RULES
Rule definitions for the findings of fallow mutation.
SECURITY_RULES
Rule definitions for security candidate findings, including the data-driven tainted-sink catalogue categories.

Functions§

all_rules
Every registered rule in registry order: dead-code, health, duplication, flags, security, audit, then mutation. The order is the fallow schema issue_types order and the fallow://issue-types resource order.
bare_rule_id
The rule id without its fallow/ or security/ namespace prefix, which is the canonical issue code (unused-export, sql-injection).
coverage_analyze_meta
Build the _meta object for fallow coverage analyze --format json --explain.
coverage_setup_meta
Build the _meta object for fallow coverage setup --json --explain.
explain_issue_type
Build the typed standalone explain output for a user-facing issue token.
rule_by_id
Look up a rule definition by its SARIF rule ID across all rule sets.
rule_by_token
Look up an issue type from a user-facing token.
rule_command
The command family a rule reports under (dead-code, health, dupes, flags, security, audit, or mutation), derived from the registry array that owns it. Membership is by id (unique across registries); the registries are const slices, so pointer identity is not stable across uses.
rule_config_key
The rules.* key of rule alone: the config_key of its issue kind, or for a complexity or file-length finding the complexity-* rule that decides if the finding fails the run. None when no key belongs to this rule only. high-complexity has none: it takes the most severe of the cyclomatic and cognitive rules.
rule_docs_url
Build the docs URL for a rule.
rule_guide
Return worked-example and fix guidance for a rule.
rule_has_guide
Whether rule_guide has a guide of its own for rule. When it has none, it returns a generic guide that fits every rule.
rule_rationale
The “Why it matters” text of rule: what goes wrong when the finding stays. A rule without a text of its own uses its full description.
rule_severity_key
The rules.* config key whose default severity gates findings of rule: the key of rule_config_key, else the key of the shared rule its suppression token names (every tainted-sink catalogue category is gated by security-sink, coverage findings by coverage-gaps). None for findings with no rules.* gate at all (combined complexity, duplication metrics, refactoring targets, runtime-coverage verdicts); a suppression token that is not a rules.* key (code-duplication, feature-flag) yields None too, so every returned key resolves in crate::schemas::default_rule_severities.
security_meta
Build the _meta object for fallow security --format json --explain.
serialize_explain_programmatic_json
Serialize standalone explain output using the programmatic API contract.
unknown_explain_error
Structured error for an unrecognized fallow explain issue type, with suggestions matched to whether the token looks security-related.