Public report of guillaumemeyer/watermarks-remover, published 16 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 16 November 2026, 20:08 UTC · Survey ID cd_569300a414fe4af8804a3b8b9cacf1b0

guillaumemeyer/watermarks-remover

Measured 16 November 2026, 20:06 UTC, at code version 5a62be6

CAI score 62.8out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Down 1.3 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 24,175 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Production Readiness, 55.9

Findings by how serious they are

5 critical 335 serious 49 minor

9 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 20:06 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

46of 46 dimensions measured by tools.
353of 389 findings point to an exact file and line, so you can open each one in the code. The other 36 concern the repository as a whole, such as missing documentation.
46dimensions across 5 lenses, read from 24,175 lines of product code in 5 projects.
Chapters

Executive summary

guillaumemeyer/watermarks-remover falls short of our standard for a preview release because we found no logging, tracing or health checks in the code. It scores 62.8 out of 100 and is rated Adequate, and all five of its critical findings are security problems.

Production Readiness, at 55.9, is the weakest lens and counts most in the score. The best first step is logging through a logging library, worth about 5.6 points. Recording design decisions comes next, worth about 3.6 points. Raising Production Readiness to 62 would lift the score to about 65.6.

Three known security holes in the packages the code depends on can be used by attackers. One automatic update takes new releases before a bad one can be spotted. Updating the vulnerable packages and setting a waiting period for automatic updates would close both risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command.

The product code is 24,175 lines, about €48,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 55.9 · counts for 47%Maturity 61.5 · counts for 26%Code Health 66.5 · counts for 14%Security and Compliance 81.3 · counts for 8%Architecture 100.0 · counts for 4%

If Production Readiness rose from 55.9 to 62, the lowest score rated Strong, the score would rise from 62.8 to about 65.6.

Code composition: what the lines of code are
Product code 57%Tests 43%
New since the last survey: 21 findings

These 21 critical or serious findings weren't in the previous survey, on 4 November 2026.

  • Code Duplication · Edited copy of a member (61 corresponding lines) service/scripts/image_meta.py
  • Code Duplication · Edited copy of a member (21 corresponding lines) service/scripts/synthid_score_server.py
  • Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) service/scripts/server.py
  • Code Duplication · Edited copy of a member (28 corresponding lines) service/scripts/format_dispatch.py
  • Code Duplication · Edited copy of a member (19 corresponding lines) service/scripts/container_meta.py
  • Code Duplication · Edited copy of a member (14 corresponding lines) service/scripts/detect_text_watermark.py
  • Code Duplication · Edited copy of a member (18 corresponding lines) service/scripts/bench_synthid_text.py
  • Code Duplication · Edited copy of a member (11 corresponding lines) service/scripts/server.py
  • Code Duplication · Edited copy of a member (12 corresponding lines) service/scripts/container_meta.py
  • Code Duplication · Edited copy of a member (31 corresponding lines) service/scripts/clean_audio.py
  • Code Duplication · Edited copy of a member (4 corresponding lines) service/scripts/text_unicode.py
  • Code Coverage · Low coverage: install_skill.py install_skill.py
  • Code Coverage · Low coverage: service/scripts/clean_audio.py service/scripts/clean_audio.py
  • Code Coverage · Low coverage: service/scripts/clean_file.py service/scripts/clean_file.py
  • Code Coverage · Low coverage: service/scripts/clean_video.py service/scripts/clean_video.py
  • Code Coverage · Low coverage: service/scripts/detect_text_watermark.py service/scripts/detect_text_watermark.py
  • Code Coverage · Low coverage: service/scripts/hook_written_file.py service/scripts/hook_written_file.py
  • Code Coverage · Low coverage: service/scripts/markdiffusion_harness.py service/scripts/markdiffusion_harness.py
  • Code Coverage · Low coverage: stealer/__init__.py stealer/__init__.py
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Dependency Vulnerabilities · REDACTED

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 11 findings

These 11 critical or serious findings were in the previous survey, on 4 November 2026, and are gone from this one.

  • Code Duplication · Duplicated block (21–22 lines × 2) service/scripts/bench_synthid_text.py
  • Code Duplication · Duplicated block (18 lines × 2) service/scripts/clean_ctrlregen.py
  • Code Duplication · Duplicated block (18 lines × 2) service/scripts/clean_image.py
  • Code Duplication · Duplicated block (11 lines × 2) service/scripts/text_watermark.py
  • Code Duplication · Duplicated block (10 lines × 2) service/scripts/text_watermark.py
  • Code Duplication · Duplicated block (10 lines × 2) service/scripts/text_watermark.py
  • Code Duplication · Duplicated block (6–9 lines × 2) service/scripts/detect_text_watermark.py
  • Code Duplication · Duplicated block (5–8 lines × 2) service/scripts/bench_synthid_text.py
  • Code Duplication · Duplicated block (7 lines × 2) service/scripts/bench_synthid_text.py
  • Churn × Complexity Hotspots · Hotspot: service/scripts/clean_ctrlregen.py service/scripts/clean_ctrlregen.py
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
Rebuild cost: about €48,000 · Estimate
Cost to rebuild€16,000 to €79,000, for 263 to 836 hours of work, about 0.3 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 63. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 24,175 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Log through `logging.getLogger(__name__)` (or structlog) with a JSON formatter at meaningful points in the modules you run.
Raises the score by about 5.6 points · Medium effort · Observability
2
Record your significant design decisions.
Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Raises the score by about 3.6 points · Medium effort · Architecture documentation
3
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Raises the score by about 3.4 points · Medium effort · Deployment & Rollback

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Files that change often carry extra risk · Combined risk
One file is changed often and is hard to read, which makes it the likeliest place for a mistake. It also has under half its code tested, or was written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to this file therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (17 files) · Code Coverage (9 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: clean_file.py
What to do: Add tests to these files and have a second person review every change to them, starting with clean_file.py.
Where the investment is most exposed · Value at risk
This code would cost about €48,000 to build again, about 0.3 person-years of work. Its weakest lens is Production Readiness, at 55.9 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Log through `logging.getLogger(__name__)` (or structlog) with a JSON formatter at meaningful points in the modules you run. Of all the actions in this report, it raises the score most for the work it takes: about 5.6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 4.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 18% on every change. The history of the code shows how much it changes: about 65,434 lines over the last 90 days, which is about 265,371 lines a year. At that pace, the extra work comes to an estimated 53.6 to 321.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch (root) (root) hooks hooks service service skills skills stealer stealer

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

22 modules, with 8 dependencies between them. Every module uses only modules listed above it, so there are no loops.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 (global)2 hooks3 install_skill4 service.scripts.av_meta5 service.scripts.bench_synthid_text6 service.scripts.container_meta7 service.scripts.detect_text_watermark8 service.scripts.image_meta9 service.scripts.markdiffusion_harness10 service.scripts.rewrite_text11 service.scripts.score_stylometry12 service.scripts.server13 service.scripts.synthid_score_server14 service.scripts.synthid_text_server15 service.scripts.text_detectors16 service.scripts.text_unicode17 service.scripts.text_watermark18 skills.clean-user-facing-text.scripts.score_stylometry19 skills.clean-user-facing-text.scripts.text_unicode20 stealer21 service.scripts22 skills.clean-user-facing-text.scripts
1 (global)
2 hooks
3 install_skill
4 service.scripts.av_meta
5 service.scripts.bench_synthid_text
6 service.scripts.container_meta
7 service.scripts.detect_text_watermark
8 service.scripts.image_meta
9 service.scripts.markdiffusion_harness
10 service.scripts.rewrite_text
11 service.scripts.score_stylometry
12 service.scripts.server
13 service.scripts.synthid_score_server
14 service.scripts.synthid_text_server
15 service.scripts.text_detectors
16 service.scripts.text_unicode
17 service.scripts.text_watermark
18 skills.clean-user-facing-text.scripts.score_stylometry
19 skills.clean-user-facing-text.scripts.text_unicode
20 stealer
21 service.scripts111111
22 skills.clean-user-facing-text.scripts11
Uses a module listed above itPart of a loopThe module itself
1 (global)2 hooks3 install_skill4 service.scripts.av_meta5 service.scripts.bench_synthid_text6 service.scripts.container_meta7 service.scripts.detect_text_watermark8 service.scripts.image_meta9 service.scripts.markdiffusion_harness10 service.scripts.rewrite_text11 service.scripts.score_stylometry12 service.scripts.server13 service.scripts.synthid_score_server14 service.scripts.synthid_text_server15 service.scripts.text_detectors16 service.scripts.text_unicode17 service.scripts.text_watermark18 skills.clean-user-facing-text.scripts.score_stylometry19 skills.clean-user-facing-text.scripts.text_unicode20 stealer21 service.scripts22 skills.clean-user-facing-text.scripts(global)1hooks2install_skill3service.scripts.av_meta4service.scripts.bench_synthid_text5service.scripts.container_meta6service.scripts.detect_text_watermark7service.scripts.image_meta8service.scripts.markdiffusion_harness9service.scripts.rewrite_text10service.scripts.score_stylometry11service.scripts.server12service.scripts.synthid_score_server13service.scripts.synthid_text_server14service.scripts.text_detectors15service.scripts.text_unicode16service.scripts.text_watermark17skills.clean-user-facing-text.scripts.score_stylometry18skills.clean-user-facing-text.scripts.text_unicode19stealer20service.scripts21skills.clean-user-facing-text.scripts2211111111

At a glance — Code Health · 66.5 · Adequate · gated by D1, D2 ·

At a glance — Architecture · 100.0 · Exemplary ·

At a glance — Maturity · 61.5 · Adequate · gated by M2 ·

At a glance — Readiness · 55.9 · Adequate · gated by P2 ·

At a glance — Security · 81.3 · Adequate · gated by D36 ·

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
A02:2025 — Security Misconfiguration7Medium
A03:2025 — Software Supply Chain Failures6High / Critical
A05:2025 — Injection4High / Critical

Roadmap

Top priorities: Log through `logging.getLogger(__name__)` (or structlog) with a JSON formatter at meaningful points in the modules you run; Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them; Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.

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

Do thisHelpsEffortDimension
Log through `logging.getLogger(__name__)` (or structlog) with a JSON formatter at meaningful points in the modules you run.+5.6 ptsMediumObservability
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+3.6 ptsMediumArchitecture documentation
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.+3.4 ptsMediumDeployment & Rollback
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor.+1.2 ptsLowBus Factor
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+1.2 ptsLowBus Factor
Resolve the 9 Low coverage finding(s) in Code Coverage — start with install_skill.py, clean_audio.py, clean_file.py.+0.4 ptsLowCode Coverage
Swallowed exception (caught, then discarded)+1.4 ptsMediumException handling
Resolve the 17 Hotspot finding(s) in Churn × Complexity Hotspots — start with text_unicode.py (2), container_meta.py, clean_file.py.+1.2 ptsHighChurn × Complexity Hotspots

File quality

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

FileScoreBandWorst signal
REDACTED5.6MixedCyclomatic Complexity: steal.cmd_query (cyclomatic 17)
service/scripts/clean_file.py5.6MixedCyclomatic Complexity: clean_file.main (cyclomatic 69)
service/scripts/detect_text_watermark.py5.7MixedCode Duplication: Edited copy of a member (14 corresponding lines)
REDACTED5.8MixedDependency Vulnerabilities: High CVE: REDACTED
install_skill.py5.9MixedCognitive Complexity: install_skill.parse_frontmatter (cognitive 22)
service/scripts/markdiffusion_harness.py5.9MixedCode Duplication: Duplicated block (15 lines × 2)
REDACTED6.7MixedCyclomatic Complexity: download_prompts.main (cyclomatic 24)
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
service/scripts/bench_synthid_text.py7.0Near-cleanCyclomatic Complexity: bench_synthid_text.main (cyclomatic 70)
service/scripts/container_meta.py7.0Near-cleanCyclomatic Complexity: container_meta._scrub_ooxml_zip (cyclomatic 50)
service/scripts/text_unicode.py7.0Near-cleanCyclomatic Complexity: text_unicode._decide (cyclomatic 45)
service/scripts/image_meta.py7.0Near-cleanCyclomatic Complexity: image_meta.strip_tiff (cyclomatic 40)
service/scripts/server.py7.0Near-cleanCyclomatic Complexity: server._clean_payload (cyclomatic 32)
service/scripts/score_stylometry.py7.0Near-cleanCyclomatic Complexity: score_stylometry.score_text_stylometry (cyclomatic 24)
service/scripts/clean_video.py7.0Near-cleanCognitive Complexity: clean_video.video_purify (cognitive 17)
service/scripts/clean_audio.py7.0Near-cleanCode Duplication: Edited copy of a member (31 corresponding lines)
service/scripts/common.py7.0Near-cleanCode Duplication: Duplicated block (90 lines × 2)
service/scripts/av_meta.py7.0Near-cleanCyclomatic Complexity: av_meta._parse_id3v2_frames (cyclomatic 16)
service/scripts/rewrite_text.py7.0Near-cleanCyclomatic Complexity: rewrite_text.rewrite (cyclomatic 55)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 5

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 335

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 49

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 9

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey 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. All 46 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, the weighted average across measured dimensions.

Every figure here is one of two 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. 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.

What we checked — 46 dimensions across the health lenses
D1D2D3D4D5D6D8D11D12D13D14D15D16D17D27D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX6AX8M1M2M3M4P1P2P3P4P6X12X13X19X27X28X3X30

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, 353 of 389 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 or a scanner, 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
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1e5f7-ad9f-7e1a-a965-d8c258eedfcd.

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

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository publishes a package — a Claude Code plugin, declared by .claude-plugin/plugin.json — so it DOES have an intentionally-exposed surface: the commands, skills, agents and hooks the plugin contributes to its host, which consumers reach by name. D22 collects code-API surfaces (type and member signatures) only, and has no collector for a plugin's contribution surface, so the consistency of that surface was not judged. That is OUR side and it is a COLLECTOR gap, not an environment fault — no change to the scan image can close it.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do 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 — an in-process token-stream comparison over sliding windows, with type-aware normalization — so 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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • 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.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • 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").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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.

Dimensions

D1 · Cyclomatic Complexity2.6 / 10Weak✓ 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: Documented → Verified → Prevented · effective 2.6 / 10 · rule-coverage 100% · ceiling Prevented

69 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was bench_synthid_text.main at 70.

text_unicode._decide (cyclomatic 45) · ×2service/scripts/text_unicode.py:454
score_stylometry.score_text_stylometry (cyclomatic 24) · ×2service/scripts/score_stylometry.py:318
inspect_text.main (cyclomatic 16) · ×2service/scripts/inspect_text.py:19
bench_synthid_text.main (cyclomatic 70)service/scripts/bench_synthid_text.py:3397
clean_file.main (cyclomatic 69)service/scripts/clean_file.py:30

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with bench_synthid_text.main (cyclomatic 70), clean_file.main (cyclomatic 69). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 2.6 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ 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: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

109 method(s) exceeded the cognitive complexity threshold of 15; the worst was clean_file.main at 130.

text_unicode._decide (cognitive 58) · ×2service/scripts/text_unicode.py:454
inspect_text.main (cognitive 24) · ×2service/scripts/inspect_text.py:19
score_stylometry.score_text_stylometry (cognitive 21) · ×2service/scripts/score_stylometry.py:318
score_stylometry.print_human_stylometry_report (cognitive 18) · ×2service/scripts/score_stylometry.py:459
text_unicode.clean_text (cognitive 18) · ×2service/scripts/text_unicode.py:643

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

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with clean_file.main (cognitive 130), bench_synthid_text.main (cognitive 108), rewrite_text.rewrite (cognitive 89). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.9 / 10Strong✓ 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: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Prevented

6 over-large unit(s) detected — types, modules or files that carry too much.

FileTooLong: scripts/container_meta.py · ×6service/scripts/container_meta.py

What to do

  1. Resolve the 6 FileTooLong finding(s) in God Classes — start with container_meta.py, bench_synthid_text.py, image_meta.py. — One of this dimension's main actionable groups (6 warning-level).

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

D4 · Code Duplication4.5 / 10Weak✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 4.5 / 10 · rule-coverage 100% · ceiling Verified

78 duplicated block group(s) detected. 13.8 % of the production lines (3,346 of 24,175) are in a reported copy. A further 14 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (7 lines × 2) · ×6service/scripts/av_meta.py:430
Duplicated block (19 lines × 2) · ×3service/scripts/score_stylometry.py:201
Duplicated block (16 lines × 2) · ×3service/scripts/rewrite_text.py:1008
Duplicated block (10 lines × 2) · ×3service/scripts/container_meta.py:448
Duplicated block (9 lines × 2) · ×3service/scripts/markdiffusion_harness.py:314

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

What to do

  1. Resolve the 6 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with av_meta.py, container_meta.py, image_meta.py. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 3 Duplicated block (19 lines × 2) finding(s) in Code Duplication — start with score_stylometry.py (2), text_unicode.py. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with text_unicode.py (2), rewrite_text.py. — One of this dimension's main actionable groups (3 warning-level).

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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

5 production modules (source-import), 0 dependency cycle(s), 0 unstable depended-on module(s). No manifest declares this repository's modules, so the modules are its top-level source directories and the edges the imports between them; 0 module(s) off the main sequence, with abstractness counted on 4 of the 5 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)10.0 / 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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 7 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D8 · Code Coverage9.8 / 10Stronggated by 9 serious findings✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 75.1% — 9 file(s) below 50%. Measured from the Python suite (repository root: `coverage run -m pytest`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it.

Low coverage: install_skill.py · ×9install_skill.py:1

What to do

  1. Resolve the 9 Low coverage finding(s) in Code Coverage — start with install_skill.py, clean_audio.py, clean_file.py. — One of this dimension's main actionable groups (9 warning-level).

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

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). Python (repository root, 75 test files): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.4 9.0 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 96% · ceiling Verified

