Skip to main content

Module ctx_optimize

Module ctx_optimize 

Source
Expand description

Lightweight Solution Intelligence checks used by ctx_optimize.

The analyzer intentionally favours explainable regex-based heuristics over a complete parser. Findings are suggestions, not compiler diagnostics.

Structs§

OptimizeFinding
One simplification opportunity identified in a source file.
OptimizeReport
Complete analysis result for one source file.
OptimizeSummary
Aggregate counts for an OptimizeReport.

Functions§

analyze_file
Analyze content for simple, high-signal simplification opportunities.
detect_native_feature_replacements
detect_oneline_candidates
Detect multi-line Rust functions whose body is already a single expression.
detect_reuse_candidates
Detect repeated three-line code sequences in the current file or nearby project sources.
detect_single_impl_traits
Detect Rust traits which currently exist only to abstract one implementation.
detect_single_product_factories
Render a human-readable optimization report.
detect_stdlib_alternatives
Detect code which likely duplicates a standard-library facility.
detect_yagni
Detect abstractions whose present form is unlikely to justify their cost.
format_report_json
Render a machine-readable optimization report.
format_report_text