Public report — MailKit, published 5 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 05-08-2026 @ 16:33 UTC Public
Code Health Audit

Jstedfast/MailKit

57% Adequate
CriticalWeakAdequateStrongExemplary
lower third — near Weak

Large · 106,065 LoC · 8 projects · rebuild ~1.2 person-years · weakest lens: Maturity (51%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

48/52dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
218findings with an exact file:lineof 232 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
52/98dimensions across the health lenses106065 LoC · 8 projects — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

jstedfast/MailKit is sound in substance but carries real gaps (57%). It is not in crisis, but the issues below raise the cost of changing it — friction its consumers ultimately inherit.

It is strongest in Architecture (90%) — the structure is clean and changes stay contained. Readiness (80%) is solid too.

The area that most needs attention is Maturity (51%) — onboarding is slow — key decisions and the architecture aren't written down, so contributors have to reverse-engineer the intent. Security (52%) is the next concern — exposure to security and compliance incidents is elevated.

Leadership focus, highest impact first: Record significant decisions one document per decision (Architecture documentation); 'Testing' section to the root README (Documentation (README)); Strengthen data-at-rest protection (Data Protection).

For scale: Large (~106,065 production lines); rebuilding it from scratch would take roughly ~1.2 person-years (~1–3 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (90%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Maturity 51% · 46% weightSecurity 52% · 25% weightPerformance 60% · 14% weightCode Health 78% · 8% weightReadiness 80% · 4% weightArchitecture 90% · 2% weight

Raise Maturity 51 → 70 (the Healthy floor) ⇒ headline 57 → ~61.

Code composition — where the lines go
Business logic 14%Plumbing 59%Tests 28%
New since the last scan (3+)

3 finding(s) are new versus the previous scan (2026-08-01) — surfaced by this scheduled scan itself, no pull request required.

  • D1 · Envelope.TryParse (cyclomatic 23) MailKit/Envelope.cs
  • D1 · Envelope.TryParse (cyclomatic 17) MailKit/Envelope.cs
  • P12 · Coverage collected but not gated

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €58,000–€290,000
Cost to rebuild€58,000–€290,000 (0.6–1.8 person-years (959–3,015 h), ~1–3 engineers)
Domain complexityLow — harder problems cost more per line
Quality factor0.8× (at 57% quality) — the last 20% of quality is most of the work
Size & shapeLarge · 74% boilerplate · 7% straight-line · 19% branching logic

This codebase represents roughly ~1.2 person-years of build effort (about ~€170,000 to rebuild). Its weakest lens is Maturity at 51% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Low (×0.9) — library/CLI × a 0.8× quality factor, at €60–95/h; indicative, ±~30%. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
+4.9 pts · Low effort · ADR Quality
2
Resolve the 2 redundant comment finding(s) in Comment Value — start with AccessControlList.cs, DuplexStream.cs.
+3.5 pts · Low effort · Comment Value
3
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
+6.1 pts · Medium effort · Architecture documentation

Diagnosis — what's actually going on

Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~1.2 person-years to rebuild), and its weakest lens is Maturity at 51%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~1.2 person-years rebuild (106,065 LoC) · weakest lens: Maturity 51%
→ Direct remediation budget at Maturity first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).

Architecture — bounded-context dependency graph

Each box is a bounded context (its layer projects grouped, or a project count when large); arrows show dependencies between contexts. A shared kernel is where many arrows converge.

arch ctx:AotCompatibility AotCompatibility AotCompatibility ctx:MailKit MailKit MailKit · MailKitLite ctx:AotCompatibility->ctx:MailKit __more__ +1 more contexts

Architecture — module dependency matrix

9 modules, 19 dependencies — 1 dependency cycle, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

MailKit.NetMailKit.Security.NtlmMailKit.SearchMailKit.SecurityMailKit.Net.ProxyMailKitMailKit.Net.ImapMailKit.Net.Pop3MailKit.Net.SmtpMailKit.Net1MailKit.Security.Ntlm2MailKit.Search3MailKit.Security4MailKit.Net.Proxy5MailKit6MailKit.Net.Imap7MailKit.Net.Pop38MailKit.Net.Smtp91212124136227410824152312

At a glance — Code Health · 78% · Strong

At a glance — Architecture · 90% · Adequate · gated by D26

At a glance — Maturity · 51% · Adequate · gated by M2

At a glance — Readiness · 80% · Strong

At a glance — Security · 52% · Adequate · gated by D29, D36, C1

At a glance — Performance · 60% · Adequate

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2021 — Injection12High / Critical

Roadmap

Begin by establishing a centralized repository for architectural decisions, ensuring each is dated and clearly outlines the context, decision, and consequences. Simultaneously, enhance data protection by securing keys in a vault and encrypting sensitive columns to eliminate security gaps. Next, update the root README to include a dedicated testing section that explains how to run the test suite. Finally, reorganize the project structure to separate production code from tooling, ensuring a clean and maintainable codebase.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.+4.9 ptsLowADR Quality
Resolve the 2 redundant comment finding(s) in Comment Value — start with AccessControlList.cs, DuplexStream.cs.+3.5 ptsLowComment Value
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).+6.1 ptsMediumArchitecture documentation
Add a 'Testing' section to the root README — how to run the test suite.+6.0 ptsMediumDocumentation (README)
Strengthen data-at-rest protection: vault your keys (Azure Key Vault / AWS KMS / IDataProtector key ring) and encrypt the most sensitive columns (EF HasConversion encryption or provider-native column encryption) — partial coverage still leaves gaps.+5.5 ptsMediumData Protection
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+2.1 ptsLowBus Factor
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.+4.2 ptsMediumFolder & project structure
Resolve the 12 High finding(s) in Static Analysis (SAST) — start with main.yml (5), codeql.yml (4), aot-compatibility.yml (2).+4.1 ptsMediumStatic Analysis (SAST)

File quality

Per-file score 0–10 — a quality signature. Of 47 files carrying findings, judged against the Production bar: 0% slop · 70% mixed · 30% near-clean.

FileScoreBandWorst signal
.github/workflows/main.yml4.6MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/codeql.yml4.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/aot-compatibility.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
MailKit/Net/Imap/ImapEngine.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Security/SaslMechanism.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Net/Imap/ImapFolderFetch.cs6.0MixedExplicit Debt: TodoComment
MailKit/Net/Imap/ImapCommand.cs6.0MixedExplicit Debt: CommentedOutCode
MailKit/Net/Imap/ImapUtils.cs6.0MixedExplicit Debt: CommentedOutCode
MailKit/Security/SaslMechanismDigestMd5.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Net/Imap/ImapEventGroup.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Net/Imap/ImapFolder.cs6.0MixedExplicit Debt: FixmeComment
MailKit/ByteArrayBuilder.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Net/Imap/ImapClient.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Net/Imap/ImapStream.cs6.0MixedExplicit Debt: FixmeComment
MailKit/Net/Imap/ImapFolderSearch.cs7.0MixedCyclomatic Complexity: ImapFolder.BuildQuery (cyclomatic 66)
MailKit/UniqueIdSet.cs7.0MixedCyclomatic Complexity: UniqueIdSet.TryParse (cyclomatic 22)
MailKit/MailService.cs7.0MixedGod Classes: TooManyMethods: MailService
MailKit/BodyPart.cs7.0MixedCyclomatic Complexity: BodyPart.TryParse (cyclomatic 36)
MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs7.0MixedCyclomatic Complexity: ImapAuthenticationSecretDetector.DetectAuthSecrets (cyclomatic 23)
MailKit/Envelope.cs7.0MixedCyclomatic Complexity: Envelope.TryParse (cyclomatic 23)

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 48 of 52 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 52 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D18D19D20D21D24D26D28D29D34D35D36D37AX10AX3AX4AX5AX6AX8C1GD1IC1M1M2M3M4P1P10P3P4P6PF1PF2PF3S1X1X2X3X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 218 of 232 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019fd2c5-95ce-7db9-84d6-80432049d365.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

A clean run — every tool resolved and ran, and every applicable dimension was measured at full confidence. No scanner was unavailable, no analysis timed out or crashed, and nothing fell back to a degraded estimate.

When something does degrade — a missing scanner, a shallow clone, an LLM hiccup — it is named here explicitly and its exact cause recorded in diagnostics.md, never absorbed silently into the score.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (5): D19, D20, D21, D24, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity6.3 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 6.3 / 10 · rule-coverage 100% · ceiling Prevented

51 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ImapEngine.ProcessCapabilityToken at 73. A further 5 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being ImapResponseCode.Create at 58 — they are counted neither in the figure above nor in this dimension's score.

ImapEngine.ProcessCapabilityToken (cyclomatic 73)MailKit/Net/Imap/ImapEngine.cs:1329
SaslMechanism.IsProhibited (cyclomatic 70)MailKit/Security/SaslMechanism.cs:648
ImapFolder.BuildQuery (cyclomatic 66)MailKit/Net/Imap/ImapFolderSearch.cs:112
ImapEngine.GetResponseCodeType (cyclomatic 58)MailKit/Net/Imap/ImapEngine.cs:1805
ImapFolder.FormatSummaryItems (cyclomatic 45)MailKit/Net/Imap/ImapFolderFetch.cs:746