12 outdated, 0 yanked pinned Python distributions. 24 of 25 shipped distributions were graded against pypi.org (0 not published there, 1 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

Outdated: cython · ×12

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.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: Documented → Verified → Prevented · 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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 108 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 25 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (83 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 14 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.5 / 10Strong✓ 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: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: service/scripts/container_meta.py (54×50=2700); service/scripts/clean_file.py (17×69=1173); service/scripts/rewrite_text.py (20×55=1100) Repeated repair below the complexity floor: service/scripts/clean_staged.py (4 of 4 changes were fixes)

Hotspot: service/scripts/container_meta.py · ×17service/scripts/container_meta.py:2709
Repeated repair: service/scripts/clean_staged.pyservice/scripts/clean_staged.py:135

What to do

  1. Resolve the 17 Hotspot finding(s) in Churn × Complexity Hotspots — start with text_unicode.py (2), container_meta.py, clean_file.py. — One of this dimension's main actionable groups (17 warning-level).
  2. Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with clean_staged.py. — One of this dimension's main actionable groups (1 warning-level).

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

D16 · Bus Factor7.3 / 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: Documented → Verified → Prevented · effective 7.3 / 10 · rule-coverage 100% · ceiling Documented

12 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is service/scripts/bench_synthid_text.py. Counted over 44 of the 46 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

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).
  2. Resolve the 1 Further sole-owners (lower concentration) 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 Debt10.0 / 10Exemplary○ Nothing flagged

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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 24175 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

92 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.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: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · 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)6.9 / 10Adequate✓ 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: Documented → Verified → Prevented · effective 6.9 / 10 · rule-coverage 100% · ceiling Documented

4 finding(s): 0 critical, 2 high, 0 medium, 2 low. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 recommendation-level).

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

D30 · Dependency Vulnerabilities8.1 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 8.1 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

  1. Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

D31 · IaC & Container Security9.4 / 10Stronggated by 6 serious findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

7 finding(s): 0 critical, 0 high, 6 medium, 1 low.

REDACTED
REDACTED

What to do

  1. Resolve the 6 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d31_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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 44 of the 46 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ 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. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · 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 & Signing2.5 / 10Weak✓ 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: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED 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: Documented → Verified → Prevented · 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.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 25 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_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. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

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.

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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

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

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

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.

M1 · Documentation (README)7.3 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

M2 · Architecture documentation2.0 / 10Weak✓ 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 numbered `NNNN-title` documents in any markup this check reads, 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.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

  • Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`install_skill.py`).
M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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.

P2 · Observability0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • No logging call was found in the 6 Python production file(s) this check read across 1 module(s). Each was searched for its ecosystem's logging libraries (Python: logging, structlog, loguru) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.

