Skip to content

Workflow Intelligence

CodexA provides three developer workflow intelligence tools that combine static analysis, call-graph traversal, dependency mapping, and optional git history to surface actionable insights.

Hotspot Detection

Identifies high-risk code areas using a weighted multi-factor heuristic.

bash
codex hotspots
codex hotspots --top-n 10 --json
codex hotspots --no-git --pipe

Risk Factors

FactorDefault WeightDescription
Complexity0.30Cyclomatic complexity of the symbol
Duplication0.20Duplicate line density in the file
Fan-in0.15Number of callers (call graph in-degree)
Fan-out0.15Number of callees (call graph out-degree)
Churn0.20Git change frequency

When git data is unavailable, churn weight is redistributed across the other factors.

Impact Analysis

Predicts the blast radius of modifying a symbol or file using BFS over the call graph and dependency map.

bash
codex impact parse_file
codex impact src/parser.py --json
codex impact MyClass --max-depth 3 --pipe

How It Works

  1. Resolve the target to symbols or a file path
  2. Seed BFS queue with the target's names and files
  3. Walk callers in the call graph (direct → transitive)
  4. Walk importers in the dependency map
  5. Build dependency chains tracing paths back to the target

Symbol Trace

Traces execution relationships upstream (callers) and downstream (callees).

bash
codex trace parse_file
codex trace MyClass.process --json
codex trace build_context --max-depth 3 --pipe

How It Works

  1. Resolve the target symbol
  2. BFS upstream: walk callers_of edges for transitive callers
  3. BFS downstream: walk callees_of edges for transitive callees
  4. Collect trace edges connecting the nodes

Output Formats

All three commands support three output modes:

FlagFormatUse Case
(none)Rich terminalInteractive development
--jsonPretty JSONProgrammatic consumption
--pipeTab-separatedShell pipelines and CI

Data Classes

Hotspots

ClassFields
HotspotFactorname, raw_value, normalized, weight
Hotspotname, file_path, kind, risk_score, factors
HotspotReportfiles_analyzed, symbols_analyzed, hotspots

Impact

ClassFields
AffectedSymbolname, file_path, kind, relationship, depth
AffectedModulefile_path, relationship, depth
DependencyChainpath (list of strings)
ImpactReporttarget, target_kind, direct_symbols, transitive_symbols, affected_modules, chains

Trace

ClassFields
TraceNodename, file_path, kind, depth
TraceEdgecaller, callee, file_path
TraceResulttarget, target_file, upstream, downstream, edges

Plugin Hooks

HookWhen
PRE_HOTSPOT_ANALYSISBefore hotspot scoring
POST_HOTSPOT_ANALYSISAfter hotspot report
PRE_IMPACT_ANALYSISBefore impact BFS
POST_IMPACT_ANALYSISAfter impact report
PRE_TRACEBefore trace BFS
POST_TRACEAfter trace result

Released under the MIT License.