Skip to main content

Composite analysis workflows

Combine security, performance and standards findings into a prioritized list with Scenario 18 and Scenario 19. Inspect merge metadata and conflicts.

User Guides

Use the CodeGraph CLI to combine results from several checks and decide what to investigate first. Scenario 18 brings together signals for optimization; Scenario 19 combines standards and code-quality findings. The result includes an explanation, findings and merge metadata. Composite analysis proposes work; it does not edit source files. Make selected changes separately.

Choose the orchestrator

Choose the orchestrator
Orchestrator Purpose Next step
s18 / scenario_18 Merge security, performance, architecture, refactoring and technical-debt findings into optimization suggestions. Select a suggestion, define a measurable outcome and create an implementation task.
s19 / scenario_19 Merge standards and related code-quality findings. Review each finding against its rule and source revision, then assign an owner.

The CLI supports these two composite orchestrators. For a full project audit, follow the CPG-backed audit guide.

Run composite analysis from the CLI

Run these commands in PowerShell from the CodeGraph repository root and use its configured Python environment. Import the project and configure its CPG and the LLM as described in the configuration guide. Before the run, confirm that the CPG matches the source revision you want to analyze. The command uses the configured project and the scope in your query; it has no source-path argument.

Save each result to a separate JSON file:

python -m src.cli composition run "Analyze the bounded component for optimization opportunities." --orchestrator s18 --language en --output composition-s18.json
python -m src.cli composition run "Check the bounded component against the accepted standards." --orchestrator s19 --language en --output composition-s19.json

Record the source and CPG revisions, query, orchestrator, configuration, invoked sub-scenarios, merge metadata, conflicts and findings. Keep the JSON file with this context so you can compare it with a later analysis.

The command uses the query, orchestrator, language and sub-scenarios from the project configuration. Although the CLI accepts --sub-scenario, --parallel/--sequential and --merge-strategy, these flags do not override the configured run.

Open the newly created JSON file. Inspect metadata, the executed sub-scenarios and errors, then check findings against the source. Use the file for further processing: terminal output includes explanatory text.

Implement the selected change

After analysis, select a suggestion and create a separate implementation task. Attach the result, links to the affected code and the project revision. Define a measurable outcome, such as execution time for a selected operation under a fixed load. Specify the files, behavior checks and rollback method in the task. After making the change, repeat the analysis with the same inputs and compare the findings and measurements. The CLI produces proposals; source changes proceed through the implementation task.

Interpret the result

  • Deduplication and ranking help prioritize investigation; review each source finding in its bound revision.
  • Conflict resolution metadata records how findings were merged. The accountable reviewer records the resulting decision separately.
  • A suggested change is a proposal. Check it against the current source revision before implementing it.
  • For an empty result, check the sub-scenario scope and configuration. For an error, retain it in the report, restore the required service and rerun the check.