What to do

  • Log through `logging.getLogger(__name__)` (or structlog) with a JSON formatter at meaningful points in the modules you run.
  • Add a health-check endpoint (a /health route) so orchestrators and load balancers can probe liveness/readiness.
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.

  • Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse. — REDACTED:32

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling7.0 / 10Strong✓ Tool-verified

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.

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — service/scripts/clean_audio.py:186, service/scripts/container_meta.py:505, service/scripts/container_meta.py:528, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

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 Health66.5Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture100.0ExemplaryStrongest area.
Maturity61.5Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness55.9Adequate — gated by P2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security81.3Adequate — gated by D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 6 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • AXH1 Runtime security headers — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXO1 Runtime API surface — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility (rendered) — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 19 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 68 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.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) 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
  • 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
  • AXA1 Runtime unauthenticated reachability — This run crawled public routes only — it had no logged-in session, so there is no authenticated surface to compare anonymous access against and nothing was measured. This is a statement about this run, not about your application: nothing here says access control is missing, and nothing here says it is present.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXI1 Runtime container hardening — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~17995 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (2167 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling 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"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — This repository is one build unit, `(repository root)` (24175 LoC, 79 module-visible types across 4 directories), within the size bounds. Not scored: a single unit of this size gives project cohesion nothing to grade.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • 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 project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (4 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens 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 lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 35 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • 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
  • X5 Nullable reference types — 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
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

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.

Critical — 5 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 335 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×17
  • Hotspot: service/scripts/container_meta.py service/scripts/container_meta.py:2709 — service/scripts/container_meta.py changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in container_meta._scrub_ooxml_zip at line 2709. 34 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/container_meta.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/clean_file.py service/scripts/clean_file.py:30 — service/scripts/clean_file.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in clean_file.main at line 30. 4 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/clean_file.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/rewrite_text.py service/scripts/rewrite_text.py:730 — service/scripts/rewrite_text.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in rewrite_text.rewrite at line 730. 3 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/rewrite_text.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/image_meta.py service/scripts/image_meta.py:633 — service/scripts/image_meta.py changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in image_meta.inspect_isobmff at line 633. 13 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/image_meta.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/server.py service/scripts/server.py:1226 — service/scripts/server.py changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in server._clean_payload at line 1226. 12 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/server.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/bench_synthid_text.py service/scripts/bench_synthid_text.py:3397 — service/scripts/bench_synthid_text.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in bench_synthid_text.main at line 3397. 3 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/bench_synthid_text.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/text_unicode.py service/scripts/text_unicode.py:454 — service/scripts/text_unicode.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in text_unicode._decide at line 454. 3 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/text_unicode.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/inspect_file.py service/scripts/inspect_file.py:27 — service/scripts/inspect_file.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in inspect_file.main at line 27. 2 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/inspect_file.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/clean_image.py service/scripts/clean_image.py:17 — service/scripts/clean_image.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in clean_image.main at line 17. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/clean_image.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/audit_website.py service/scripts/audit_website.py:100 — service/scripts/audit_website.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in audit_website.guess_kind at line 100. 3 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/audit_website.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/audit_lib.py service/scripts/audit_lib.py:38 — service/scripts/audit_lib.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in audit_lib.scan_file at line 38. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/audit_lib.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/av_meta.py service/scripts/av_meta.py:186 — service/scripts/av_meta.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in av_meta._parse_id3v2_frames at line 186. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/av_meta.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/inspect_image.py service/scripts/inspect_image.py:16 — service/scripts/inspect_image.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in inspect_image.main at line 16. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/inspect_image.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: skills/clean-user-facing-text/scripts/text_unicode.py skills/clean-user-facing-text/scripts/text_unicode.py:454 — skills/clean-user-facing-text/scripts/text_unicode.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in text_unicode._decide at line 454. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- skills/clean-user-facing-text/scripts/text_unicode.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/inspect_text.py service/scripts/inspect_text.py:19 — service/scripts/inspect_text.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in inspect_text.main at line 19. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/inspect_text.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/audit_dir.py service/scripts/audit_dir.py:58 — service/scripts/audit_dir.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in audit_dir.main at line 58. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/audit_dir.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: service/scripts/text_detectors.py service/scripts/text_detectors.py:166 — service/scripts/text_detectors.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in MarkLLMTextDetector.detect at line 166. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/text_detectors.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
AXH1 · Runtime security headers · Runtime security header not set · ×11
  • Runtime security header not set: content-security-policy — The live app's responses did not include content-security-policy (restricts the sources a page may load — mitigates XSS/injection). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-embedder-policy — The live app's responses did not include cross-origin-embedder-policy (recommended by the OWASP Secure Headers Project (value: require-corp)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-opener-policy — The live app's responses did not include cross-origin-opener-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-resource-policy — The live app's responses did not include cross-origin-resource-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: permissions-policy — The live app's responses did not include permissions-policy (restricts powerful browser features (camera, geolocation, …)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: referrer-policy — The live app's responses did not include referrer-policy (limits referrer leakage to third parties). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: strict-transport-security — The live app's responses did not include strict-transport-security (forces HTTPS on subsequent requests — mitigates downgrade/MITM). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-content-type-options — The live app's responses did not include x-content-type-options (stops MIME-sniffing (expects 'nosniff')). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-dns-prefetch-control — The live app's responses did not include x-dns-prefetch-control (recommended by the OWASP Secure Headers Project (value: off)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-frame-options — The live app's responses did not include x-frame-options (blocks clickjacking via framing (or use CSP frame-ancestors)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-permitted-cross-domain-policies — The live app's responses did not include x-permitted-cross-domain-policies (recommended by the OWASP Secure Headers Project (value: none)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
D8 · Code Coverage · Low coverage · ×9
  • Low coverage: install_skill.py install_skill.py:1 — 36.8% line coverage (95/258).
  • Low coverage: service/scripts/clean_audio.py service/scripts/clean_audio.py:1 — 49.6% line coverage (59/119).
  • Low coverage: service/scripts/clean_file.py service/scripts/clean_file.py:1 — 43.2% line coverage (64/148).
  • Low coverage: service/scripts/clean_video.py service/scripts/clean_video.py:1 — 37.6% line coverage (76/202).
  • Low coverage: service/scripts/detect_text_watermark.py service/scripts/detect_text_watermark.py:1 — 29.7% line coverage (98/330).
  • Low coverage: service/scripts/hook_written_file.py service/scripts/hook_written_file.py:1 — 43.1% line coverage (62/144).
  • Low coverage: service/scripts/markdiffusion_harness.py service/scripts/markdiffusion_harness.py:1 — 47.0% line coverage (131/279).
  • Low coverage: stealer/__init__.py stealer/__init__.py:1 — 0.0% line coverage (0/3).
  • Low coverage: REDACTED REDACTED:1 — 22.8% line coverage (33/145).
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×9
  • Swallowed exception (caught, then discarded) service/scripts/clean_audio.py:186 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/container_meta.py:505 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/container_meta.py:528 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/container_meta.py:3849 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/container_meta.py:3855 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/container_meta.py:3949 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/container_meta.py:4238 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/server.py:150 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) service/scripts/server.py:194 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D3 · God Classes · FileTooLong · ×6
  • FileTooLong: scripts/container_meta.py service/scripts/container_meta.py — FileTooLong — 3031 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2531 over it, 6.06× the bar. 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: scripts/bench_synthid_text.py service/scripts/bench_synthid_text.py — FileTooLong — 2967 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2467 over it, 5.93× the bar. 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: scripts/image_meta.py service/scripts/image_meta.py — FileTooLong — 1760 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1260 over it, 3.52× the bar. 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: scripts/server.py service/scripts/server.py — FileTooLong — 1227 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 727 over it, 2.45× the bar. 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: scripts/rewrite_text.py service/scripts/rewrite_text.py — FileTooLong — 985 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 485 over it, 1.97× the bar. 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: scripts/audit_website.py service/scripts/audit_website.py — FileTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 12 over it, 1.02× the bar. 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.
D31 · IaC & Container Security · Medium IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) service/scripts/av_meta.py:430 — service/scripts/av_meta.py:430-436 | service/scripts/av_meta.py:462-468 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `service/scripts/av_meta.py:469` calls `extend` and `service/scripts/av_meta.py:437` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) service/scripts/container_meta.py:2961 — service/scripts/container_meta.py:2961-2967 | service/scripts/container_meta.py:3244-3250 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `service/scripts/container_meta.py:3243` calls `_epub_encrypted_parts` and `service/scripts/container_meta.py:2960` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) service/scripts/image_meta.py:382 — service/scripts/image_meta.py:382-388 | service/scripts/image_meta.py:1945-1951 — 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.
  • Duplicated block (7 lines × 2) service/scripts/server.py:1669 — service/scripts/server.py:1669-1675 | service/scripts/synthid_score_server.py:152-158 — before extracting anything, compare `service/scripts/server.py` and `service/scripts/synthid_score_server.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) service/scripts/synthid_score_server.py:87 — service/scripts/synthid_score_server.py:87-93 | service/scripts/synthid_text_server.py:169-175 — before extracting anything, compare `service/scripts/synthid_score_server.py` and `service/scripts/synthid_text_server.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (7 lines × 2) service/scripts/text_unicode.py:433 — service/scripts/text_unicode.py:433-439 | skills/clean-user-facing-text/scripts/text_unicode.py:433-439 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
AXO1 · Runtime API surface · API operation answered with no credentials · ×3
  • API operation answered with no credentials: GET /health — http://127.0.0.1:8765/health returned HTTP 200 to two GET requests carrying nothing. Observed on the live app. We do not decide whether this operation is meant to be public. Advisory evidence for CRA Annex I (2)(d) and NIS2 IR.4.1.
  • API operation answered with no credentials: GET /capabilities — http://127.0.0.1:8765/capabilities returned HTTP 200 to two GET requests carrying nothing. Observed on the live app. We do not decide whether this operation is meant to be public. Advisory evidence for CRA Annex I (2)(d) and NIS2 IR.4.1.
  • API operation answered with no credentials: GET /openapi.json — http://127.0.0.1:8765/openapi.json returned HTTP 200 to two GET requests carrying nothing. Observed on the live app. We do not decide whether this operation is meant to be public. Advisory evidence for CRA Annex I (2)(d) and NIS2 IR.4.1.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) service/scripts/score_stylometry.py:201 — service/scripts/score_stylometry.py:201-219 | skills/clean-user-facing-text/scripts/score_stylometry.py:201-219 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (19 lines × 2) service/scripts/score_stylometry.py:280 — service/scripts/score_stylometry.py:280-298 | skills/clean-user-facing-text/scripts/score_stylometry.py:280-298 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (19 lines × 2) service/scripts/text_unicode.py:315 — service/scripts/text_unicode.py:315-333 | skills/clean-user-facing-text/scripts/text_unicode.py:315-333 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) service/scripts/rewrite_text.py:1008 — service/scripts/rewrite_text.py:1008-1023 | service/scripts/rewrite_text.py:1039-1054 — 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.
  • Duplicated block (16 lines × 2) service/scripts/text_unicode.py:285 — service/scripts/text_unicode.py:285-300 | skills/clean-user-facing-text/scripts/text_unicode.py:285-300 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (16 lines × 2) service/scripts/text_unicode.py:386 — service/scripts/text_unicode.py:386-401 | skills/clean-user-facing-text/scripts/text_unicode.py:386-401 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (10 lines × 2) · ×3
  • Duplicated block (10 lines × 2) service/scripts/container_meta.py:448 — service/scripts/container_meta.py:448-457 | service/scripts/container_meta.py:496-505 — 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.
  • Duplicated block (10 lines × 2) service/scripts/server.py:1428 — service/scripts/server.py:1428-1437 | service/scripts/synthid_score_server.py:65-74 — before extracting anything, compare `service/scripts/server.py` and `service/scripts/synthid_score_server.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (10 lines × 2) service/scripts/common.py:145 — service/scripts/common.py:145-154 | skills/clean-user-facing-text/scripts/common.py:145-154 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (9 lines × 2) · ×3
  • Duplicated block (9 lines × 2) service/scripts/markdiffusion_harness.py:314 — service/scripts/markdiffusion_harness.py:314-322 | service/scripts/markdiffusion_harness.py:376-384 — 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 `service/scripts/markdiffusion_harness.py:314` 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 (9 lines × 2) service/scripts/server.py:1145 — service/scripts/server.py:1145-1153 | service/scripts/server.py:1180-1188 — 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.
  • Duplicated block (9 lines × 2) service/scripts/synthid_score_server.py:67 — service/scripts/synthid_score_server.py:67-75 | service/scripts/synthid_text_server.py:149-157 — before extracting anything, compare `service/scripts/synthid_score_server.py` and `service/scripts/synthid_text_server.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (6 lines × 2) · ×3
  • Duplicated block (6 lines × 2) service/scripts/clean_image.py:178 — service/scripts/clean_image.py:178-183 | service/scripts/clean_image.py:185-190 — 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.
  • Duplicated block (6 lines × 2) service/scripts/bench_synthid_text.py:195 — service/scripts/bench_synthid_text.py:195-200 | service/scripts/text_detectors.py:106-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) service/scripts/common.py:247 — service/scripts/common.py:247-252 | skills/clean-user-facing-text/scripts/common.py:247-252 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
