Expand description
Output formatting for CLI commands
Supports three output formats:
- JSON: Structured output for programmatic use
- Text: Human-readable formatted output
- Compact: Minified JSON for piping
§Mitigations Addressed
- M19: JSON output uses serde with preserve_order for consistent field order
- M20: Text output includes helpful context and suggestions
Modules§
- sarif
- SARIF 2.1.0 compliant output for IDE/CI integration
Structs§
- Output
Writer - Output writer that handles different formats
Enums§
- Output
Format - Output format options
Functions§
- clone_
type_ description - Human-readable description of clone types (S8-P3-T5 mitigation)
- common_
path_ prefix - Compute the common directory prefix of a list of paths. Returns the longest shared directory ancestor (never a partial component). Returns empty path if paths share no common ancestor.
- empty_
results_ hints - Generate hints for empty clone detection results (S8-P3-T7 mitigation)
- escape_
dot_ id - Escape special characters for DOT node IDs (S8-P3-T11 mitigation)
- format_
cfg_ text - Format CFG info for text output
- format_
change_ impact_ text - Format change impact report for text output
- format_
clones_ dot - Format clone detection report as DOT graph for Graphviz
- format_
clones_ sarif - Format ClonesReport as SARIF JSON
- format_
clones_ text - Format clone detection report as compact human-readable text
- format_
cognitive_ text - Format cognitive complexity report for text output
- format_
complexity_ text - Format complexity metrics for text output
- format_
dead_ code_ text - Format dead code report for text output
- format_
dfg_ text - Format DFG info for text output
- format_
diagnostics_ text - Format diagnostics report for compact, token-efficient text output
- format_
enriched_ search_ text - Format enriched search report for text output.
- format_
file_ tree_ text - Format a file tree for text output
- format_
hubs_ text - Format hubs report for text output
- format_
impact_ text - Format impact report for text output
- format_
importers_ text - Format importers report for text output
- format_
imports_ text - Format imports for text output
- format_
maintainability_ text - Format maintainability index report for text output
- format_
module_ info_ text - Format ModuleInfo for text output
- format_
search_ text - Format search matches for text output
- format_
secrets_ text - Format secrets report for text output
- format_
similarity_ text - Format similarity report as human-readable text
- format_
smells_ text - Format smells report for text output
- format_
structure_ text - Format code structure for text output
- format_
whatbreaks_ text - Format whatbreaks report for text output
- strip_
prefix_ display - Strip a common prefix from a path, returning a relative display string. If stripping fails or results in empty, returns the original path display.