+ 46 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 ImapEngine.ProcessCapabilityToken (cyclomatic 73) finding(s) in Cyclomatic Complexity — start with ImapEngine.cs. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 SaslMechanism.IsProhibited (cyclomatic 70) finding(s) in Cyclomatic Complexity — start with SaslMechanism.cs. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 ImapFolder.BuildQuery (cyclomatic 66) finding(s) in Cyclomatic Complexity — start with ImapFolderSearch.cs. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity4.8 / 10Weak✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 4.8 / 10 · rule-coverage 100% · ceiling Prevented

87 method(s) exceeded the cognitive complexity threshold of 15; the worst was ImapFolder.ParseSummaryItems at 105.

ImapFolder.ParseSummaryItems (cognitive 105)MailKit/Net/Imap/ImapFolderFetch.cs:235
ImapFolder.ParseSummaryItemsAsync (cognitive 105)MailKit/Net/Imap/ImapFolderFetch.cs:479
ImapFolder.FetchStream (cognitive 90)MailKit/Net/Imap/ImapFolderFetch.cs:1934
ImapFolder.FetchStreamAsync (cognitive 90)MailKit/Net/Imap/ImapFolderFetch.cs:2177
ImapEngine.ProcessCapabilityToken (cognitive 77)MailKit/Net/Imap/ImapEngine.cs:1329

+ 82 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 ImapFolder.ParseSummaryItems (cognitive 105) finding(s) in Cognitive Complexity — start with ImapFolderFetch.cs. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 ImapFolder.ParseSummaryItemsAsync (cognitive 105) finding(s) in Cognitive Complexity — start with ImapFolderFetch.cs. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 ImapFolder.FetchStream (cognitive 90) finding(s) in Cognitive Complexity — start with ImapFolderFetch.cs. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes9.5 / 10Exemplary✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Prevented

15 god class(es) detected.

TooManyMethods: ImapFolder · ×8MailKit/Net/Imap/ImapFolder.cs:0
FileTooLong: Imap/ImapEngine.cs · ×7MailKit/Net/Imap/ImapEngine.cs:0

✓ On the Gold path — maintain.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.9 / 10Exemplary✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

15 duplicated block group(s) detected.

Duplicated block (14 lines × 2) · ×3MailKit/Net/Imap/ImapClient.cs:1592
Duplicated block (15 lines × 2) · ×2MailKit/Net/Imap/ImapStream.cs:956
Duplicated block (14 lines × 3) · ×2MailKit/Net/Imap/ImapClient.cs:1394
Duplicated block (19 lines × 3)MailKit/Net/Imap/ImapClient.cs:262
Duplicated block (19 lines × 2)MailKit/BodyPart.cs:328

+ 6 more group(s) — more in Appendix A; the complete list is findings.md.

✓ On the Gold path — maintain.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

8 projects, 0 dependency cycle(s), 0 unstable depended-on project(s).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.5 / 10Exemplary✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

2 of 46 classes have LCOM4 above 3.

Low cohesion: ImapFolder (LCOM4 14) · ×2MailKit/Net/Imap/ImapFolder.cs:58

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

987 test methods: 987 unit, 0 integration, 0 BDD, 0 e2e.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 987 tests.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D12 · Dependency Hygiene10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 outdated, 0 vulnerable, 0 deprecated packages.

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 15 packages use a banned license.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.6 / 10Exemplary✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: DocumentedVerifiedPrevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: MailKit/Net/Imap/ImapCommand.cs (2×26=52); MailKit/Net/Imap/ImapFolder.cs (2×21=42); MailKit/Net/Smtp/SmtpClient.cs (2×19=38)

Hotspot: MailKit/Net/Imap/ImapCommand.cs · ×5MailKit/Net/Imap/ImapCommand.cs

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor7.8 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: DocumentedVerifiedPrevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Documented

42 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is MailKit/MailFolder.cs.

Off-boarding risk: anonymized user #1

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.3 / 10Exemplary✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: DocumentedVerifiedPrevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Prevented

59 deducted debt markers + 0 dead symbols across 106065 LoC (0.3/KLoC) → score 9.3.

NoWarnInCsproj — 17 warning codes suppressed in one element · ×2MailKit/MailKitLite.csproj:35
FixmeComment · ×14MailKit/ByteArrayBuilder.cs:139
CommentedOutCode · ×7MailKit/Net/Imap/ImapCommand.cs:288
TodoComment · ×4MailKit/AnnotationAttribute.cs:122

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D18 · Solution Shape10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the solution is laid out in a sensible, conventional structure.

Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

8 projects, 1681 source files, 146456 hand-written lines of code (106065 production / 40391 test), 1 inter-project edges (build status unknown — did not finish).

Monorepo: only 1 of 6 solutions was scored
Solution references a project that does not existMailKit.sln
Build status unknown

✓ On the Gold path — maintain.

Detailed fixes: d18_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality / 10Weak◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Weak / 10 · rule-coverage 100% · ceiling Documented

The single README is a static NuGet package metadata table showing release and build status for MailKit/MimeKit/MailKitLite plus platform CI badges. It contains no documentation of how to install the library (NuGet/Source), what it does, its licensing, or usage examples — all critical information is missing from this one file.

XML-doc coverage: MailKit(netstandard2.0)MailKit/MailKit.csproj

What to do

  1. Improve Documentation Quality — currently 4.0/10. — The single README is a static NuGet package metadata table showing release and build status for MailKit/MimeKit/MailKitLite plus platform CI badges. It contains no documentation of how to install the library (NuGet/Source), what it does, its licensing, or usage examples — all critical information is missing from this one file.

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D20 · ADR Quality / 10Critical◐ Sampled · advisory

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: DocumentedVerifiedPrevented · effective Critical / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 200 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D24 · Comment Value / 10Weak◐ Sampled · advisory

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Weak / 10 · rule-coverage 100% · ceiling Documented

8 valuable / 2 redundant across 200 sampled comments; 2 shown with locations.

redundant comment · ×2MailKit/AccessControlList.cs:18

What to do

  1. Resolve the 2 redundant comment finding(s) in Comment Value — start with AccessControlList.cs, DuplexStream.cs. — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 projects flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)1.2 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: DocumentedVerifiedPrevented · effective 1.2 / 10 · rule-coverage 100% · ceiling Documented

12 finding(s): 0 critical, 12 high, 0 medium, 0 low.

High: dependabot-missing-cooldown · ×12.github/dependabot.yml:5detected by semgrep finding

What to do

  1. Resolve the 12 High finding(s) in Static Analysis (SAST) — start with main.yml (5), codeql.yml (4), aot-compatibility.yml (2). — One of this dimension's main actionable groups (12 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

Unpinned build actions
PR-triggered workflow without a permissions block
No build provenance
No artifact signing
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code — check that business logic isn't leaking into the application/infrastructure layers (a thin domain is the anemic-domain smell).
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation8.6 / 10Strong✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface member counts; fat-interface threshold (over 15 members) flagged per type. Deterministic, type-level.

  • `IMailFolder` declares 239 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMailFolder.cs:49
  • `IMailService` declares 46 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMailService.cs:53
  • `IMailSpool` declares 40 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMailSpool.cs:42
  • `IMailStore` declares 27 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMailStore.cs:40
  • `IMessageSummary` declares 28 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMessageSummary.cs:49
  • `IImapClient` declares 17 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IImapClient.cs:38
  • `IImapFolder` declares 18 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IImapFolder.cs:48
  • `IMailService` declares 48 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMailService.cs:53

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

C1 · Data Protection3.5 / 10Weak✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

What to do

  • Strengthen data-at-rest protection: vault your keys (Azure Key Vault / AWS KMS / IDataProtector key ring) and encrypt the most sensitive columns (EF HasConversion encryption or provider-native column encryption) — partial coverage still leaves gaps.
  • Enforce HTTPS (UseHttpsRedirection / RequireHttpsMetadata) so data in transit is always encrypted.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

  • A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×2) — SmtpStream.cs:364, SmtpStream.cs:454

What to do

  • Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