D1 · Cyclomatic Complexity · text_unicode._decide (cyclomatic 45) · ×2
  • text_unicode._decide (cyclomatic 45) service/scripts/text_unicode.py:454 — text_unicode._decide 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.
  • text_unicode._decide (cyclomatic 45) skills/clean-user-facing-text/scripts/text_unicode.py:454 — text_unicode._decide 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 · score_stylometry.score_text_stylometry (cyclomatic 24) · ×2
  • score_stylometry.score_text_stylometry (cyclomatic 24) service/scripts/score_stylometry.py:318 — score_stylometry.score_text_stylometry has cyclomatic complexity 24 (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.
  • score_stylometry.score_text_stylometry (cyclomatic 24) skills/clean-user-facing-text/scripts/score_stylometry.py:318 — score_stylometry.score_text_stylometry has cyclomatic complexity 24 (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 · inspect_text.main (cyclomatic 16) · ×2
  • inspect_text.main (cyclomatic 16) service/scripts/inspect_text.py:19 — inspect_text.main 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.
  • inspect_text.main (cyclomatic 16) skills/clean-user-facing-text/scripts/inspect_text.py:19 — inspect_text.main 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.
D2 · Cognitive Complexity · text_unicode._decide (cognitive 58) · ×2
  • text_unicode._decide (cognitive 58) service/scripts/text_unicode.py:454 — text_unicode._decide has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 22 (nesting depth added 14). 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.
  • text_unicode._decide (cognitive 58) skills/clean-user-facing-text/scripts/text_unicode.py:454 — text_unicode._decide has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 22 (nesting depth added 14). 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 · inspect_text.main (cognitive 24) · ×2
  • inspect_text.main (cognitive 24) service/scripts/inspect_text.py:19 — inspect_text.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (5 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). 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.
  • inspect_text.main (cognitive 24) skills/clean-user-facing-text/scripts/inspect_text.py:19 — inspect_text.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (5 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). 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 · score_stylometry.score_text_stylometry (cognitive 21) · ×2
  • score_stylometry.score_text_stylometry (cognitive 21) service/scripts/score_stylometry.py:318 — score_stylometry.score_text_stylometry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 2 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 2). 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.
  • score_stylometry.score_text_stylometry (cognitive 21) skills/clean-user-facing-text/scripts/score_stylometry.py:318 — score_stylometry.score_text_stylometry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 2 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 2). 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 · score_stylometry.print_human_stylometry_report (cognitive 18) · ×2
  • score_stylometry.print_human_stylometry_report (cognitive 18) service/scripts/score_stylometry.py:459 — score_stylometry.print_human_stylometry_report has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 5). 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.
  • score_stylometry.print_human_stylometry_report (cognitive 18) skills/clean-user-facing-text/scripts/score_stylometry.py:459 — score_stylometry.print_human_stylometry_report has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 5). 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 · text_unicode.clean_text (cognitive 18) · ×2
  • text_unicode.clean_text (cognitive 18) service/scripts/text_unicode.py:643 — text_unicode.clean_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). 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.
  • text_unicode.clean_text (cognitive 18) skills/clean-user-facing-text/scripts/text_unicode.py:643 — text_unicode.clean_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) service/scripts/clean_text.py:24 — service/scripts/clean_text.py:24-94 | service/scripts/inspect_text.py:20-133 | skills/clean-user-facing-text/scripts/clean_text.py:24-94 | skills/clean-user-facing-text/scripts/inspect_text.py:20-133 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) service/scripts/text_unicode.py:584 — service/scripts/text_unicode.py:584-640 | service/scripts/text_unicode.py:652-714 | skills/clean-user-facing-text/scripts/text_unicode.py:584-640 | skills/clean-user-facing-text/scripts/text_unicode.py:652-714 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) service/scripts/clean_file.py:182 — service/scripts/clean_file.py:182-213 | service/scripts/clean_file.py:218-249 — 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 `service/scripts/clean_file.py:182` 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.
  • Duplicated block (32 lines × 2) service/scripts/score_stylometry.py:503 — service/scripts/score_stylometry.py:503-534 | skills/clean-user-facing-text/scripts/score_stylometry.py:503-534 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) service/scripts/common.py:520 — service/scripts/common.py:520-544 | skills/clean-user-facing-text/scripts/common.py:520-544 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (25 lines × 2) service/scripts/score_stylometry.py:252 — service/scripts/score_stylometry.py:252-276 | skills/clean-user-facing-text/scripts/score_stylometry.py:252-276 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) service/scripts/clean_file.py:81 — service/scripts/clean_file.py:81-94 | service/scripts/inspect_file.py:39-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/clean_file.py:81` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `service/scripts/inspect_file.py:54` calls `str`, `resolve` and `service/scripts/clean_file.py:100` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14–15 lines × 2) service/scripts/detect_text_watermark.py:269 — service/scripts/detect_text_watermark.py:269-283 | service/scripts/detect_text_watermark.py:443-456 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `service/scripts/detect_text_watermark.py:284` calls `_detect_payload` and `service/scripts/detect_text_watermark.py:457` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) service/scripts/detect_text_watermark.py:577 — service/scripts/detect_text_watermark.py:577-591 | service/scripts/markdiffusion_harness.py:425-439 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/detect_text_watermark.py:577` 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.
  • Duplicated block (15 lines × 2) service/scripts/markdiffusion_harness.py:241 — service/scripts/markdiffusion_harness.py:241-255 | service/scripts/markdiffusion_harness.py:317-331 — 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 (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) service/scripts/text_unicode.py:405 — service/scripts/text_unicode.py:405-418 | skills/clean-user-facing-text/scripts/text_unicode.py:405-418 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (14 lines × 2) service/scripts/clean_ctrlregen.py:44 — service/scripts/clean_ctrlregen.py:44-57 | service/scripts/markdiffusion_harness.py:84-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) service/scripts/bench_synthid_text.py:209 — service/scripts/bench_synthid_text.py:209-221 | service/scripts/bench_synthid_text.py:231-243 — 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.
  • Duplicated block (13 lines × 2) service/scripts/text_unicode.py:718 — service/scripts/text_unicode.py:718-730 | skills/clean-user-facing-text/scripts/text_unicode.py:718-730 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) service/scripts/clean_file.py:185 — service/scripts/clean_file.py:185-195 | service/scripts/clean_file.py:221-231 | service/scripts/clean_file.py:258-268 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/clean_file.py:185` 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.
  • Duplicated block (11 lines × 3) service/scripts/inspect_file.py:90 — service/scripts/inspect_file.py:90-100 | service/scripts/inspect_file.py:105-115 | service/scripts/inspect_file.py:119-129 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×2
  • Duplicated block (11 lines × 2) service/scripts/text_unicode.py:355 — service/scripts/text_unicode.py:355-365 | skills/clean-user-facing-text/scripts/text_unicode.py:355-365 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
  • Duplicated block (11 lines × 2) service/scripts/common.py:39 — service/scripts/common.py:39-49 | skills/clean-user-facing-text/scripts/common.py:39-49 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) service/scripts/container_meta.py:464 — service/scripts/container_meta.py:464-471 | service/scripts/container_meta.py:2219-2226 | service/scripts/image_meta.py:1872-1879 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `service/scripts/image_meta.py:1881` calls `inspect_bmp` and `service/scripts/container_meta.py:2228` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) service/scripts/markdiffusion_harness.py:240 — service/scripts/markdiffusion_harness.py:240-247 | service/scripts/markdiffusion_harness.py:316-323 | service/scripts/markdiffusion_harness.py:378-385 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/markdiffusion_harness.py:240` 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 (8 lines × 2) · ×2
  • Duplicated block (8 lines × 2) service/scripts/container_meta.py:2758 — service/scripts/container_meta.py:2758-2765 | service/scripts/container_meta.py:3279-3286 — 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.
  • Duplicated block (8 lines × 2) service/scripts/image_meta.py:652 — service/scripts/image_meta.py:652-659 | service/scripts/image_meta.py:685-692 — 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 (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) service/scripts/bench_synthid_text.py:2560 — service/scripts/bench_synthid_text.py:2560-2564 | service/scripts/bench_synthid_text.py:2696-2700 | service/scripts/bench_synthid_text.py:2797-2801 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) service/scripts/server.py:1532 — service/scripts/server.py:1532-1536 | service/scripts/server.py:1550-1554 | service/scripts/server.py:1569-1573 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one 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 (12 lines × 2) · ×2
  • Duplicated block (12 lines × 2) service/scripts/common.py:385 — service/scripts/common.py:385-396 | skills/clean-user-facing-text/scripts/common.py:385-396 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) service/scripts/text_unicode.py:270 — service/scripts/text_unicode.py:270-281 | skills/clean-user-facing-text/scripts/text_unicode.py:270-281 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
AXR1 · Runtime accessibility (rendered) · WCAG 2.4.2 reproducibly failed in a rendered surface · ×1
  • WCAG 2.4.2 reproducibly failed in a rendered surface — axe-core rule(s) document-title failed on: html. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
AXR1 · Runtime accessibility (rendered) · WCAG 3.1.1 reproducibly failed in a rendered surface · ×1
  • WCAG 3.1.1 reproducibly failed in a rendered surface — axe-core rule(s) html-has-lang failed on: html. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
