@codacy/analysis-runner
v0.2.0
Published
Core orchestration engine for Codacy analysis
Readme
@codacy/analysis-runner
Table of Contents
Overview
Core orchestration engine for the Codacy Analysis CLI. Discovers tools, checks capabilities, calls analyze() on each adapter, aggregates results, and transforms output. Usable programmatically by both the CLI and IDE integrations.
API
| Export | Purpose |
|--------|---------|
| analyze(options) | Main entry point — runs the full analysis pipeline |
| registerAdapter(adapter) | Register a tool adapter |
| clearAdapters() | Reset adapter registry (for tests) |
| getRegisteredAdapters() | List registered adapters |
| formatOutput(result, format) | Transform AnalysisResult into a formatted string |
| buildToolConfig() | Assemble CodacyToolConfig from CodacyConfig + local config |
| readCodacyConfig() / writeCodacyConfig() | Read/write .codacy/codacy.config.json |
Pipeline steps
- Discover registered adapters (filtered by
options.toolsif set) - Check availability → build CapabilityReport
- Apply execution mode rules (standard/strict/auto-install/inspect)
- Discover files via git, apply exclusion layers, route to tools
- Check local config + build CodacyToolConfig per tool
- Execute
adapter.analyze()with timeout and concurrency control - Aggregate results into AnalysisResult
- Format output
Output formats
| Format | Description |
|--------|-------------|
| json | Pretty-printed AnalysisResult (default) |
| sarif | SARIF v2.1.0 document |
| container | One JSON object per line (Codacy Docker runners) |
| text | Human-readable terminal summary with colors and grouping |
Execution modes
| Mode | Behavior |
|------|----------|
| standard | Skip unavailable tools, report them (default) |
| strict | Fail if any configured tool is unavailable |
| auto-install | Attempt to install missing tools before analysis |
| inspect | Dry-run: report capability without running analysis |
