Skip to content
Theme
Language

Complexity Analyzers documentation

Conservative analysis for C#

Make complexity evidence actionable.

An ecosystem to estimate Big-O, measure structure, and explain results in builds, automation, and AI tools — without executing your code.

C# diagnostic example
Search.cs
foreach (var item in items)
{
    if (otherItems.Contains(item))
    {
        matches.Add(item);
    }
}
BIG1001Linear lookup inside iteration; estimated composed cost O(n × m).

Complexity is an engineering decision, not a guess.

Different metrics answer different questions. This portal separates asymptotic cost, control structure, size, and inconclusive evidence so you can choose the right action.

01

Cost that scales

Find loops, calls, and collection operations whose cost grows with input.

02

Structure that weighs

Track cyclomatic, cognitive, and nesting measures without confusing them with Big-O.

03

Explicit limits

See Unknown when the supported subset cannot prove a safe conclusion.

Three surfaces, one analysis model.

Choose the integration by when and where you need evidence.

Read code through more than one lens.

Support is deliberately documented, and every result preserves its assumptions.

O(n log n)Big-OSupported asymptotic growth
CC = 11CyclomaticStructural paths
COG = 17CognitiveComprehension load
UnknownInconclusiveNo invented assumption
Depth = 4NestingControl-flow depth
NLOC = 42SizeLines, statements, and tokens
HalsteadVocabularyAvailable internal metrics
LINQOperationsMaterialization and ordering

Choose by workflow.

The packages are independent. Adopt one surface or combine all three.

IDE

Use the Analyzer

when feedback must travel with compilation and editing.

CI

Use the CLI

when you need reports, snapshots, and explicit gates.

AGENT

Use MCP

when an agent needs local analysis and evidence.

From local review to a CI gate.

The CLI returns stable exit codes; gates are opt-in, and Unknown results do not become proven regressions.

GitHub Actions
dotnet tool restore
mkdir -p artifacts
dotnet complexity-analysis analyze App.slnx \
  --format sarif \
  --max-cyclomatic-complexity 10 \
  --output artifacts/complexity.sarif

Start with the product that meets your code where it already lives.

Install it, produce the first result, then explore the models, contracts, and technical limits.