D1 · Cyclomatic Complexity · bench_synthid_text.main (cyclomatic 70) · ×1
  • bench_synthid_text.main (cyclomatic 70) service/scripts/bench_synthid_text.py:3397 — bench_synthid_text.main has cyclomatic complexity 70 (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 · clean_file.main (cyclomatic 69) · ×1
  • clean_file.main (cyclomatic 69) service/scripts/clean_file.py:30 — clean_file.main has cyclomatic complexity 69 (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 · rewrite_text.rewrite (cyclomatic 55) · ×1
  • rewrite_text.rewrite (cyclomatic 55) service/scripts/rewrite_text.py:730 — rewrite_text.rewrite has cyclomatic complexity 55 (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 · container_meta._scrub_ooxml_zip (cyclomatic 50) · ×1
  • container_meta._scrub_ooxml_zip (cyclomatic 50) service/scripts/container_meta.py:2709 — container_meta._scrub_ooxml_zip has cyclomatic complexity 50 (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 · bench_synthid_text.aggregate (cyclomatic 45) · ×1
  • bench_synthid_text.aggregate (cyclomatic 45) service/scripts/bench_synthid_text.py:2403 — bench_synthid_text.aggregate 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 · text_watermark.parse_watermark_options (cyclomatic 42) · ×1
  • text_watermark.parse_watermark_options (cyclomatic 42) service/scripts/text_watermark.py:45 — text_watermark.parse_watermark_options has cyclomatic complexity 42 (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 · image_meta.strip_tiff (cyclomatic 40) · ×1
  • image_meta.strip_tiff (cyclomatic 40) service/scripts/image_meta.py:1323 — image_meta.strip_tiff has cyclomatic complexity 40 (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 · audit_website.guess_kind (cyclomatic 37) · ×1
  • audit_website.guess_kind (cyclomatic 37) service/scripts/audit_website.py:100 — audit_website.guess_kind has cyclomatic complexity 37 (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 · container_meta.clean_epub (cyclomatic 37) · ×1
  • container_meta.clean_epub (cyclomatic 37) service/scripts/container_meta.py:3224 — container_meta.clean_epub has cyclomatic complexity 37 (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 · container_meta._inspect_ooxml_zip (cyclomatic 36) · ×1
  • container_meta._inspect_ooxml_zip (cyclomatic 36) service/scripts/container_meta.py:2195 — container_meta._inspect_ooxml_zip 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 · container_meta.detect_container_format (cyclomatic 33) · ×1
  • container_meta.detect_container_format (cyclomatic 33) service/scripts/container_meta.py:286 — container_meta.detect_container_format has cyclomatic complexity 33 (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 · Benchmark._adaptive_apply_strategy (cyclomatic 32) · ×1
  • Benchmark._adaptive_apply_strategy (cyclomatic 32) service/scripts/bench_synthid_text.py:1766 — Benchmark._adaptive_apply_strategy 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 · image_meta.inspect_isobmff (cyclomatic 32) · ×1
  • image_meta.inspect_isobmff (cyclomatic 32) service/scripts/image_meta.py:633 — image_meta.inspect_isobmff 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 · server._clean_payload (cyclomatic 32) · ×1
  • server._clean_payload (cyclomatic 32) service/scripts/server.py:1226 — server._clean_payload 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 · container_meta.inspect_container (cyclomatic 31) · ×1
  • container_meta.inspect_container (cyclomatic 31) service/scripts/container_meta.py:4514 — container_meta.inspect_container has cyclomatic complexity 31 (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 · Benchmark.minimal_search (cyclomatic 29) · ×1
  • Benchmark.minimal_search (cyclomatic 29) service/scripts/bench_synthid_text.py:1466 — Benchmark.minimal_search has cyclomatic complexity 29 (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 · container_meta._latex_pdfinfo_items (cyclomatic 27) · ×1
  • container_meta._latex_pdfinfo_items (cyclomatic 27) service/scripts/container_meta.py:1144 — container_meta._latex_pdfinfo_items has cyclomatic complexity 27 (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 · bench_synthid_text.render_markdown_strategy (cyclomatic 26) · ×1
  • bench_synthid_text.render_markdown_strategy (cyclomatic 26) service/scripts/bench_synthid_text.py:2794 — bench_synthid_text.render_markdown_strategy 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 · container_meta._script_tag_is_jsonld (cyclomatic 26) · ×1
  • container_meta._script_tag_is_jsonld (cyclomatic 26) service/scripts/container_meta.py:1603 — container_meta._script_tag_is_jsonld has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · image_meta.strip_jpeg (cyclomatic 26) · ×1
  • image_meta.strip_jpeg (cyclomatic 26) service/scripts/image_meta.py:2004 — image_meta.strip_jpeg 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 · image_meta.strip_isobmff (cyclomatic 26) · ×1
  • image_meta.strip_isobmff (cyclomatic 26) service/scripts/image_meta.py:2129 — image_meta.strip_isobmff 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 · Benchmark.strategy_search (cyclomatic 25) · ×1
  • Benchmark.strategy_search (cyclomatic 25) service/scripts/bench_synthid_text.py:1855 — Benchmark.strategy_search 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 · bench_synthid_text.aggregate_minimal (cyclomatic 25) · ×1
  • bench_synthid_text.aggregate_minimal (cyclomatic 25) service/scripts/bench_synthid_text.py:2500 — bench_synthid_text.aggregate_minimal has cyclomatic complexity 25 (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 · clean_image.main (cyclomatic 25) · ×1
  • clean_image.main (cyclomatic 25) service/scripts/clean_image.py:17 — clean_image.main 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 · inspect_file.main (cyclomatic 25) · ×1
  • inspect_file.main (cyclomatic 25) service/scripts/inspect_file.py:27 — inspect_file.main 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 · Benchmark._eval_strategy (cyclomatic 24) · ×1
  • Benchmark._eval_strategy (cyclomatic 24) service/scripts/bench_synthid_text.py:1668 — Benchmark._eval_strategy has cyclomatic complexity 24 (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 · container_meta.clean_pdf (cyclomatic 24) · ×1
  • container_meta.clean_pdf (cyclomatic 24) service/scripts/container_meta.py:4294 — container_meta.clean_pdf has cyclomatic complexity 24 (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 · image_meta.inspect_jpeg (cyclomatic 24) · ×1
  • image_meta.inspect_jpeg (cyclomatic 24) service/scripts/image_meta.py:428 — image_meta.inspect_jpeg has cyclomatic complexity 24 (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 · download_prompts.main (cyclomatic 24) · ×1
  • download_prompts.main (cyclomatic 24) REDACTED:131 — download_prompts.main has cyclomatic complexity 24 (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 · container_meta._pdf_clean_attachments (cyclomatic 23) · ×1
  • container_meta._pdf_clean_attachments (cyclomatic 23) service/scripts/container_meta.py:4069 — container_meta._pdf_clean_attachments 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 · container_meta.clean_container (cyclomatic 23) · ×1
  • container_meta.clean_container (cyclomatic 23) service/scripts/container_meta.py:4664 — container_meta.clean_container 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 · image_meta._parse_tiff_ifds (cyclomatic 23) · ×1
  • image_meta._parse_tiff_ifds (cyclomatic 23) service/scripts/image_meta.py:1173 — image_meta._parse_tiff_ifds 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 · Benchmark.run_variants (cyclomatic 21) · ×1
  • Benchmark.run_variants (cyclomatic 21) service/scripts/bench_synthid_text.py:1193 — Benchmark.run_variants 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 · container_meta.inspect_epub (cyclomatic 21) · ×1
  • container_meta.inspect_epub (cyclomatic 21) service/scripts/container_meta.py:3092 — container_meta.inspect_epub 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 · audit_lib.scan_file (cyclomatic 20) · ×1
  • audit_lib.scan_file (cyclomatic 20) service/scripts/audit_lib.py:38 — audit_lib.scan_file 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 · bench_deepseek_smoke.run (cyclomatic 20) · ×1
  • bench_deepseek_smoke.run (cyclomatic 20) service/scripts/bench_deepseek_smoke.py:73 — bench_deepseek_smoke.run 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 · container_meta.clean_odt (cyclomatic 20) · ×1
  • container_meta.clean_odt (cyclomatic 20) service/scripts/container_meta.py:2954 — container_meta.clean_odt 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 · image_meta.inspect_gif (cyclomatic 20) · ×1
  • image_meta.inspect_gif (cyclomatic 20) service/scripts/image_meta.py:900 — image_meta.inspect_gif 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 · inspect_image.main (cyclomatic 20) · ×1
  • inspect_image.main (cyclomatic 20) service/scripts/inspect_image.py:16 — inspect_image.main 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 · MarkLLMTextDetector.detect (cyclomatic 20) · ×1
  • MarkLLMTextDetector.detect (cyclomatic 20) service/scripts/text_detectors.py:166 — MarkLLMTextDetector.detect has cyclomatic complexity 20 (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 · container_meta.clean_markdown (cyclomatic 19) · ×1
  • container_meta.clean_markdown (cyclomatic 19) service/scripts/container_meta.py:815 — container_meta.clean_markdown 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 · container_meta._strip_root_svg_attrs (cyclomatic 19) · ×1
  • container_meta._strip_root_svg_attrs (cyclomatic 19) service/scripts/container_meta.py:1923 — container_meta._strip_root_svg_attrs 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 · image_meta.strip_gif (cyclomatic 19) · ×1
  • image_meta.strip_gif (cyclomatic 19) service/scripts/image_meta.py:959 — image_meta.strip_gif 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 · image_meta.inspect_image (cyclomatic 19) · ×1
  • image_meta.inspect_image (cyclomatic 19) service/scripts/image_meta.py:1861 — image_meta.inspect_image has cyclomatic complexity 19 (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 · audit_dir.main (cyclomatic 18) · ×1
  • audit_dir.main (cyclomatic 18) service/scripts/audit_dir.py:58 — audit_dir.main has cyclomatic complexity 18 (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 · image_meta.inspect_png (cyclomatic 18) · ×1
  • image_meta.inspect_png (cyclomatic 18) service/scripts/image_meta.py:376 — image_meta.inspect_png has cyclomatic complexity 18 (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 · image_meta.clean_image (cyclomatic 18) · ×1
  • image_meta.clean_image (cyclomatic 18) service/scripts/image_meta.py:2219 — image_meta.clean_image has cyclomatic complexity 18 (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 · server._apply_layer_b (cyclomatic 18) · ×1
  • server._apply_layer_b (cyclomatic 18) service/scripts/server.py:963 — server._apply_layer_b has cyclomatic complexity 18 (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 · text_watermark.normalize_keys (cyclomatic 18) · ×1
  • text_watermark.normalize_keys (cyclomatic 18) service/scripts/text_watermark.py:183 — text_watermark.normalize_keys has cyclomatic complexity 18 (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 · HumanLikeness._pangram_batch (cyclomatic 17) · ×1
  • HumanLikeness._pangram_batch (cyclomatic 17) service/scripts/bench_synthid_text.py:755 — HumanLikeness._pangram_batch 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 · bench_synthid_text.render_markdown (cyclomatic 17) · ×1
  • bench_synthid_text.render_markdown (cyclomatic 17) service/scripts/bench_synthid_text.py:2553 — bench_synthid_text.render_markdown 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 · container_meta._latex_verbatim_ranges (cyclomatic 17) · ×1
  • container_meta._latex_verbatim_ranges (cyclomatic 17) service/scripts/container_meta.py:964 — container_meta._latex_verbatim_ranges 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 · container_meta.inspect_latex (cyclomatic 17) · ×1
  • container_meta.inspect_latex (cyclomatic 17) service/scripts/container_meta.py:1318 — container_meta.inspect_latex 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 · rewrite_text.main (cyclomatic 17) · ×1
  • rewrite_text.main (cyclomatic 17) service/scripts/rewrite_text.py:1361 — rewrite_text.main 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 · steal.cmd_query (cyclomatic 17) · ×1
  • steal.cmd_query (cyclomatic 17) REDACTED:95 — steal.cmd_query 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 · audit_website.main (cyclomatic 16) · ×1
  • audit_website.main (cyclomatic 16) service/scripts/audit_website.py:560 — audit_website.main 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 · av_meta._parse_id3v2_frames (cyclomatic 16) · ×1
  • av_meta._parse_id3v2_frames (cyclomatic 16) service/scripts/av_meta.py:186 — av_meta._parse_id3v2_frames 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 · av_meta._strip_id3v2 (cyclomatic 16) · ×1
  • av_meta._strip_id3v2 (cyclomatic 16) service/scripts/av_meta.py:297 — av_meta._strip_id3v2 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 · container_meta._iter_data_uris (cyclomatic 16) · ×1
  • container_meta._iter_data_uris (cyclomatic 16) service/scripts/container_meta.py:380 — container_meta._iter_data_uris has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · container_meta._inspect_embedded_data_uris (cyclomatic 16) · ×1
  • container_meta._inspect_embedded_data_uris (cyclomatic 16) service/scripts/container_meta.py:438 — container_meta._inspect_embedded_data_uris 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 · container_meta._pdf_attachment_list (cyclomatic 16) · ×1
  • container_meta._pdf_attachment_list (cyclomatic 16) service/scripts/container_meta.py:3825 — container_meta._pdf_attachment_list 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 · Handler._handle_watermark_batch (cyclomatic 16) · ×1
  • Handler._handle_watermark_batch (cyclomatic 16) service/scripts/server.py:1601 — Handler._handle_watermark_batch 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 · text_watermark._watermark_local_markllm (cyclomatic 16) · ×1
  • text_watermark._watermark_local_markllm (cyclomatic 16) service/scripts/text_watermark.py:337 — text_watermark._watermark_local_markllm 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×1
  • Repeated repair: service/scripts/clean_staged.py service/scripts/clean_staged.py:135 — service/scripts/clean_staged.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is clean_staged.main at line 135), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: harden in-place backups, clean-file status, synthid verdict, truncated ID3v2, and zip routing (#201)”; “fix: clean pre-commit hook treats byte-identical clean non-text files as changed (#173) (#238)”; “fix: stop child processes from opening a console window on Windows”; “fix: distinguish a failed cleaner from an already-clean file (#159) (#161)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 18:16:06 +05:30' --until='2026-11-01 18:16:06 +05:30' --full-history --no-merges -- service/scripts/clean_staged.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D2 · Cognitive Complexity · clean_file.main (cognitive 130) · ×1
  • clean_file.main (cognitive 130) service/scripts/clean_file.py:30 — clean_file.main has cognitive complexity 130 (threshold 15). Drivers by points: if/else 38 (71 pts), boolean chains 20, loops 5 (20 pts), ternaries 9 (14 pts), error handling 3 (5 pts) (nesting depth added 55). 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 · bench_synthid_text.main (cognitive 108) · ×1
  • bench_synthid_text.main (cognitive 108) service/scripts/bench_synthid_text.py:3397 — bench_synthid_text.main has cognitive complexity 108 (threshold 15). Drivers by points: if/else 34 (58 pts), ternaries 20 (30 pts), boolean chains 14, loops 3 (6 pts) (nesting depth added 37). 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 · rewrite_text.rewrite (cognitive 89) · ×1
  • rewrite_text.rewrite (cognitive 89) service/scripts/rewrite_text.py:730 — rewrite_text.rewrite has cognitive complexity 89 (threshold 15). Drivers by points: if/else 39 (60 pts), boolean chains 13, ternaries 5 (12 pts), loops 3 (4 pts) (nesting depth added 29). 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 · container_meta._scrub_ooxml_zip (cognitive 88) · ×1
  • container_meta._scrub_ooxml_zip (cognitive 88) service/scripts/container_meta.py:2709 — container_meta._scrub_ooxml_zip has cognitive complexity 88 (threshold 15). Drivers by points: if/else 23 (64 pts), boolean chains 11, loops 5 (10 pts), error handling 1 (3 pts) (nesting depth added 48). 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 · bench_synthid_text.aggregate (cognitive 81) · ×1
  • bench_synthid_text.aggregate (cognitive 81) service/scripts/bench_synthid_text.py:2403 — bench_synthid_text.aggregate has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 20 (40 pts), if/else 18 (35 pts), boolean chains 4, loops 2 (nesting depth added 37). 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 · image_meta.inspect_isobmff (cognitive 78) · ×1
  • image_meta.inspect_isobmff (cognitive 78) service/scripts/image_meta.py:633 — image_meta.inspect_isobmff has cognitive complexity 78 (threshold 15). Drivers by points: if/else 20 (68 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · image_meta.strip_tiff (cognitive 74) · ×1
  • image_meta.strip_tiff (cognitive 74) service/scripts/image_meta.py:1323 — image_meta.strip_tiff has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 10 (17 pts), boolean chains 7, ternaries 5 (7 pts) (nesting depth added 37). 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 · Benchmark.strategy_search (cognitive 66) · ×1
  • Benchmark.strategy_search (cognitive 66) service/scripts/bench_synthid_text.py:1855 — Benchmark.strategy_search has cognitive complexity 66 (threshold 15). Drivers by points: if/else 9 (35 pts), loops 12 (28 pts), boolean chains 3 (nesting depth added 42). 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 · image_meta.strip_isobmff (cognitive 60) · ×1
  • image_meta.strip_isobmff (cognitive 60) service/scripts/image_meta.py:2129 — image_meta.strip_isobmff has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (47 pts), boolean chains 6, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 35). 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 · text_watermark.parse_watermark_options (cognitive 60) · ×1
  • text_watermark.parse_watermark_options (cognitive 60) service/scripts/text_watermark.py:45 — text_watermark.parse_watermark_options has cognitive complexity 60 (threshold 15). Drivers by points: if/else 28 (43 pts), boolean chains 9, error handling 4 (8 pts) (nesting depth added 19). 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 · Benchmark.minimal_search (cognitive 58) · ×1
  • Benchmark.minimal_search (cognitive 58) service/scripts/bench_synthid_text.py:1466 — Benchmark.minimal_search has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 9, loops 4 (7 pts), error handling 1 (4 pts), ternaries 1 (4 pts) (nesting depth added 29). 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 · container_meta.detect_container_format (cognitive 58) · ×1
  • container_meta.detect_container_format (cognitive 58) service/scripts/container_meta.py:286 — container_meta.detect_container_format has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 8, error handling 2 (7 pts) (nesting depth added 26). 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 · container_meta.clean_epub (cognitive 56) · ×1
  • container_meta.clean_epub (cognitive 56) service/scripts/container_meta.py:3224 — container_meta.clean_epub has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 8, loops 3 (4 pts), error handling 1 (3 pts) (nesting depth added 27). 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 · container_meta._inspect_ooxml_zip (cognitive 55) · ×1
  • container_meta._inspect_ooxml_zip (cognitive 55) service/scripts/container_meta.py:2195 — container_meta._inspect_ooxml_zip has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (43 pts), boolean chains 7, loops 2 (4 pts), error handling 1 (nesting depth added 27). 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 · server._clean_payload (cognitive 53) · ×1
  • server._clean_payload (cognitive 53) service/scripts/server.py:1226 — server._clean_payload has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 8, ternaries 2 (6 pts) (nesting depth added 22). 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 · container_meta._latex_pdfinfo_items (cognitive 51) · ×1
  • container_meta._latex_pdfinfo_items (cognitive 51) service/scripts/container_meta.py:1144 — container_meta._latex_pdfinfo_items has cognitive complexity 51 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 7 (16 pts), boolean chains 9, ternaries 1 (3 pts) (nesting depth added 26). 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 · Benchmark._adaptive_apply_strategy (cognitive 50) · ×1
  • Benchmark._adaptive_apply_strategy (cognitive 50) service/scripts/bench_synthid_text.py:1766 — Benchmark._adaptive_apply_strategy has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 10, ternaries 6 (8 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 19). 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 · clean_image.main (cognitive 48) · ×1
  • clean_image.main (cognitive 48) service/scripts/clean_image.py:17 — clean_image.main has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 5 (15 pts), boolean chains 7, loops 2 (5 pts), error handling 1 (nesting depth added 20). 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 · image_meta.inspect_jpeg (cognitive 44) · ×1
  • image_meta.inspect_jpeg (cognitive 44) service/scripts/image_meta.py:428 — image_meta.inspect_jpeg has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 21). 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 · inspect_file.main (cognitive 44) · ×1
  • inspect_file.main (cognitive 44) service/scripts/inspect_file.py:27 — inspect_file.main has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (25 pts), loops 3 (8 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 14). 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 · bench_synthid_text.render_markdown_strategy (cognitive 43) · ×1
  • bench_synthid_text.render_markdown_strategy (cognitive 43) service/scripts/bench_synthid_text.py:2794 — bench_synthid_text.render_markdown_strategy has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 7 (13 pts), loops 4 (9 pts), boolean chains 7 (nesting depth added 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 · Benchmark.run_variants (cognitive 42) · ×1
  • Benchmark.run_variants (cognitive 42) service/scripts/bench_synthid_text.py:1193 — Benchmark.run_variants has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 7, error handling 2 (7 pts), loops 3 (6 pts), ternaries 1 (4 pts) (nesting depth added 22). 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 · container_meta._script_tag_is_jsonld (cognitive 42) · ×1
  • container_meta._script_tag_is_jsonld (cognitive 42) service/scripts/container_meta.py:1603 — container_meta._script_tag_is_jsonld has cognitive complexity 42 (threshold 15). Drivers by points: loops 8 (19 pts), boolean chains 12, if/else 6 (11 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · image_meta.strip_jpeg (cognitive 42) · ×1
  • image_meta.strip_jpeg (cognitive 42) service/scripts/image_meta.py:2004 — image_meta.strip_jpeg has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 17). 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 · audit_website.guess_kind (cognitive 39) · ×1
  • audit_website.guess_kind (cognitive 39) service/scripts/audit_website.py:100 — audit_website.guess_kind has cognitive complexity 39 (threshold 15). Drivers by points: if/else 29 (32 pts), boolean chains 6, loops 1 (nesting depth added 3). 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 · container_meta.clean_markdown (cognitive 39) · ×1
  • container_meta.clean_markdown (cognitive 39) service/scripts/container_meta.py:815 — container_meta.clean_markdown has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). 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 · image_meta.inspect_png (cognitive 38) · ×1
  • image_meta.inspect_png (cognitive 38) service/scripts/image_meta.py:376 — image_meta.inspect_png has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 4, error handling 1 (4 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 20). 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 · download_prompts.main (cognitive 38) · ×1
  • download_prompts.main (cognitive 38) REDACTED:131 — download_prompts.main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, loops 3 (5 pts), error handling 2 (4 pts), ternaries 2 (nesting depth added 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 · image_meta._parse_tiff_ifds (cognitive 37) · ×1
  • image_meta._parse_tiff_ifds (cognitive 37) service/scripts/image_meta.py:1173 — image_meta._parse_tiff_ifds has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 6, loops 3 (5 pts), boolean chains 3 (nesting depth added 14). 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 · container_meta.clean_odt (cognitive 36) · ×1
  • container_meta.clean_odt (cognitive 36) service/scripts/container_meta.py:2954 — container_meta.clean_odt has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 16). 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 · text_watermark.normalize_keys (cognitive 36) · ×1
  • text_watermark.normalize_keys (cognitive 36) service/scripts/text_watermark.py:183 — text_watermark.normalize_keys has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 4 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 19). 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 · container_meta._strip_root_svg_attrs (cognitive 35) · ×1
  • container_meta._strip_root_svg_attrs (cognitive 35) service/scripts/container_meta.py:1923 — container_meta._strip_root_svg_attrs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 2, loops 2 (nesting depth added 17). 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 · container_meta.inspect_epub (cognitive 35) · ×1
  • container_meta.inspect_epub (cognitive 35) service/scripts/container_meta.py:3092 — container_meta.inspect_epub has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 8, loops 2 (4 pts), error handling 1 (nesting depth added 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 · image_meta.inspect_gif (cognitive 35) · ×1
  • image_meta.inspect_gif (cognitive 35) service/scripts/image_meta.py:900 — image_meta.inspect_gif has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Benchmark._eval_strategy (cognitive 33) · ×1
  • Benchmark._eval_strategy (cognitive 33) service/scripts/bench_synthid_text.py:1668 — Benchmark._eval_strategy has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 4 (6 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 10). 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 · bench_deepseek_smoke.run (cognitive 32) · ×1
  • bench_deepseek_smoke.run (cognitive 32) service/scripts/bench_deepseek_smoke.py:73 — bench_deepseek_smoke.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, error handling 2 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 12). 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 · container_meta.clean_pdf (cognitive 32) · ×1
  • container_meta.clean_pdf (cognitive 32) service/scripts/container_meta.py:4294 — container_meta.clean_pdf has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 8 (nesting depth added 7). 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 · inspect_image.main (cognitive 32) · ×1
  • inspect_image.main (cognitive 32) service/scripts/inspect_image.py:16 — inspect_image.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (8 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 13). 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 · container_meta.inspect_latex (cognitive 31) · ×1
  • container_meta.inspect_latex (cognitive 31) service/scripts/container_meta.py:1318 — container_meta.inspect_latex has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 2 (6 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 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 · container_meta._pdf_clean_attachments (cognitive 31) · ×1
  • container_meta._pdf_clean_attachments (cognitive 31) service/scripts/container_meta.py:4069 — container_meta._pdf_clean_attachments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 9). 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 · image_meta.strip_gif (cognitive 31) · ×1
  • image_meta.strip_gif (cognitive 31) service/scripts/image_meta.py:959 — image_meta.strip_gif has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 3, loops 1 (nesting depth added 13). 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 · container_meta.inspect_container (cognitive 30) · ×1
  • container_meta.inspect_container (cognitive 30) service/scripts/container_meta.py:4514 — container_meta.inspect_container has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 5 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). 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 · audit_dir.main (cognitive 28) · ×1
  • audit_dir.main (cognitive 28) service/scripts/audit_dir.py:58 — audit_dir.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 11). 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 · container_meta._latex_verbatim_ranges (cognitive 28) · ×1
  • container_meta._latex_verbatim_ranges (cognitive 28) service/scripts/container_meta.py:964 — container_meta._latex_verbatim_ranges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 14). 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 · container_meta._strip_xml_declarations (cognitive 28) · ×1
  • container_meta._strip_xml_declarations (cognitive 28) service/scripts/container_meta.py:1857 — container_meta._strip_xml_declarations has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 1 (nesting depth added 16). 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 · audit_lib.scan_file (cognitive 27) · ×1
  • audit_lib.scan_file (cognitive 27) service/scripts/audit_lib.py:38 — audit_lib.scan_file has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, error handling 2 (4 pts) (nesting depth added 8). 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 · steal.cmd_query (cognitive 27) · ×1
  • steal.cmd_query (cognitive 27) REDACTED:95 — steal.cmd_query has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 9). 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 · av_meta._strip_id3v2 (cognitive 26) · ×1
  • av_meta._strip_id3v2 (cognitive 26) service/scripts/av_meta.py:297 — av_meta._strip_id3v2 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 11). 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 · bench_synthid_text.aggregate_minimal (cognitive 26) · ×1
  • bench_synthid_text.aggregate_minimal (cognitive 26) service/scripts/bench_synthid_text.py:2500 — bench_synthid_text.aggregate_minimal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 7, boolean chains 5, loops 3 (4 pts) (nesting depth added 2). 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 · container_meta.inspect_pdf (cognitive 25) · ×1
  • container_meta.inspect_pdf (cognitive 25) service/scripts/container_meta.py:3387 — container_meta.inspect_pdf has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 12). 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 · HumanLikeness._pangram_batch (cognitive 24) · ×1
  • HumanLikeness._pangram_batch (cognitive 24) service/scripts/bench_synthid_text.py:755 — HumanLikeness._pangram_batch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 8). 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 · container_meta._iter_data_uris (cognitive 24) · ×1
  • container_meta._iter_data_uris (cognitive 24) service/scripts/container_meta.py:380 — container_meta._iter_data_uris has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (8 pts), boolean chains 6 (nesting depth added 9). 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 · container_meta.clean_container (cognitive 24) · ×1
  • container_meta.clean_container (cognitive 24) service/scripts/container_meta.py:4664 — container_meta.clean_container has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4 (nesting depth added 10). 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 · image_meta.inspect_tiff (cognitive 24) · ×1
  • image_meta.inspect_tiff (cognitive 24) service/scripts/image_meta.py:1258 — image_meta.inspect_tiff has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 11). 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 · Handler._handle_watermark_batch (cognitive 24) · ×1
  • Handler._handle_watermark_batch (cognitive 24) service/scripts/server.py:1601 — Handler._handle_watermark_batch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 8). 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 · server._apply_layer_b (cognitive 24) · ×1
  • server._apply_layer_b (cognitive 24) service/scripts/server.py:963 — server._apply_layer_b has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 7). 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 · HumanLikeness._load (cognitive 23) · ×1
  • HumanLikeness._load (cognitive 23) service/scripts/bench_synthid_text.py:648 — HumanLikeness._load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 9). 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 · container_meta._meta_attrs (cognitive 23) · ×1
  • container_meta._meta_attrs (cognitive 23) service/scripts/container_meta.py:1439 — container_meta._meta_attrs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 9). 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 · container_meta._xml_decl_end (cognitive 23) · ×1
  • container_meta._xml_decl_end (cognitive 23) service/scripts/container_meta.py:1809 — container_meta._xml_decl_end has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1 (nesting depth added 12). 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 · install_skill.parse_frontmatter (cognitive 22) · ×1
  • install_skill.parse_frontmatter (cognitive 22) install_skill.py:87 — install_skill.parse_frontmatter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). 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 · audit_website.fetch (cognitive 22) · ×1
  • audit_website.fetch (cognitive 22) service/scripts/audit_website.py:384 — audit_website.fetch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 pts) (nesting depth added 13). 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 · Benchmark.generate_samples (cognitive 22) · ×1
  • Benchmark.generate_samples (cognitive 22) service/scripts/bench_synthid_text.py:1122 — Benchmark.generate_samples has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). 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 · container_meta._inspect_embedded_data_uris (cognitive 22) · ×1
  • container_meta._inspect_embedded_data_uris (cognitive 22) service/scripts/container_meta.py:438 — container_meta._inspect_embedded_data_uris has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 9). 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 · container_meta.inspect_html (cognitive 22) · ×1
  • container_meta.inspect_html (cognitive 22) service/scripts/container_meta.py:1649 — container_meta.inspect_html has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4, boolean chains 1 (nesting depth added 8). 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 · text_watermark._watermark_local_markllm (cognitive 22) · ×1
  • text_watermark._watermark_local_markllm (cognitive 22) service/scripts/text_watermark.py:337 — text_watermark._watermark_local_markllm has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 4 (6 pts), boolean chains 2, ternaries 2 (nesting depth added 5). 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 · image_meta.clean_image (cognitive 21) · ×1
  • image_meta.clean_image (cognitive 21) service/scripts/image_meta.py:2219 — image_meta.clean_image has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 6). 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 · rewrite_text.main (cognitive 21) · ×1
  • rewrite_text.main (cognitive 21) service/scripts/rewrite_text.py:1361 — rewrite_text.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 4). 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 · audit_lib.format_sarif (cognitive 20) · ×1
  • audit_lib.format_sarif (cognitive 20) service/scripts/audit_lib.py:227 — audit_lib.format_sarif has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (4 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). 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 · audit_website.main (cognitive 20) · ×1
  • audit_website.main (cognitive 20) service/scripts/audit_website.py:560 — audit_website.main has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 6 (7 pts), loops 2 (3 pts), ternaries 2, boolean chains 1 (nesting depth added 5). 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 · bench_synthid_text.render_markdown (cognitive 20) · ×1
  • bench_synthid_text.render_markdown (cognitive 20) service/scripts/bench_synthid_text.py:2553 — bench_synthid_text.render_markdown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 2 (3 pts), ternaries 3 (nesting depth added 3). 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 · check_staged.main (cognitive 20) · ×1
  • check_staged.main (cognitive 20) service/scripts/check_staged.py:27 — check_staged.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (6 pts) (nesting depth added 8). 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 · image_meta._png_text_entries (cognitive 20) · ×1
  • image_meta._png_text_entries (cognitive 20) service/scripts/image_meta.py:279 — image_meta._png_text_entries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), boolean chains 2 (nesting depth added 9). 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 · image_meta.run_optional_tools (cognitive 20) · ×1
  • image_meta.run_optional_tools (cognitive 20) service/scripts/image_meta.py:1452 — image_meta.run_optional_tools has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, error handling 2 (4 pts), ternaries 1 (nesting depth added 4). 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 · image_meta.strip_png (cognitive 20) · ×1
  • image_meta.strip_png (cognitive 20) service/scripts/image_meta.py:1940 — image_meta.strip_png has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 8). 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 · MarkLLMTextDetector.detect (cognitive 20) · ×1
  • MarkLLMTextDetector.detect (cognitive 20) service/scripts/text_detectors.py:166 — MarkLLMTextDetector.detect has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 7, error handling 3 (4 pts), ternaries 2 (nesting depth added 1). 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 · download_prompts.fetch_rows_retrying (cognitive 20) · ×1
  • download_prompts.fetch_rows_retrying (cognitive 20) REDACTED:68 — download_prompts.fetch_rows_retrying has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 12). 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 · av_meta._strip_wav (cognitive 19) · ×1
  • av_meta._strip_wav (cognitive 19) service/scripts/av_meta.py:459 — av_meta._strip_wav has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 7). 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 · bench_synthid_text._strategy_csv (cognitive 19) · ×1
  • bench_synthid_text._strategy_csv (cognitive 19) service/scripts/bench_synthid_text.py:2984 — bench_synthid_text._strategy_csv has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 6, loops 1 (nesting depth added 6). 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 · container_meta.clean_latex (cognitive 19) · ×1
  • container_meta.clean_latex (cognitive 19) service/scripts/container_meta.py:1363 — container_meta.clean_latex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 7). 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 · audit_lib.aggregate (cognitive 18) · ×1
  • audit_lib.aggregate (cognitive 18) service/scripts/audit_lib.py:166 — audit_lib.aggregate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). 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 · av_meta._parse_id3v2_frames (cognitive 18) · ×1
  • av_meta._parse_id3v2_frames (cognitive 18) service/scripts/av_meta.py:186 — av_meta._parse_id3v2_frames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 3). 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 · Benchmark._pick_humanized_recommendation (cognitive 18) · ×1
  • Benchmark._pick_humanized_recommendation (cognitive 18) service/scripts/bench_synthid_text.py:2017 — Benchmark._pick_humanized_recommendation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). 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 · container_meta._scrub_odt_text (cognitive 18) · ×1
  • container_meta._scrub_odt_text (cognitive 18) service/scripts/container_meta.py:2438 — container_meta._scrub_odt_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). 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 · container_meta.inspect_odt (cognitive 18) · ×1
  • container_meta.inspect_odt (cognitive 18) service/scripts/container_meta.py:2919 — container_meta.inspect_odt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 7). 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 · rewrite_text._mlm_infill (cognitive 18) · ×1
  • rewrite_text._mlm_infill (cognitive 18) service/scripts/rewrite_text.py:483 — rewrite_text._mlm_infill has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 6). 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 · install_skill.main (cognitive 17) · ×1
  • install_skill.main (cognitive 17) install_skill.py:389 — install_skill.main has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 5 (6 pts), ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 5). 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 · av_meta._inspect_id3v2 (cognitive 17) · ×1
  • av_meta._inspect_id3v2 (cognitive 17) service/scripts/av_meta.py:232 — av_meta._inspect_id3v2 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). 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 · av_meta._inspect_wav (cognitive 17) · ×1
  • av_meta._inspect_wav (cognitive 17) service/scripts/av_meta.py:426 — av_meta._inspect_wav has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, loops 1 (nesting depth added 9). 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 · bench_deepseek_smoke.load_fixture (cognitive 17) · ×1
  • bench_deepseek_smoke.load_fixture (cognitive 17) service/scripts/bench_deepseek_smoke.py:26 — bench_deepseek_smoke.load_fixture has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). 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 · clean_video.video_purify (cognitive 17) · ×1
  • clean_video.video_purify (cognitive 17) service/scripts/clean_video.py:285 — clean_video.video_purify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 2). 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 · container_meta._pdf_attachment_list (cognitive 17) · ×1
  • container_meta._pdf_attachment_list (cognitive 17) service/scripts/container_meta.py:3825 — container_meta._pdf_attachment_list has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 2 (3 pts), error handling 2, loops 1 (nesting depth added 2). 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 · image_meta.strip_webp (cognitive 17) · ×1
  • image_meta.strip_webp (cognitive 17) service/scripts/image_meta.py:2091 — image_meta.strip_webp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 4). 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 · install_skill.install_directory (cognitive 16) · ×1
  • install_skill.install_directory (cognitive 16) install_skill.py:223 — install_skill.install_directory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 5). 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 · Benchmark._persist_strategy_outputs (cognitive 16) · ×1
  • Benchmark._persist_strategy_outputs (cognitive 16) service/scripts/bench_synthid_text.py:2077 — Benchmark._persist_strategy_outputs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). 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 · bench_synthid_text.render_markdown_minimal (cognitive 16) · ×1
  • bench_synthid_text.render_markdown_minimal (cognitive 16) service/scripts/bench_synthid_text.py:2690 — bench_synthid_text.render_markdown_minimal has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 3, loops 2 (nesting depth added 3). 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 · clean_staged.main (cognitive 16) · ×1
  • clean_staged.main (cognitive 16) service/scripts/clean_staged.py:135 — clean_staged.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), ternaries 2 (nesting depth added 6). 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 · container_meta.inspect_markdown (cognitive 16) · ×1
  • container_meta.inspect_markdown (cognitive 16) service/scripts/container_meta.py:774 — container_meta.inspect_markdown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). 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 · container_meta._latex_split_items (cognitive 16) · ×1
  • container_meta._latex_split_items (cognitive 16) service/scripts/container_meta.py:1074 — container_meta._latex_split_items has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). 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 · container_meta._iter_jpeg_segments (cognitive 16) · ×1
  • container_meta._iter_jpeg_segments (cognitive 16) service/scripts/container_meta.py:3527 — container_meta._iter_jpeg_segments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). 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.