IC1 · Incompleteness & stubs6.0 / 10Adequate✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored. (×2) — ImapIdleContext.cs:99, SmtpStream.cs:345
  • `DefaultUpdate` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — ImapLiteral.cs:55
  • `Read` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — SmtpStream.cs:343
  • `ReadAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — SmtpStream.cs:433

What to do

  • Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
  • Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
M1 · Documentation (README)5.2 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

  • 122 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 2 of 2 project(s) that lack one — worth up to 2 pts.
  • Review the README against recent changes; refresh the parts that drifted.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • No C4/PlantUML/Mermaid diagram or architecture.md — the high-level shape isn't documented.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

  • Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries. Exhaustive, deterministic.

P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

What to do

  • The release job declares an environment, but its protection rules are not visible from the repository — confirm required reviewers are attached, or publish as a draft release so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

PF1 · Benchmark discipline6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the library protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • No benchmark suite was found. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.

What to do

  • Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
PF2 · Allocation hygiene6.2 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 53 use(s) across 106,093 production line(s) (~0.5/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code keeps its host responsive — a library awaits with ConfigureAwait(false) (so it never captures and stalls the host's context) and avoids sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) that wastes threads and risks deadlock.

Method: Production-source scan: sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) counted everywhere, and — for a library with ≥5 awaits — the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • 5 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock in a consumer with a synchronization context.

What to do

  • Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult() in library code.
S1 · Cryptographic Hygiene8.0 / 10Strong✓ Tool-verified

Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. Deterministic.

  • MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. — Pop3Client.cs:899

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
X1 · Async correctness7.5 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×5) — ImapEngine.cs:2893, ImapEngine.cs:2921, ProxyClient.cs:226, …

What to do

  • Sync-over-async (deadlock risk)
X2 · Cancellation propagation9.7 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage.

  • Only 247/260 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
  • No CancellationToken parameter — this work can't be stopped early once started. (×13) — ImapCommand.cs:676, ImapEngine.cs:3182, ImapEngine.cs:3235, …

What to do

  • Thread a CancellationToken through async methods so work stops promptly on cancellation.
X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

X5 · Nullable reference types9.2 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • ~1.0 `!` suppressions per 1k syntax nodes — 218 suppression(s) across the 221582 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.

What to do

  • Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health78%StrongSolid.
Architecture90%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity51%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness80%StrongStrongest area.
Security52%Adequate — gated by D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Not included — 46 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
  • D11 Test Reliability — Test reliability not measured — test suite did not build
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Bounded contexts not declared
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D30 Dependency Vulnerabilities — the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan for NuGet CVEs — excluded rather than scored; re-run on an SDK that can restore this solution
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • D38 OSV Dependency Vulnerabilities — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.
  • D39 IL Efficiency — The target did not build, so no IL was available to measure.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — test suite did not build
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this check looks for
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this check looks for
  • P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — no EF Core usage detected
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Cobertura — `dotnet test --collect:"XPlat Code Coverage"` with a `coverlet.collector` PackageReference) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.
  • X7 Silent fallback defaults — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Issue — 14 finding(s)
D29 · Static Analysis (SAST) · High · ×12
  • High: dependabot-missing-cooldown .github/dependabot.yml:5 — This Dependabot configuration does not set a cooldown period. Newly published packages can be malicious or unstable. Add a `cooldown` block with `default-days: 7` to each `package-ecosystem` entry under `updates` to wait 7 days before proposing updates to newly published package versions. Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#cooldown. This is a semgrep security-AUDIT rule reporting a POLICY that is absent or weaker than its recommendation, not an exploitable defect. Confirm whether the current setting is a deliberate decision for this repository — and apply the change where it is not; where it is (a policy your release process already enforces elsewhere, or one this repository has consciously opted out of), record the decision and leave the configuration as it is.
  • High: github-actions-mutable-action-tag .github/workflows/aot-compatibility.yml:24 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-dotnet@<40-character SHA>`. This step references `actions/setup-dotnet@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-dotnet/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/aot-compatibility.yml:31 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yml:28 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-dotnet@<40-character SHA>`. This step references `actions/setup-dotnet@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-dotnet/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yml:35 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yml:48 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: github/codeql-action/init@<40-character SHA>`. This step references `github/codeql-action/init@v4`; resolve the SHA it points at today with `gh api repos/github/codeql-action/commits/v4 --jq .sha`. `github/codeql-action/init` is hosted INSIDE the `github/codeql-action` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `github/codeql-action/init` path in `uses:` and query only `github/codeql-action`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yml:65 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: github/codeql-action/analyze@<40-character SHA>`. This step references `github/codeql-action/analyze@v4`; resolve the SHA it points at today with `gh api repos/github/codeql-action/commits/v4 --jq .sha`. `github/codeql-action/analyze` is hosted INSIDE the `github/codeql-action` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `github/codeql-action/analyze` path in `uses:` and query only `github/codeql-action`.
  • High: github-actions-mutable-action-tag .github/workflows/main.yml:26 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-dotnet@<40-character SHA>`. This step references `actions/setup-dotnet@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-dotnet/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/main.yml:35 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: microsoft/setup-msbuild@<40-character SHA>`. This step references `microsoft/setup-msbuild@v3`; resolve the SHA it points at today with `gh api repos/microsoft/setup-msbuild/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/main.yml:39 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/main.yml:108 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v7`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/main.yml:150 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v7`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v7 --jq .sha`.
D17 · Explicit Debt · NoWarnInCsproj · ×2
  • NoWarnInCsproj — 17 warning codes suppressed in one element MailKit/MailKitLite.csproj:35 — A single <NoWarn> suppresses 17 warning codes (1701;1702;CA1068;CA1510;CA1512;CA1513;CA1835;CA2012;IDE0016;IDE0056;IDE0057;IDE0060;IDE0063;IDE0066;IDE0090;IDE0180;IDE0251) in one stroke — one team-wide decision, not 17 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
  • NoWarnInCsproj — 17 warning codes suppressed in one element MailKit/MailKit.csproj:34 — A single <NoWarn> suppresses 17 warning codes (1701;1702;CA1068;CA1510;CA1512;CA1513;CA1835;CA2012;IDE0016;IDE0056;IDE0057;IDE0060;IDE0063;IDE0066;IDE0090;IDE0180;IDE0251) in one stroke — one team-wide decision, not 17 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
Warning — 206 finding(s)
D17 · Explicit Debt · FixmeComment · ×14
  • FixmeComment MailKit/ByteArrayBuilder.cs:139 — // FIXME: This should be moved somewhere else... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/ByteArrayBuilder.cs:166 — // FIXME: Does this make sense to have here? Or should I have an extensions class for byte[] that has this? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/DeliveryStatusNotificationType.cs:27 — // FIXME: Move this to the MailKit namespace. It wasn't ever supposed to be in MailKit.Net.Smtp! — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/MessageThread.cs:93 — // FIXME: this shouldn't be a nullable since we can just use UniqueId.Invalid — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapClient.cs:115 — // FIXME: should this take a ParserOptions argument? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapEngine.cs:931 — // FIXME: All callers expect CRLF to be trimmed, but many also want all trailing whitespace trimmed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapEngine.cs:964 — // FIXME: All callers expect CRLF to be trimmed, but many also want all trailing whitespace trimmed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapEngine.cs:3405 — // FIXME: should this search EncodedName instead of FullName? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapEventGroup.cs:334 — // FIXME: should we verify that each ImapFolder belongs to this ImapEngine? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapFolder.cs:4753 — // FIXME: use an aggregate progress reporter — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapFolder.cs:4835 — // FIXME: use an aggregate progress reporter — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Net/Imap/ImapStream.cs:966 — // FIXME: use SIMD to optimize this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Security/SaslMechanism.cs:523 — // FIXME: This API should throw NotSupportedException rather than returning null if the mechanism is not supported. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment MailKit/Security/SaslMechanismDigestMd5.cs:432 — // FIXME: make sure this is supported — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D3 · God Classes · TooManyMethods · ×8
  • TooManyMethods: ImapFolder MailKit/Net/Imap/ImapFolder.cs:0 — TooManyMethods — 4808 significant lines (blank, comment-only and punctuation-only lines excluded), 397 methods, declared across 5 files: Imap/ImapFolder.cs (199), Imap/ImapFolderFetch.cs (120), Imap/ImapFolderSearch.cs (51), Imap/ImapFolderFlags.cs (16), +1 more file(s). To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MailFolder MailKit/MailFolder.cs:0 — TooManyMethods — 526 significant lines (blank, comment-only and punctuation-only lines excluded), 217 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ImapEngine MailKit/Net/Imap/ImapEngine.cs:0 — TooManyMethods — 2104 significant lines (blank, comment-only and punctuation-only lines excluded), 117 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ImapClient MailKit/Net/Imap/ImapClient.cs:0 — TooManyMethods — 1142 significant lines (blank, comment-only and punctuation-only lines excluded), 100 methods, declared across 2 files: Imap/ImapClient.cs (78), Imap/AsyncImapClient.cs (22). To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ImapUtils MailKit/Net/Imap/ImapUtils.cs:0 — TooManyMethods — 1486 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • TooManyMethods: ImapStream MailKit/Net/Imap/ImapStream.cs:0 — TooManyMethods — 468 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MailSpool MailKit/MailSpool.cs:0 — TooManyMethods — 47 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MailService MailKit/MailService.cs:0 — TooManyMethods — 178 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D17 · Explicit Debt · CommentedOutCode · ×7
  • CommentedOutCode MailKit/Net/Imap/ImapCommand.cs:288 — 3 consecutive commented-code lines
  • CommentedOutCode MailKit/Net/Imap/ImapCommand.cs:294 — 3 consecutive commented-code lines
  • CommentedOutCode MailKit/Net/Imap/ImapCommand.cs:308 — 3 consecutive commented-code lines
  • CommentedOutCode MailKit/Net/Imap/ImapCommand.cs:312 — 8 consecutive commented-code lines
  • CommentedOutCode MailKit/Net/Imap/ImapEngine.cs:1940 — 4 consecutive commented-code lines
  • CommentedOutCode MailKit/Net/Imap/ImapEngine.cs:2266 — 4 consecutive commented-code lines
  • CommentedOutCode MailKit/Net/Imap/ImapUtils.cs:1138 — 4 consecutive commented-code lines
