Skip to main content

Module output

Module output 

Source
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§

OutputWriter
Output writer that handles different formats

Enums§

OutputFormat
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.