D4 · Code Duplication · Near-duplicate member pair (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) service/scripts/container_meta.py:2712 — service/scripts/container_meta.py:2712-2883 | service/scripts/container_meta.py:3227-3349 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) service/scripts/image_meta.py:1703 — service/scripts/image_meta.py:1703-1770 | service/scripts/image_meta.py:1784-1844 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) service/scripts/synthid_score_server.py:152 — service/scripts/synthid_score_server.py:152-172 | service/scripts/synthid_text_server.py:297-325 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) service/scripts/server.py:1523 — service/scripts/server.py:1523-1536 | service/scripts/server.py:1542-1554 | service/scripts/server.py:1561-1573 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) service/scripts/format_dispatch.py:130 — service/scripts/format_dispatch.py:130-157 | service/scripts/format_dispatch.py:161-189 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) service/scripts/container_meta.py:1208 — service/scripts/container_meta.py:1208-1234 | service/scripts/container_meta.py:1238-1256 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) service/scripts/detect_text_watermark.py:210 — service/scripts/detect_text_watermark.py:210-224 | service/scripts/markdiffusion_harness.py:149-162 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) service/scripts/bench_synthid_text.py:204 — service/scripts/bench_synthid_text.py:204-221 | service/scripts/bench_synthid_text.py:225-243 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×1
  • Edited copy of a member (11 corresponding lines) service/scripts/server.py:1428 — service/scripts/server.py:1428-1440 | service/scripts/synthid_text_server.py:147-157 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×1
  • Edited copy of a member (12 corresponding lines) service/scripts/container_meta.py:590 — service/scripts/container_meta.py:590-601 | service/scripts/container_meta.py:605-623 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) service/scripts/clean_audio.py:124 — service/scripts/clean_audio.py:124-154 | service/scripts/clean_audio.py:158-190 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) service/scripts/text_unicode.py:531 — service/scripts/text_unicode.py:531-534 | skills/clean-user-facing-text/scripts/text_unicode.py:531-534 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (138 lines × 2) · ×1
  • Duplicated block (138 lines × 2) service/scripts/score_stylometry.py:319 — service/scripts/score_stylometry.py:319-456 | skills/clean-user-facing-text/scripts/score_stylometry.py:319-456 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (114 lines × 2) · ×1
  • Duplicated block (114 lines × 2) service/scripts/inspect_text.py:20 — service/scripts/inspect_text.py:20-133 | skills/clean-user-facing-text/scripts/inspect_text.py:20-133 — before extracting anything, compare `service/scripts/inspect_text.py` and `skills/clean-user-facing-text/scripts/inspect_text.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (90 lines × 2) · ×1
  • Duplicated block (90 lines × 2) service/scripts/common.py:427 — service/scripts/common.py:427-516 | skills/clean-user-facing-text/scripts/common.py:427-516 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (71 lines × 2) · ×1
  • Duplicated block (71 lines × 2) service/scripts/clean_text.py:24 — service/scripts/clean_text.py:24-94 | skills/clean-user-facing-text/scripts/clean_text.py:24-94 — before extracting anything, compare `service/scripts/clean_text.py` and `skills/clean-user-facing-text/scripts/clean_text.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (63 lines × 2) · ×1
  • Duplicated block (63 lines × 2) service/scripts/text_unicode.py:652 — service/scripts/text_unicode.py:652-714 | skills/clean-user-facing-text/scripts/text_unicode.py:652-714 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (61 lines × 2) · ×1
  • Duplicated block (61 lines × 2) service/scripts/text_unicode.py:467 — service/scripts/text_unicode.py:467-527 | skills/clean-user-facing-text/scripts/text_unicode.py:467-527 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) service/scripts/text_unicode.py:584 — service/scripts/text_unicode.py:584-640 | skills/clean-user-facing-text/scripts/text_unicode.py:584-640 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) service/scripts/common.py:200 — service/scripts/common.py:200-243 | skills/clean-user-facing-text/scripts/common.py:200-243 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) service/scripts/score_stylometry.py:460 — service/scripts/score_stylometry.py:460-499 | skills/clean-user-facing-text/scripts/score_stylometry.py:460-499 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) service/scripts/common.py:343 — service/scripts/common.py:343-381 | skills/clean-user-facing-text/scripts/common.py:343-381 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/common.py:343` 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) service/scripts/common.py:163 — service/scripts/common.py:163-192 | skills/clean-user-facing-text/scripts/common.py:163-192 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) service/scripts/common.py:263 — service/scripts/common.py:263-291 | skills/clean-user-facing-text/scripts/common.py:263-291 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) service/scripts/image_meta.py:2142 — service/scripts/image_meta.py:2142-2163 | service/scripts/image_meta.py:2168-2189 — 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 (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) service/scripts/container_meta.py:2736 — service/scripts/container_meta.py:2736-2756 | service/scripts/container_meta.py:3260-3277 — 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 `service/scripts/container_meta.py:2736` 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) service/scripts/common.py:320 — service/scripts/common.py:320-339 | skills/clean-user-facing-text/scripts/common.py:320-339 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) service/scripts/score_stylometry.py:228 — service/scripts/score_stylometry.py:228-248 | skills/clean-user-facing-text/scripts/score_stylometry.py:228-248 — before extracting anything, compare `service/scripts/score_stylometry.py` and `skills/clean-user-facing-text/scripts/score_stylometry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 294 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/score_stylometry.py:228` 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.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) service/scripts/clean_text.py:27 — service/scripts/clean_text.py:27-44 | service/scripts/inspect_text.py:22-39 | skills/clean-user-facing-text/scripts/clean_text.py:27-44 | skills/clean-user-facing-text/scripts/inspect_text.py:22-39 — before extracting anything, compare `service/scripts/clean_text.py` and `skills/clean-user-facing-text/scripts/clean_text.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/clean_text.py:27` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `service/scripts/clean_text.py:26` calls `add_argument` and `service/scripts/inspect_text.py:21` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) service/scripts/common.py:299 — service/scripts/common.py:299-316 | skills/clean-user-facing-text/scripts/common.py:299-316 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) service/scripts/common.py:104 — service/scripts/common.py:104-120 | skills/clean-user-facing-text/scripts/common.py:104-120 — before extracting anything, compare `service/scripts/common.py` and `skills/clean-user-facing-text/scripts/common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 351 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) service/scripts/container_meta.py:3018 — service/scripts/container_meta.py:3018-3032 | service/scripts/container_meta.py:3334-3349 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • Duplicated block (11–12 lines × 4) service/scripts/text_unicode.py:585 — service/scripts/text_unicode.py:585-595 | service/scripts/text_unicode.py:656-667 | skills/clean-user-facing-text/scripts/text_unicode.py:585-595 | skills/clean-user-facing-text/scripts/text_unicode.py:656-667 — before extracting anything, compare `service/scripts/text_unicode.py` and `skills/clean-user-facing-text/scripts/text_unicode.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 301 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/text_unicode.py:585` 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 (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) service/scripts/server.py:1480 — service/scripts/server.py:1480-1490 | service/scripts/synthid_score_server.py:100-110 | service/scripts/synthid_text_server.py:184-195 — before extracting anything, compare `service/scripts/server.py` and `service/scripts/synthid_score_server.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) service/scripts/container_meta.py:2599 — service/scripts/container_meta.py:2599-2610 | service/scripts/container_meta.py:2641-2649 — 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 (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) service/scripts/detect_text_watermark.py:198 — service/scripts/detect_text_watermark.py:198-205 | service/scripts/detect_text_watermark.py:213-222 | service/scripts/markdiffusion_harness.py:152-161 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. 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 (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) service/scripts/container_meta.py:516 — service/scripts/container_meta.py:516-525 | service/scripts/image_meta.py:2243-2250 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) service/scripts/container_meta.py:4736 — service/scripts/container_meta.py:4736-4745 | service/scripts/container_meta.py:4747-4756 | service/scripts/container_meta.py:4757-4765 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) service/scripts/server.py:1337 — service/scripts/server.py:1337-1346 | service/scripts/server.py:1359-1367 — 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 (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) service/scripts/image_meta.py:1757 — service/scripts/image_meta.py:1757-1765 | service/scripts/image_meta.py:1834-1841 — 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 `service/scripts/image_meta.py:1757` 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. 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) service/scripts/container_meta.py:2875 — service/scripts/container_meta.py:2875-2881 | service/scripts/container_meta.py:3024-3030 | service/scripts/container_meta.py:3340-3347 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) service/scripts/server.py:1659 — service/scripts/server.py:1659-1665 | service/scripts/synthid_text_server.py:286-293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `service/scripts/synthid_text_server.py:286` 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 (5 lines × 2) · ×1
  • Duplicated block (5 lines × 2) service/scripts/bench_synthid_text.py:1717 — service/scripts/bench_synthid_text.py:1717-1721 | service/scripts/bench_synthid_text.py:1802-1806 — 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 `service/scripts/bench_synthid_text.py:1717` 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) service/scripts/clean_ctrlregen.py:35 — service/scripts/clean_ctrlregen.py:35-40 | service/scripts/detect_text_watermark.py:68-73 | service/scripts/markdiffusion_harness.py:75-80 | service/scripts/score_synthid.py:31-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) service/scripts/server.py:1443 — service/scripts/server.py:1443-1449 | service/scripts/synthid_score_server.py:78-84 | service/scripts/synthid_text_server.py:160-166 — before extracting anything, compare `service/scripts/server.py` and `service/scripts/synthid_score_server.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `service/scripts/server.py:1452` calls `urlparse` and `service/scripts/synthid_score_server.py:87` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging call was found in the 6 Python production file(s) this check read across 1 module(s). Each was searched for its ecosystem's logging libraries (Python: logging, structlog, loguru) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