D3 · God Classes · FileTooLong · ×7
  • FileTooLong: Imap/ImapEngine.cs MailKit/Net/Imap/ImapEngine.cs:0 — FileTooLong — 2165 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Imap/ImapFolderFetch.cs MailKit/Net/Imap/ImapFolderFetch.cs:0 — FileTooLong — 1927 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Imap/ImapFolder.cs MailKit/Net/Imap/ImapFolder.cs:0 — FileTooLong — 1831 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Imap/ImapUtils.cs MailKit/Net/Imap/ImapUtils.cs:0 — FileTooLong — 1542 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Imap/ImapFolderSearch.cs MailKit/Net/Imap/ImapFolderSearch.cs:0 — FileTooLong — 925 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Imap/ImapClient.cs MailKit/Net/Imap/ImapClient.cs:0 — FileTooLong — 881 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: MailKit/MailFolder.cs MailKit/MailFolder.cs:0 — FileTooLong — 536 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D15 · Churn × Complexity Hotspots · Hotspot · ×5
  • Hotspot: MailKit/Net/Imap/ImapCommand.cs MailKit/Net/Imap/ImapCommand.cs — MailKit/Net/Imap/ImapCommand.cs changed 2 times in last 90 days, max complexity 26. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: MailKit/Net/Imap/ImapFolder.cs MailKit/Net/Imap/ImapFolder.cs — MailKit/Net/Imap/ImapFolder.cs changed 2 times in last 90 days, max complexity 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: MailKit/Net/Smtp/SmtpClient.cs MailKit/Net/Smtp/SmtpClient.cs — MailKit/Net/Smtp/SmtpClient.cs changed 2 times in last 90 days, max complexity 19. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: MailKit/Net/Smtp/SmtpStream.cs MailKit/Net/Smtp/SmtpStream.cs — MailKit/Net/Smtp/SmtpStream.cs changed 2 times in last 90 days, max complexity 18. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: MailKit/Security/SaslMechanismNegotiateBase.cs MailKit/Security/SaslMechanismNegotiateBase.cs — MailKit/Security/SaslMechanismNegotiateBase.cs changed 2 times in last 90 days, max complexity 15. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
D17 · Explicit Debt · TodoComment · ×4
  • TodoComment MailKit/AnnotationAttribute.cs:122 — // TODO: improve validation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment MailKit/Net/Imap/ImapCapabilities.cs:28 — // TODO: rfc9208 and rfc9394
  • TodoComment MailKit/Net/Imap/ImapFolderAnnotations.cs:81 — // TODO: Do something with the AnnotateResponseCode if it exists?? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment MailKit/Net/Imap/ImapFolderFetch.cs:969 — // TODO: if the IMAP server supports the CONVERT extension, we could possibly use the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) MailKit/Net/Imap/ImapClient.cs:1592 — MailKit/Net/Imap/ImapClient.cs:1592-1605 | MailKit/Net/Pop3/Pop3Client.cs:1230-1243 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapClient.cs:1592` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) MailKit/Net/Imap/ImapStream.cs:1117 — MailKit/Net/Imap/ImapStream.cs:1117-1131 | MailKit/Net/Smtp/SmtpStream.cs:836-849 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapStream.cs:1117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) MailKit/BodyPart.cs:607 — MailKit/BodyPart.cs:607-620 | MailKit/BodyPart.cs:664-677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) MailKit/Net/Imap/ImapStream.cs:956 — MailKit/Net/Imap/ImapStream.cs:956-970 | MailKit/Net/Pop3/Pop3Stream.cs:610-624 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapStream.cs:956` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) MailKit/UniqueIdSet.cs:284 — MailKit/UniqueIdSet.cs:284-298 | MailKit/UniqueIdSet.cs:341-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/UniqueIdSet.cs:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) MailKit/Net/Imap/ImapClient.cs:1394 — MailKit/Net/Imap/ImapClient.cs:1394-1407 | MailKit/Net/Pop3/Pop3Client.cs:1051-1064 | MailKit/Net/Smtp/SmtpClient.cs:1291-1304 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapClient.cs:1394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) MailKit/Net/Imap/ImapStream.cs:1261 — MailKit/Net/Imap/ImapStream.cs:1261-1274 | MailKit/Net/Pop3/Pop3Stream.cs:1014-1027 | MailKit/Net/Smtp/SmtpStream.cs:987-1000 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapStream.cs:1261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: ImapFolder (LCOM4 14) MailKit/Net/Imap/ImapFolder.cs:58 — ImapFolder's methods form 14 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: MailService (LCOM4 7) MailKit/MailService.cs:52 — MailService's methods form 7 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