Minor — 37 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×19
  • Duplicated predicate service/scripts/common.py:336 — `"bytes_in" in result and "bytes_out" in result and result["bytes_in"] != result["bytes_out"]` appears character-identically in 2 files — service/scripts/common.py, skills/clean-user-facing-text/scripts/common.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/common.py:302 — `action_lower.startswith("no ") or action_lower.startswith("warning:") or "not needed" in action_lower or "skipped" in action_lower or "prese…` appears character-identically in 2 files — service/scripts/common.py, skills/clean-user-facing-text/scripts/common.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/clean_file.py:101 — `args.force_type == "text" or args.force_text` appears character-identically in 2 files — service/scripts/clean_file.py, service/scripts/inspect_file.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/detect_text_watermark.py:264 — `args.path != "-" and not Path(args.path).is_file()` appears character-identically in 2 files — service/scripts/detect_text_watermark.py, service/scripts/markdiffusion_harness.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/detect_text_watermark.py:193 — `clean != config.strip() or clean in ("..", ".", "")` appears character-identically in 2 files — service/scripts/detect_text_watermark.py, service/scripts/text_watermark.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/score_stylometry.py:427 — `cv is not None and cv < 0.35 and sentence_count >= 3` appears character-identically in 2 files — service/scripts/score_stylometry.py, skills/clean-user-facing-text/scripts/score_stylometry.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/audit_website.py:214 — `data[:100].lstrip().startswith(b"<") and b"svg" in data[:500].lower()` appears character-identically in 2 files — service/scripts/audit_website.py, service/scripts/container_meta.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/server.py:1004 — `host not in ("127.0.0.1", "localhost", "::1") and not allow_remote` appears character-identically in 2 files — service/scripts/server.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/bench_synthid_text.py:1451 — `isinstance(score, (int, float)) and isinstance(threshold, (int, float))` appears character-identically in 2 files — service/scripts/bench_synthid_text.py, service/scripts/rewrite_text.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/av_meta.py:70 — `len(data) >= 12 and data[4:8] == b"ftyp"` appears character-identically in 2 files — service/scripts/av_meta.py, service/scripts/image_meta.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/synthid_text_server.py:219 — `not isinstance(text, str) or not text.strip()` appears character-identically in 2 files — service/scripts/synthid_text_server.py, service/scripts/text_watermark.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/clean_text.py:82 — `out is None and args.path not in (None, "-")` appears character-identically in 2 files — service/scripts/clean_text.py, skills/clean-user-facing-text/scripts/clean_text.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/server.py:1485 — `raw_len is not None and raw_len.isdigit() and int(raw_len) > MAX_BODY_BYTES` appears character-identically in 3 files — service/scripts/server.py, service/scripts/synthid_score_server.py, service/scripts/synthid_text_server.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/score_stylometry.py:532 — `report.status == "ok" and report.score is not None and report.score >= args.threshold` appears character-identically in 2 files — service/scripts/score_stylometry.py, skills/clean-user-facing-text/scripts/score_stylometry.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/clean_file.py:195 — `result["still_has_c2pa"] or result["still_has_ai_metadata"]` appears character-identically in 2 files — service/scripts/clean_file.py, service/scripts/clean_image.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/common.py:325 — `stats.get("removed_count") or stats.get("replaced_count")` appears character-identically in 2 files — service/scripts/common.py, skills/clean-user-facing-text/scripts/common.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/clean_file.py:165 — `stats["removed_count"] or stats["replaced_count"]` appears character-identically in 2 files — service/scripts/clean_file.py, service/scripts/container_meta.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/inspect_text.py:126 — `stylometry_report and stylometry_report.status == "ok" and stylometry_report.score is not None and stylometry_report.score >= args.threshold` appears character-identically in 2 files — service/scripts/inspect_text.py, skills/clean-user-facing-text/scripts/inspect_text.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate service/scripts/common.py:450 — `t.startswith("layer-a") and t.endswith("(space)")` appears character-identically in 2 files — service/scripts/common.py, skills/clean-user-facing-text/scripts/common.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×3
  • Hand-rolled JSON/XML parsing via regex service/scripts/container_meta.py:1535 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex service/scripts/container_meta.py:2424 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex service/scripts/container_meta.py:2571 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×3
  • Silent fallback default on parse failure service/scripts/clean_audio.py:153 — `_probe_sample_rate` returns `44100` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure service/scripts/clean_video.py:256 — `_frame_durations` returns `[]` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure REDACTED:64 — `_retry_after` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 9 significant file(s) lose their only recent owner: service/scripts/bench_synthid_text.py, service/scripts/markdiffusion_harness.py, service/scripts/clean_video.py, service/scripts/detect_gumbel.py, service/scripts/clean_audio.py, REDACTED, service/scripts/clean_ctrlregen.py, stealer/scorer.py (+1 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (12 single-owned of 44 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 44 of the 46 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: service/scripts/text_watermark.py, service/scripts/synthid_text_server.py, service/scripts/bench_deepseek_smoke.py.
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, 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.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`install_skill.py`).
P4 · Deployment & Rollback · No rollback/health safety · ×1
  • No rollback/health safety REDACTED:32 — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch service/scripts/container_meta.py:3849 — `_pdf_attachment_list` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 12 finding(s)
D12 · Dependency Hygiene · Outdated · ×12
  • Outdated: cython — `cython` is pinned to 3.3.0, but 3.3.1 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 3.3.0 until the declaration is edited.
  • Outdated: datasets — `datasets` is pinned to 5.0.1, but 5.2.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 5.0.1 until the declaration is edited.
  • Outdated: diffusers — `diffusers` is pinned to 0.27.2, but 0.43.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 0.27.2 until the declaration is edited.
  • Outdated: huggingface-hub — `huggingface-hub` is pinned to 0.24.0, but 2.4.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 0.24.0 until the declaration is edited. This crosses a major version, so it is a migration rather than a bump.
  • Outdated: matplotlib — `matplotlib` is pinned to 3.11.1, but 3.11.2 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 3.11.1 until the declaration is edited.
  • Outdated: nltk — `nltk` is pinned to 3.10.3, but 3.10.4 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 3.10.3 until the declaration is edited.
  • Outdated: numpy — `numpy` is pinned to 2.5.3, but 2.5.5 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 2.5.3 until the declaration is edited.
  • Outdated: scikit-learn — `scikit-learn` is pinned to 1.9.0, but 1.9.1 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.9.0 until the declaration is edited.
  • Outdated: sentence-transformers — `sentence-transformers` is pinned to 6.1.0, but 6.3.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 6.1.0 until the declaration is edited.
  • Outdated: sentencepiece — `sentencepiece` is pinned to 0.2.2, but 0.2.3 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 0.2.2 until the declaration is edited.
  • Outdated: tokenizers — `tokenizers` is pinned to 0.22.2, but 0.23.3 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 0.22.2 until the declaration is edited.
  • Outdated: transformers — `transformers` is pinned to 4.37.2, but 5.23.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 4.37.2 until the declaration is edited. This crosses a major version, so it is a migration rather than a bump.

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)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-29e11bd1c95d4004afd14a914c0e4055/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=116" --report-format json --report-path /tmp/watchdog-gitleaks-29e11bd1c95d4004afd14a914c0e4055/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-29e11bd1c95d4004afd14a914c0e4055/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .4artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .3artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .7artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-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-hardening—runtime-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-hardening—runtime-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—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1e5f7-ad9f-7e1a-a965-d8c258eedfcd · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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