D1 · Cyclomatic Complexity · ImapEngine.ProcessCapabilityToken (cyclomatic 73) · ×1
  • ImapEngine.ProcessCapabilityToken (cyclomatic 73) MailKit/Net/Imap/ImapEngine.cs:1329 — ImapEngine.ProcessCapabilityToken has cyclomatic complexity 73 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SaslMechanism.IsProhibited (cyclomatic 70) · ×1
  • SaslMechanism.IsProhibited (cyclomatic 70) MailKit/Security/SaslMechanism.cs:648 — SaslMechanism.IsProhibited has cyclomatic complexity 70 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ImapFolder.BuildQuery (cyclomatic 66) · ×1
  • ImapFolder.BuildQuery (cyclomatic 66) MailKit/Net/Imap/ImapFolderSearch.cs:112 — ImapFolder.BuildQuery has cyclomatic complexity 66 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ImapEngine.GetResponseCodeType (cyclomatic 58) · ×1
  • ImapEngine.GetResponseCodeType (cyclomatic 58) MailKit/Net/Imap/ImapEngine.cs:1805 — ImapEngine.GetResponseCodeType has cyclomatic complexity 58 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImapFolder.FormatSummaryItems (cyclomatic 45) · ×1
  • ImapFolder.FormatSummaryItems (cyclomatic 45) MailKit/Net/Imap/ImapFolderFetch.cs:746 — ImapFolder.FormatSummaryItems has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapEngine.ParseResponseCode (cyclomatic 43) · ×1
  • ImapEngine.ParseResponseCode (cyclomatic 43) MailKit/Net/Imap/ImapEngine.cs:1931 — ImapEngine.ParseResponseCode has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapEngine.ParseResponseCodeAsync (cyclomatic 43) · ×1
  • ImapEngine.ParseResponseCodeAsync (cyclomatic 43) MailKit/Net/Imap/ImapEngine.cs:2257 — ImapEngine.ParseResponseCodeAsync has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.ParseSummaryItems (cyclomatic 41) · ×1
  • ImapFolder.ParseSummaryItems (cyclomatic 41) MailKit/Net/Imap/ImapFolderFetch.cs:235 — ImapFolder.ParseSummaryItems has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.ParseSummaryItemsAsync (cyclomatic 41) · ×1
  • ImapFolder.ParseSummaryItemsAsync (cyclomatic 41) MailKit/Net/Imap/ImapFolderFetch.cs:479 — ImapFolder.ParseSummaryItemsAsync has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.FetchStream (cyclomatic 38) · ×1
  • ImapFolder.FetchStream (cyclomatic 38) MailKit/Net/Imap/ImapFolderFetch.cs:1934 — ImapFolder.FetchStream has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.FetchStreamAsync (cyclomatic 38) · ×1
  • ImapFolder.FetchStreamAsync (cyclomatic 38) MailKit/Net/Imap/ImapFolderFetch.cs:2177 — ImapFolder.FetchStreamAsync has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyPart.TryParse (cyclomatic 36) · ×1
  • BodyPart.TryParse (cyclomatic 36) MailKit/BodyPart.cs:565 — BodyPart.TryParse has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapEngine.ProcessUntaggedResponse (cyclomatic 32) · ×1
  • ImapEngine.ProcessUntaggedResponse (cyclomatic 32) MailKit/Net/Imap/ImapEngine.cs:2798 — ImapEngine.ProcessUntaggedResponse has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapEngine.ProcessUntaggedResponseAsync (cyclomatic 32) · ×1
  • ImapEngine.ProcessUntaggedResponseAsync (cyclomatic 32) MailKit/Net/Imap/ImapEngine.cs:2952 — ImapEngine.ProcessUntaggedResponseAsync has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnnotationEntry.Parse (cyclomatic 30) · ×1
  • AnnotationEntry.Parse (cyclomatic 30) MailKit/AnnotationEntry.cs:424 — AnnotationEntry.Parse has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapCommand.Step (cyclomatic 26) · ×1
  • ImapCommand.Step (cyclomatic 26) MailKit/Net/Imap/ImapCommand.cs:534 — ImapCommand.Step has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapCommand.StepAsync (cyclomatic 26) · ×1
  • ImapCommand.StepAsync (cyclomatic 26) MailKit/Net/Imap/ImapCommand.cs:676 — ImapCommand.StepAsync has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapUtils.ParseInternalDate (cyclomatic 26) · ×1
  • ImapUtils.ParseInternalDate (cyclomatic 26) MailKit/Net/Imap/ImapUtils.cs:152 — ImapUtils.ParseInternalDate has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ImapFolder.ParseESearchResults (cyclomatic 25) · ×1
  • ImapFolder.ParseESearchResults (cyclomatic 25) MailKit/Net/Imap/ImapFolderSearch.cs:460 — ImapFolder.ParseESearchResults has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.ParseESearchResultsAsync (cyclomatic 25) · ×1
  • ImapFolder.ParseESearchResultsAsync (cyclomatic 25) MailKit/Net/Imap/ImapFolderSearch.cs:591 — ImapFolder.ParseESearchResultsAsync has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DigestChallenge.Parse (cyclomatic 25) · ×1
  • DigestChallenge.Parse (cyclomatic 25) MailKit/Security/SaslMechanismDigestMd5.cs:330 — DigestChallenge.Parse has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MessageThreader.GetThreadableSubject (cyclomatic 25) · ×1
  • MessageThreader.GetThreadableSubject (cyclomatic 25) MailKit/MessageThreader.cs:518 — MessageThreader.GetThreadableSubject has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapAuthenticationSecretDetector.DetectAuthSecrets (cyclomatic 23) · ×1
  • ImapAuthenticationSecretDetector.DetectAuthSecrets (cyclomatic 23) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:119 — ImapAuthenticationSecretDetector.DetectAuthSecrets has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapSearchQueryOptimizer.Reduce (cyclomatic 23) · ×1
  • ImapSearchQueryOptimizer.Reduce (cyclomatic 23) MailKit/Net/Imap/ImapSearchQueryOptimizer.cs:34 — ImapSearchQueryOptimizer.Reduce has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Envelope.TryParse (cyclomatic 23) · ×1
  • Envelope.TryParse (cyclomatic 23) MailKit/Envelope.cs:511 — Envelope.TryParse has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImapToken.Create (cyclomatic 22) · ×1
  • ImapToken.Create (cyclomatic 22) MailKit/Net/Imap/ImapToken.cs:126 — ImapToken.Create has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapUtils.AddFolderAttribute (cyclomatic 22) · ×1
  • ImapUtils.AddFolderAttribute (cyclomatic 22) MailKit/Net/Imap/ImapUtils.cs:553 — ImapUtils.AddFolderAttribute has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SaslMechanismScramBase.Challenge (cyclomatic 22) · ×1
  • SaslMechanismScramBase.Challenge (cyclomatic 22) MailKit/Security/SaslMechanismScramBase.cs:301 — SaslMechanismScramBase.Challenge has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnnotationEntry.ValidatePath (cyclomatic 22) · ×1
  • AnnotationEntry.ValidatePath (cyclomatic 22) MailKit/AnnotationEntry.cs:112 — AnnotationEntry.ValidatePath has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UniqueIdSet.TryParse (cyclomatic 22) · ×1
  • UniqueIdSet.TryParse (cyclomatic 22) MailKit/UniqueIdSet.cs:908 — UniqueIdSet.TryParse has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapEventGroup.Format (cyclomatic 21) · ×1
  • ImapEventGroup.Format (cyclomatic 21) MailKit/Net/Imap/ImapEventGroup.cs:118 — ImapEventGroup.Format has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.ProcessResponseCodes (cyclomatic 21) · ×1
  • ImapFolder.ProcessResponseCodes (cyclomatic 21) MailKit/Net/Imap/ImapFolder.cs:235 — ImapFolder.ProcessResponseCodes has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.QueueCreateCommand (cyclomatic 21) · ×1
  • ImapFolder.QueueCreateCommand (cyclomatic 21) MailKit/Net/Imap/ImapFolder.cs:982 — ImapFolder.QueueCreateCommand has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SslHandshakeException.Create (cyclomatic 21) · ×1
  • SslHandshakeException.Create (cyclomatic 21) MailKit/Security/SslHandshakeException.cs:187 — SslHandshakeException.Create has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapCommand.ImapCommand.ctor (cyclomatic 20) · ×1
  • ImapCommand.ImapCommand.ctor (cyclomatic 20) MailKit/Net/Imap/ImapCommand.cs:140 — ImapCommand.ImapCommand.ctor has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MessageThreader.GroupBySubject (cyclomatic 20) · ×1
  • MessageThreader.GroupBySubject (cyclomatic 20) MailKit/MessageThreader.cs:265 — MessageThreader.GroupBySubject has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapAuthenticationSecretDetector.SkipLoginToken (cyclomatic 19) · ×1
  • ImapAuthenticationSecretDetector.SkipLoginToken (cyclomatic 19) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:241 — ImapAuthenticationSecretDetector.SkipLoginToken has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.QueueStoreCommands (cyclomatic 19) · ×1
  • ImapFolder.QueueStoreCommands (cyclomatic 19) MailKit/Net/Imap/ImapFolderFlags.cs:79 — ImapFolder.QueueStoreCommands has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.TryQueueStoreCommand (cyclomatic 19) · ×1
  • ImapFolder.TryQueueStoreCommand (cyclomatic 19) MailKit/Net/Imap/ImapFolderFlags.cs:256 — ImapFolder.TryQueueStoreCommand has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MessageThreader.CreateIdTable (cyclomatic 19) · ×1
  • MessageThreader.CreateIdTable (cyclomatic 19) MailKit/MessageThreader.cs:153 — MessageThreader.CreateIdTable has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UniqueIdSet.EnumerateSerializedSubsets (cyclomatic 19) · ×1
  • UniqueIdSet.EnumerateSerializedSubsets (cyclomatic 19) MailKit/UniqueIdSet.cs:818 — UniqueIdSet.EnumerateSerializedSubsets has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapAuthenticationSecretDetector.SkipLiteralToken (cyclomatic 17) · ×1
  • ImapAuthenticationSecretDetector.SkipLiteralToken (cyclomatic 17) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:188 — ImapAuthenticationSecretDetector.SkipLiteralToken has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapFolder.BuildSortOrder (cyclomatic 17) · ×1
  • ImapFolder.BuildSortOrder (cyclomatic 17) MailKit/Net/Imap/ImapFolderSearch.cs:411 — ImapFolder.BuildSortOrder has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapUtils.FormatIndexSet (cyclomatic 17) · ×1
  • ImapUtils.FormatIndexSet (cyclomatic 17) MailKit/Net/Imap/ImapUtils.cs:262 — ImapUtils.FormatIndexSet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Envelope.Encode (cyclomatic 17) · ×1
  • Envelope.Encode (cyclomatic 17) MailKit/Envelope.cs:238 — Envelope.Encode has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Envelope.TryParse (cyclomatic 17) · ×1
  • Envelope.TryParse (cyclomatic 17) MailKit/Envelope.cs:446 — Envelope.TryParse has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapAuthenticationSecretDetector.DetectSecrets (cyclomatic 16) · ×1
  • ImapAuthenticationSecretDetector.DetectSecrets (cyclomatic 16) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:355 — ImapAuthenticationSecretDetector.DetectSecrets has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImapEngine.DetectQuirksMode (cyclomatic 16) · ×1
  • ImapEngine.DetectQuirksMode (cyclomatic 16) MailKit/Net/Imap/ImapEngine.cs:711 — ImapEngine.DetectQuirksMode has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImapFolder.QueueSearchCommand (cyclomatic 16) · ×1
  • ImapFolder.QueueSearchCommand (cyclomatic 16) MailKit/Net/Imap/ImapFolderSearch.cs:993 — ImapFolder.QueueSearchCommand has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EnvelopeAddress.ToMailboxAddress (cyclomatic 16) · ×1
  • EnvelopeAddress.ToMailboxAddress (cyclomatic 16) MailKit/Net/Imap/ImapUtils.cs:2138 — EnvelopeAddress.ToMailboxAddress has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BodyPart.TryParse (cyclomatic 16) · ×1
  • BodyPart.TryParse (cyclomatic 16) MailKit/BodyPart.cs:411 — BodyPart.TryParse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D11 · Test Reliability · Test reliability not measured · ×1
  • Test reliability not measured — test suite did not build — Test reliability NOT MEASURED: this repository did not build in our analyzer environment (a C#/MSBuild compiler error), so no test ever ran and flakiness could not be exercised. It is excluded from the score rather than counted as a defect. We did not read WHERE the failing diagnostic is, so this does not claim the fault is in your test code — a repository written for an older SDK band can compile for you and not for us. Run `dotnet build` on this commit: if it succeeds, the gap is ours and nothing here is a defect in your code.
D18 · Solution Shape · Monorepo · ×1
  • Monorepo: only 1 of 6 solutions was scored — This repository contains 6 .NET solutions, but a scan analyzes ONE. Every score, lens, and finding here reflects only `MailKit.sln` — the other 5 (`MailKitLite.sln`, `samples/ImapClientDemo.Android/ImapClientDemo.Android.sln`, `samples/ImapClientDemo.iOS/ImapClientDemo.iOS.sln`, `samples/ImapClientDemo/ImapClientDemo.sln`, `samples/ImapIdle/ImapIdle.sln`) were not analyzed and are not represented in the headline. To cover them, scan each solution as its own target and group them in a Solution or Product for a portfolio roll-up. If a secondary solution is an archived or vendored tree, declare it — `.gitattributes` (`path/** linguist-vendored`) or `.editorconfig` (`[path/**] generated_code = true`) — to exclude it from discovery the same way generated code is.
D18 · Solution Shape · Solution references a project that does not exist · ×1
  • Solution references a project that does not exist MailKit.sln — `MailKit.sln` declares 1 project file(s) that are missing from the tree (`submodules/MimeKit/MimeKit/MimeKit.csproj`). A solution-level restore or build fails on a dangling reference, so anyone building the solution rather than an individual project is blocked. Delete the stale entry from the solution, or restore the missing project file.
D2 · Cognitive Complexity · ImapFolder.ParseSummaryItems (cognitive 105) · ×1
  • ImapFolder.ParseSummaryItems (cognitive 105) MailKit/Net/Imap/ImapFolderFetch.cs:235 — ImapFolder.ParseSummaryItems has cognitive complexity 105 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.ParseSummaryItemsAsync (cognitive 105) · ×1
  • ImapFolder.ParseSummaryItemsAsync (cognitive 105) MailKit/Net/Imap/ImapFolderFetch.cs:479 — ImapFolder.ParseSummaryItemsAsync has cognitive complexity 105 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.FetchStream (cognitive 90) · ×1
  • ImapFolder.FetchStream (cognitive 90) MailKit/Net/Imap/ImapFolderFetch.cs:1934 — ImapFolder.FetchStream has cognitive complexity 90 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.FetchStreamAsync (cognitive 90) · ×1
  • ImapFolder.FetchStreamAsync (cognitive 90) MailKit/Net/Imap/ImapFolderFetch.cs:2177 — ImapFolder.FetchStreamAsync has cognitive complexity 90 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.ProcessCapabilityToken (cognitive 77) · ×1
  • ImapEngine.ProcessCapabilityToken (cognitive 77) MailKit/Net/Imap/ImapEngine.cs:1329 — ImapEngine.ProcessCapabilityToken has cognitive complexity 77 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ImapFolder.FormatSummaryItems (cognitive 68) · ×1
  • ImapFolder.FormatSummaryItems (cognitive 68) MailKit/Net/Imap/ImapFolderFetch.cs:746 — ImapFolder.FormatSummaryItems has cognitive complexity 68 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · BodyPart.TryParse (cognitive 66) · ×1
  • BodyPart.TryParse (cognitive 66) MailKit/BodyPart.cs:565 — BodyPart.TryParse has cognitive complexity 66 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapEngine.GetResponseCodeType (cognitive 57) · ×1
  • ImapEngine.GetResponseCodeType (cognitive 57) MailKit/Net/Imap/ImapEngine.cs:1805 — ImapEngine.GetResponseCodeType has cognitive complexity 57 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ImapEngine.ProcessUntaggedResponse (cognitive 55) · ×1
  • ImapEngine.ProcessUntaggedResponse (cognitive 55) MailKit/Net/Imap/ImapEngine.cs:2798 — ImapEngine.ProcessUntaggedResponse has cognitive complexity 55 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.ProcessUntaggedResponseAsync (cognitive 55) · ×1
  • ImapEngine.ProcessUntaggedResponseAsync (cognitive 55) MailKit/Net/Imap/ImapEngine.cs:2952 — ImapEngine.ProcessUntaggedResponseAsync has cognitive complexity 55 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · AnnotationEntry.Parse (cognitive 52) · ×1
  • AnnotationEntry.Parse (cognitive 52) MailKit/AnnotationEntry.cs:424 — AnnotationEntry.Parse has cognitive complexity 52 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.ParseESearchResults (cognitive 49) · ×1
  • ImapFolder.ParseESearchResults (cognitive 49) MailKit/Net/Imap/ImapFolderSearch.cs:460 — ImapFolder.ParseESearchResults has cognitive complexity 49 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.ParseESearchResultsAsync (cognitive 49) · ×1
  • ImapFolder.ParseESearchResultsAsync (cognitive 49) MailKit/Net/Imap/ImapFolderSearch.cs:591 — ImapFolder.ParseESearchResultsAsync has cognitive complexity 49 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SslHandshakeException.Create (cognitive 49) · ×1
  • SslHandshakeException.Create (cognitive 49) MailKit/Security/SslHandshakeException.cs:187 — SslHandshakeException.Create has cognitive complexity 49 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapCommand.Step (cognitive 44) · ×1
  • ImapCommand.Step (cognitive 44) MailKit/Net/Imap/ImapCommand.cs:534 — ImapCommand.Step has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapCommand.StepAsync (cognitive 44) · ×1
  • ImapCommand.StepAsync (cognitive 44) MailKit/Net/Imap/ImapCommand.cs:676 — ImapCommand.StepAsync has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapToken.Create (cognitive 44) · ×1
  • ImapToken.Create (cognitive 44) MailKit/Net/Imap/ImapToken.cs:126 — ImapToken.Create has cognitive complexity 44 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UniqueIdSet.TryParse (cognitive 44) · ×1
  • UniqueIdSet.TryParse (cognitive 44) MailKit/UniqueIdSet.cs:908 — UniqueIdSet.TryParse has cognitive complexity 44 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.ParseResponseCode (cognitive 42) · ×1
  • ImapEngine.ParseResponseCode (cognitive 42) MailKit/Net/Imap/ImapEngine.cs:1931 — ImapEngine.ParseResponseCode has cognitive complexity 42 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.ParseResponseCodeAsync (cognitive 42) · ×1
  • ImapEngine.ParseResponseCodeAsync (cognitive 42) MailKit/Net/Imap/ImapEngine.cs:2257 — ImapEngine.ParseResponseCodeAsync has cognitive complexity 42 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.UpdateNamespaces (cognitive 41) · ×1
  • ImapEngine.UpdateNamespaces (cognitive 41) MailKit/Net/Imap/ImapEngine.cs:1565 — ImapEngine.UpdateNamespaces has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.UpdateNamespacesAsync (cognitive 41) · ×1
  • ImapEngine.UpdateNamespacesAsync (cognitive 41) MailKit/Net/Imap/ImapEngine.cs:1660 — ImapEngine.UpdateNamespacesAsync has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · MessageThreader.GetThreadableSubject (cognitive 41) · ×1
  • MessageThreader.GetThreadableSubject (cognitive 41) MailKit/MessageThreader.cs:518 — MessageThreader.GetThreadableSubject has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SaslMechanismScramBase.Challenge (cognitive 37) · ×1
  • SaslMechanismScramBase.Challenge (cognitive 37) MailKit/Security/SaslMechanismScramBase.cs:301 — SaslMechanismScramBase.Challenge has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapAuthenticationSecretDetector.DetectAuthSecrets (cognitive 36) · ×1
  • ImapAuthenticationSecretDetector.DetectAuthSecrets (cognitive 36) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:119 — ImapAuthenticationSecretDetector.DetectAuthSecrets has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DigestChallenge.Parse (cognitive 36) · ×1
  • DigestChallenge.Parse (cognitive 36) MailKit/Security/SaslMechanismDigestMd5.cs:330 — DigestChallenge.Parse has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageThreader.CreateIdTable (cognitive 35) · ×1
  • MessageThreader.CreateIdTable (cognitive 35) MailKit/MessageThreader.cs:153 — MessageThreader.CreateIdTable has cognitive complexity 35 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UniqueIdSet.EnumerateSerializedSubsets (cognitive 35) · ×1
  • UniqueIdSet.EnumerateSerializedSubsets (cognitive 35) MailKit/UniqueIdSet.cs:818 — UniqueIdSet.EnumerateSerializedSubsets has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SaslMechanism.IsProhibited (cognitive 34) · ×1
  • SaslMechanism.IsProhibited (cognitive 34) MailKit/Security/SaslMechanism.cs:648 — SaslMechanism.IsProhibited has cognitive complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ImapAuthenticationSecretDetector.SkipLoginToken (cognitive 32) · ×1
  • ImapAuthenticationSecretDetector.SkipLoginToken (cognitive 32) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:241 — ImapAuthenticationSecretDetector.SkipLoginToken has cognitive complexity 32 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapCommand.ImapCommand.ctor (cognitive 32) · ×1
  • ImapCommand.ImapCommand.ctor (cognitive 32) MailKit/Net/Imap/ImapCommand.cs:140 — ImapCommand.ImapCommand.ctor has cognitive complexity 32 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.BuildQuery (cognitive 31) · ×1
  • ImapFolder.BuildQuery (cognitive 31) MailKit/Net/Imap/ImapFolderSearch.cs:112 — ImapFolder.BuildQuery has cognitive complexity 31 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ImapEventGroup.Format (cognitive 30) · ×1
  • ImapEventGroup.Format (cognitive 30) MailKit/Net/Imap/ImapEventGroup.cs:118 — ImapEventGroup.Format has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyPartCollection.IndexOf (cognitive 29) · ×1
  • BodyPartCollection.IndexOf (cognitive 29) MailKit/BodyPartCollection.cs:207 — BodyPartCollection.IndexOf has cognitive complexity 29 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapUtils.FormatIndexSet (cognitive 28) · ×1
  • ImapUtils.FormatIndexSet (cognitive 28) MailKit/Net/Imap/ImapUtils.cs:262 — ImapUtils.FormatIndexSet has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Envelope.Encode (cognitive 28) · ×1
  • Envelope.Encode (cognitive 28) MailKit/Envelope.cs:238 — Envelope.Encode has cognitive complexity 28 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImapFolder.QueueSortCommand (cognitive 27) · ×1
  • ImapFolder.QueueSortCommand (cognitive 27) MailKit/Net/Imap/ImapFolderSearch.cs:1523 — ImapFolder.QueueSortCommand has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageSummary.TryGetMessageBody (cognitive 27) · ×1
  • MessageSummary.TryGetMessageBody (cognitive 27) MailKit/MessageSummary.cs:206 — MessageSummary.TryGetMessageBody has cognitive complexity 27 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.TryQueueGetSubfoldersCommand (cognitive 26) · ×1
  • ImapFolder.TryQueueGetSubfoldersCommand (cognitive 26) MailKit/Net/Imap/ImapFolder.cs:1618 — ImapFolder.TryQueueGetSubfoldersCommand has cognitive complexity 26 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapFolder.QueueSearchCommand (cognitive 26) · ×1
  • ImapFolder.QueueSearchCommand (cognitive 26) MailKit/Net/Imap/ImapFolderSearch.cs:993 — ImapFolder.QueueSearchCommand has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ByteArrayBuilder.Equals (cognitive 26) · ×1
  • ByteArrayBuilder.Equals (cognitive 26) MailKit/ByteArrayBuilder.cs:99 — ByteArrayBuilder.Equals has cognitive complexity 26 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UniqueIdSet.BinaryInsertAscending (cognitive 25) · ×1
  • UniqueIdSet.BinaryInsertAscending (cognitive 25) MailKit/UniqueIdSet.cs:269 — UniqueIdSet.BinaryInsertAscending has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UniqueIdSet.BinaryInsertDescending (cognitive 25) · ×1
  • UniqueIdSet.BinaryInsertDescending (cognitive 25) MailKit/UniqueIdSet.cs:326 — UniqueIdSet.BinaryInsertDescending has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · Envelope.TryParse (cognitive 24) · ×1
  • Envelope.TryParse (cognitive 24) MailKit/Envelope.cs:511 — Envelope.TryParse has cognitive complexity 24 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ImapEncoding.Decode (cognitive 23) · ×1
  • ImapEncoding.Decode (cognitive 23) MailKit/Net/Imap/ImapEncoding.cs:45 — ImapEncoding.Decode has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEngine.QueueGetFoldersCommand (cognitive 23) · ×1
  • ImapEngine.QueueGetFoldersCommand (cognitive 23) MailKit/Net/Imap/ImapEngine.cs:4033 — ImapEngine.QueueGetFoldersCommand has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · Envelope.TryParse (cognitive 23) · ×1
  • Envelope.TryParse (cognitive 23) MailKit/Envelope.cs:446 — Envelope.TryParse has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProtocolLogger.Log (cognitive 23) · ×1
  • ProtocolLogger.Log (cognitive 23) MailKit/ProtocolLogger.cs:228 — ProtocolLogger.Log has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapClient.AuthenticateAsync (cognitive 22) · ×1
  • ImapClient.AuthenticateAsync (cognitive 22) MailKit/Net/Imap/AsyncImapClient.cs:393 — ImapClient.AuthenticateAsync has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapAuthenticationSecretDetector.SkipLiteralToken (cognitive 22) · ×1
  • ImapAuthenticationSecretDetector.SkipLiteralToken (cognitive 22) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:188 — ImapAuthenticationSecretDetector.SkipLiteralToken has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapClient.Authenticate (cognitive 22) · ×1
  • ImapClient.Authenticate (cognitive 22) MailKit/Net/Imap/ImapClient.cs:1270 — ImapClient.Authenticate has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.ProcessResponseCodes (cognitive 22) · ×1
  • ImapFolder.ProcessResponseCodes (cognitive 22) MailKit/Net/Imap/ImapFolder.cs:235 — ImapFolder.ProcessResponseCodes has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.QueueStoreCommands (cognitive 22) · ×1
  • ImapFolder.QueueStoreCommands (cognitive 22) MailKit/Net/Imap/ImapFolderFlags.cs:79 — ImapFolder.QueueStoreCommands has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.TryQueueStoreCommand (cognitive 22) · ×1
  • ImapFolder.TryQueueStoreCommand (cognitive 22) MailKit/Net/Imap/ImapFolderFlags.cs:256 — ImapFolder.TryQueueStoreCommand has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageThreader.GroupBySubject (cognitive 22) · ×1
  • MessageThreader.GroupBySubject (cognitive 22) MailKit/MessageThreader.cs:265 — MessageThreader.GroupBySubject has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapUtils.AddFolderAttribute (cognitive 21) · ×1
  • ImapUtils.AddFolderAttribute (cognitive 21) MailKit/Net/Imap/ImapUtils.cs:553 — ImapUtils.AddFolderAttribute has cognitive complexity 21 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SocketUtils.Connect (cognitive 21) · ×1
  • SocketUtils.Connect (cognitive 21) MailKit/Net/SocketUtils.cs:111 — SocketUtils.Connect has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnotationEntry.ValidatePath (cognitive 21) · ×1
  • AnnotationEntry.ValidatePath (cognitive 21) MailKit/AnnotationEntry.cs:112 — AnnotationEntry.ValidatePath has cognitive complexity 21 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · UniqueIdSet.BinarySearch (cognitive 21) · ×1
  • UniqueIdSet.BinarySearch (cognitive 21) MailKit/UniqueIdSet.cs:220 — UniqueIdSet.BinarySearch has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapEncoding.Encode (cognitive 19) · ×1
  • ImapEncoding.Encode (cognitive 19) MailKit/Net/Imap/ImapEncoding.cs:107 — ImapEncoding.Encode has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.QueueCreateCommand (cognitive 19) · ×1
  • ImapFolder.QueueCreateCommand (cognitive 19) MailKit/Net/Imap/ImapFolder.cs:982 — ImapFolder.QueueCreateCommand has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.QueueMultiAppendCommand (cognitive 19) · ×1
  • ImapFolder.QueueMultiAppendCommand (cognitive 19) MailKit/Net/Imap/ImapFolder.cs:4617 — ImapFolder.QueueMultiAppendCommand has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapUtils.ParseInternalDate (cognitive 19) · ×1
  • ImapUtils.ParseInternalDate (cognitive 19) MailKit/Net/Imap/ImapUtils.cs:152 — ImapUtils.ParseInternalDate has cognitive complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ImapUtils.ParseBody (cognitive 19) · ×1
  • ImapUtils.ParseBody (cognitive 19) MailKit/Net/Imap/ImapUtils.cs:1901 — ImapUtils.ParseBody has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapUtils.ParseBodyAsync (cognitive 19) · ×1
  • ImapUtils.ParseBodyAsync (cognitive 19) MailKit/Net/Imap/ImapUtils.cs:2008 — ImapUtils.ParseBodyAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyPart.TryParse (cognitive 19) · ×1
  • BodyPart.TryParse (cognitive 19) MailKit/BodyPart.cs:411 — BodyPart.TryParse has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapClient.PostConnectAsync (cognitive 18) · ×1
  • ImapClient.PostConnectAsync (cognitive 18) MailKit/Net/Imap/AsyncImapClient.cs:516 — ImapClient.PostConnectAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapAuthenticationSecretDetector.DetectSecrets (cognitive 18) · ×1
  • ImapAuthenticationSecretDetector.DetectSecrets (cognitive 18) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:355 — ImapAuthenticationSecretDetector.DetectSecrets has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapClient.PostConnect (cognitive 18) · ×1
  • ImapClient.PostConnect (cognitive 18) MailKit/Net/Imap/ImapClient.cs:1456 — ImapClient.PostConnect has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapEngine.GetStatusQuery (cognitive 18) · ×1
  • ImapEngine.GetStatusQuery (cognitive 18) MailKit/Net/Imap/ImapEngine.cs:3993 — ImapEngine.GetStatusQuery has cognitive complexity 18 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ImapFolder.QueueStoreCommands (cognitive 18) · ×1
  • ImapFolder.QueueStoreCommands (cognitive 18) MailKit/Net/Imap/ImapFolderFlags.cs:472 — ImapFolder.QueueStoreCommands has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.TryQueueStoreCommand (cognitive 18) · ×1
  • ImapFolder.TryQueueStoreCommand (cognitive 18) MailKit/Net/Imap/ImapFolderFlags.cs:653 — ImapFolder.TryQueueStoreCommand has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapUtils.ParseFolderList (cognitive 18) · ×1
  • ImapUtils.ParseFolderList (cognitive 18) MailKit/Net/Imap/ImapUtils.cs:672 — ImapUtils.ParseFolderList has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapUtils.ParseFolderListAsync (cognitive 18) · ×1
  • ImapUtils.ParseFolderListAsync (cognitive 18) MailKit/Net/Imap/ImapUtils.cs:759 — ImapUtils.ParseFolderListAsync has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ImapUtils.ParseMultipart (cognitive 18) · ×1
  • ImapUtils.ParseMultipart (cognitive 18) MailKit/Net/Imap/ImapUtils.cs:1539 — ImapUtils.ParseMultipart has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapUtils.ParseMultipartAsync (cognitive 18) · ×1
  • ImapUtils.ParseMultipartAsync (cognitive 18) MailKit/Net/Imap/ImapUtils.cs:1630 — ImapUtils.ParseMultipartAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SaslMechanismDigestMd5.Challenge (cognitive 18) · ×1
  • SaslMechanismDigestMd5.Challenge (cognitive 18) MailKit/Security/SaslMechanismDigestMd5.cs:134 — SaslMechanismDigestMd5.Challenge has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapSearchQueryOptimizer.Reduce (cognitive 17) · ×1
  • ImapSearchQueryOptimizer.Reduce (cognitive 17) MailKit/Net/Imap/ImapSearchQueryOptimizer.cs:34 — ImapSearchQueryOptimizer.Reduce has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapStream.TryReadQuotedString (cognitive 17) · ×1
  • ImapStream.TryReadQuotedString (cognitive 17) MailKit/Net/Imap/ImapStream.cs:547 — ImapStream.TryReadQuotedString has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyPart.TryParse (cognitive 17) · ×1
  • BodyPart.TryParse (cognitive 17) MailKit/BodyPart.cs:348 — BodyPart.TryParse has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Envelope.TryParse (cognitive 17) · ×1
  • Envelope.TryParse (cognitive 17) MailKit/Envelope.cs:400 — Envelope.TryParse has cognitive complexity 17 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImapAuthenticationSecretDetector.DetectLoginSecrets (cognitive 16) · ×1
  • ImapAuthenticationSecretDetector.DetectLoginSecrets (cognitive 16) MailKit/Net/Imap/ImapAuthenticationSecretDetector.cs:319 — ImapAuthenticationSecretDetector.DetectLoginSecrets has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImapFolder.BuildSortOrder (cognitive 16) · ×1
  • ImapFolder.BuildSortOrder (cognitive 16) MailKit/Net/Imap/ImapFolderSearch.cs:411 — ImapFolder.BuildSortOrder has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyPart.TryParse (cognitive 16) · ×1
  • BodyPart.TryParse (cognitive 16) MailKit/BodyPart.cs:300 — BodyPart.TryParse has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Envelope.TryParse (cognitive 16) · ×1
  • Envelope.TryParse (cognitive 16) MailKit/Envelope.cs:352 — Envelope.TryParse has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniqueIdSet.Append (cognitive 16) · ×1
  • UniqueIdSet.Append (cognitive 16) MailKit/UniqueIdSet.cs:383 — UniqueIdSet.Append has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniqueIdSet.Remove (cognitive 16) · ×1
  • UniqueIdSet.Remove (cognitive 16) MailKit/UniqueIdSet.cs:524 — UniqueIdSet.Remove has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D36 · Supply-chain Provenance & Signing · Unpinned build actions · ×1
  • Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 11 floating ref(s) across 3 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
D36 · Supply-chain Provenance & Signing · PR-triggered workflow without a permissions block · ×1
  • PR-triggered workflow without a permissions block — 2 workflow(s) triggered by pull_request declare no `permissions:` block (main.yml, aot-compatibility.yml) and so run with the repository's default GITHUB_TOKEN scope, while 1 sibling workflow in the same repository is already scoped. Pull-request runs build the least-trusted code in the repository; give each of these workflows its own least-privilege block — `permissions: {contents: read}` at the top of the workflow, widened per job only where a job genuinely writes.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) MailKit/Net/Imap/ImapClient.cs:262 — MailKit/Net/Imap/ImapClient.cs:262-280 | MailKit/Net/Pop3/Pop3Client.cs:261-279 | MailKit/Net/Smtp/SmtpClient.cs:628-646 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapClient.cs:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) MailKit/BodyPart.cs:328 — MailKit/BodyPart.cs:328-346 | MailKit/Envelope.cs:380-398 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/BodyPart.cs:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) MailKit/UniqueIdSet.cs:307 — MailKit/UniqueIdSet.cs:307-324 | MailKit/UniqueIdSet.cs:364-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/UniqueIdSet.cs:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) MailKit/Net/Imap/ImapClient.cs:1328 — MailKit/Net/Imap/ImapClient.cs:1328-1344 | MailKit/Net/Imap/ImapClient.cs:1361-1380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapClient.cs:1328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) MailKit/Net/Imap/ImapClient.cs:1789 — MailKit/Net/Imap/ImapClient.cs:1789-1804 | MailKit/Net/Pop3/Pop3Client.cs:1433-1448 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapClient.cs:1789` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×1
  • Duplicated block (12 lines × 2) MailKit/Net/Imap/ImapEngine.cs:3429 — MailKit/Net/Imap/ImapEngine.cs:3429-3441 | MailKit/Net/Imap/ImapEngine.cs:3911-3922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×1
  • Duplicated block (10 lines × 2) MailKit/Security/SaslMechanismOAuth2.cs:143 — MailKit/Security/SaslMechanismOAuth2.cs:143-152 | MailKit/Security/SaslMechanismOAuthBearer.cs:194-203 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Security/SaslMechanismOAuth2.cs:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×1
  • Duplicated block (8 lines × 2) MailKit/Net/Imap/ImapFolderFetch.cs:370 — MailKit/Net/Imap/ImapFolderFetch.cs:370-377 | MailKit/Net/Imap/ImapFolderFetch.cs:402-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `MailKit/Net/Imap/ImapFolderFetch.cs:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — test suite did not build — Coverage NOT MEASURED: this repository did not build in our analyzer environment (a C#/MSBuild compiler error), so no coverage could be collected. It is excluded from the score rather than counted as a near-zero defect. We did not read WHERE the failing diagnostic is, so this does not claim the fault is in your test code — a repository written for an older SDK band can compile for you and not for us. Run `dotnet build` on this commit; if it succeeds, the gap is ours. Committing the Cobertura/OpenCover/lcov report your CI already produces also lets us measure real coverage without building anything.
Recommendation — 9 finding(s)
D24 · Comment Value · redundant comment · ×2
  • redundant comment MailKit/AccessControlList.cs:18 — "THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" —
  • redundant comment MailKit/DuplexStream.cs:6 — "COPYRIGHT (c) 2013-2026 .NET Foundation and Contributors" —
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 42 significant file(s) lose their only recent owner: MailKit/MailFolder.cs, MailKit/IMailFolder.cs, MailKit/Net/Imap/ImapFolder.cs, MailKit/Net/Imap/ImapFolderFetch.cs, MailKit/Net/Imap/ImapEngine.cs, MailKit/Net/Imap/ImapUtils.cs, MailKit/Net/Smtp/SmtpClient.cs, MailKit/Net/Imap/ImapClient.cs (+34 more). Pair on, review, or document these before any departure.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found at common paths; consider documenting architectural decisions in Docs/ADL/ or similar.
D23 · Boundary Type-Coupling · Bounded contexts not declared · ×1
  • Bounded contexts not declared — At 106k LoC across 8 projects the codebase is large and multi-module, so explicit bounded contexts are needed. Name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `MailKit(netstandard2.0)` (106065 LoC, 176 public types across 7 namespaces). Review these for cohesion — split a project that spans unrelated responsibilities.
D36 · Supply-chain Provenance & Signing · No build provenance · ×1
  • No build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
D36 · Supply-chain Provenance & Signing · No artifact signing · ×1
  • No artifact signing — No artifact signing found in CI — sign your released artifacts with whatever your ecosystem ships (a GPG/minisign detached signature — or `cosign sign-blob` — over the release archives, or over a checksum file published alongside them, Authenticode via signtool, or `dotnet nuget sign` for packages) so consumers can verify what you built.
D36 · Supply-chain Provenance & Signing · No SBOM · ×1
  • No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (`sbom-tool generate` (install it with `dotnet tool install --global Microsoft.Sbom.DotNetTool`) or `dotnet CycloneDX` over the solution, `syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
Info — 3 finding(s)
D18 · Solution Shape · Build status unknown · ×1
  • Build status unknown — The build did not finish within its budget on this run; structural metrics are reported, build/warning status is unknown.
D19 · Documentation Quality · XML-doc coverage · ×1
  • XML-doc coverage: MailKit(netstandard2.0) MailKit/MailKit.csproj — MailKit(netstandard2.0): 84 % XML-doc coverage (2164/2566).
D22 · Internal API Consistency · No exposed public API · ×1
  • No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaksgitleaks detect --no-banner --report-format json --report-path /dev/stdout --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D29 · Static Analysis (SAST)semgrepsemgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --json --quiet --timeout 0 --metrics off .12artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesdotnetdotnet: not applicable — the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan for NuGet CVEs — excluded rather than scored; re-run on an SDK that can restore this solution0
D31 · IaC & Container Securitytrivytrivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.0
D32 · Data Compliance (PII/GDPR)semgrepsemgrep: not applicable — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.0
D33 · JS/npm Dependency Vulnerabilitiestrivytrivy: not applicable — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.0
D38 · OSV Dependency Vulnerabilitiesosv-scannerosv-scanner: not applicable — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.0
D40 · Network Egress Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0
D41 · Kernel & Syscall Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0
D42 · Runtime Threat Enforcementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0

Run 019fd2c5-95ce-7db9-84d6-80432049d365 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Appendix C — Personal-data map

Every field, property and record parameter whose name is conventional personal data — 6 field(s) across 2 categories, each with an exact repo-relative file:line. This is the data inventory a compliance review starts from — right-to-erasure, retention, minimisation. Detected by name with a deliberately specific classifier (the same one the GDPR dimensions use, so CardDefinition or FileName don't trip); informational — it feeds no score.

Email — 3 field(s)
  • IMessageSummary.EmailId MailKit/IMessageSummary.cs:360
  • MessageSummary.EmailId MailKit/MessageSummary.cs:631
  • ThreadableNode.EmailId MailKit/MessageThreader.cs:134
Name — 3 field(s)
  • IMailFolder.FullName MailKit/IMailFolder.cs:186
  • MailFolder.FullName MailKit/MailFolder.cs:290
  • ImapFolderConstructorArgs.FullName MailKit/Net/Imap/ImapFolderConstructorArgs.cs:88

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md