Public report of Leonxlnx/athenaion, published 17 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 reportMeasured 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, 17 November 2026, 03:35 UTC · Survey ID cd_c4eba57d5afb41c7bab495d572ddbab0
Leonxlnx/athenaion
Measured 17 November 2026, 03:32 UTC, at code version 9b8bd23
Code coverage is not measured: Suite not runnable in-image.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
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: 43,271 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Code Health, 26.3
Findings by how serious they are
2 critical670 serious46 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 03:32 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 ▸
51of 51 dimensions measured by tools.
709of 718 findings point to an exact file and line, so you can open each one in the code. The other 9 concern the repository as a whole, such as missing documentation.
51dimensions across 6 lenses, read from 43,271 lines of product code in 1 project.
Leonxlnx/athenaion falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 39.8 out of 100 and is rated Weak, and neither of its two critical findings concerns security.
Code Health, at 26.3, is the weakest lens and counts most in the score. The best first steps are adding type checking and simplifying the most tangled functions, each worth about 4.4 points. Raising Code Health to 70 would lift the score to about 50.8.
The two loops of files that import each other need breaking.
The product code is 43,271 lines, about €37,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 forThe 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.
If Code Health rose from 26.3 to 70, the lowest score rated Strong, the score would rise from 39.8 to about 50.8.
Code composition: what the lines of code are
Product code 100%Tests 0%
Rebuild cost: about €37,000 · Estimate
Cost to rebuild
€12,000 to €62,000, for 204 to 648 hours of work, about 0.3 person-years for one engineer
Difficulty of the problem
Standard, 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.7 at a score of 40. 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.
Size
Medium: 43,271 lines of product code
What it is not
Not 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
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 4.4 points · Medium effort · Type Safety
2
Resolve the 40 finding(s) in Cyclomatic Complexity.
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 3.9 points · Medium effort · CI/CD gates
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.
Where the investment is most exposed · Value at risk
This code would cost about €37,000 to build again, about 0.3 person-years of work. Its weakest lens is Code Health, at 26.3 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. Of all the actions in this report, it raises the score most for the work it takes: about 4.4 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 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 43,757 lines over the last 90 days, which is about 177,459 lines a year. At that pace, the extra work comes to an estimated 22.2 to 133.1 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.
At a glance — Code Health · 26.3 · Weak · gated by D1, D2, R1, R2, R3 ·
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 category
Findings
Severity
A05:2025 — Injection
1
Medium
Roadmap
Top priorities: Bring the 263 bodies over 15 down to 15 or less in Cognitive Complexity — start with scatterWorld (cognitive 746), buildChain (cognitive 497), voxel.meshChunk (cognitive 346); Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Resolve the 40 finding(s) in Cyclomatic Complexity.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Run what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Add a test runner (vitest / jest / playwright) and eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
Bring the 263 bodies over 15 down to 15 or less in Cognitive Complexity — start with scatterWorld (cognitive 746), buildChain (cognitive 497), voxel.meshChunk (cognitive 346).
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
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.
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 — 2
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 — 670
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 — 46
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 51 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, 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 — 51 dimensions across the health lenses
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
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, 709 of 718 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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.
D8 Code Coverage — 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. Coverage NOT MEASURED: the test suite could not be built/run in-image (commonly external-service dependencies — a database, a broker — we won't provision). To have it measured, make the suite runnable without them. For context only, test code is ≈ 0% of production LoC (42 test / 43,271 production) — a rough proxy, NOT a coverage measurement, so it is excluded from the score. You can widen what we reach: optional: make the suite runnable without a database, broker or other service we do not provision, and real coverage is measured on the next scan.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Git history depth insufficient — this repository has 2 commit(s), too few for a reliable trend signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 2 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D20 ADR Quality — 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. The ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository. Read, stating neither a host nor a published package: `package.json`.
D21 Naming 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's source is written only in languages whose packages are published through a manifest, and no manifest in the tree makes a publication act: either there is no package manifest of any ecosystem (no package.json, pyproject.toml, setup.py, gemspec, Cargo.toml, pom.xml, build.gradle, composer.json, pubspec.yaml or mix.exs), or every one present declares in its package manager's own terms that it is not published (an npm package marked "private": true, a Cargo package with publish = false, a pubspec with publish_to: none, a Composer "project", a Poetry project with package-mode = false, or the "Private :: Do Not Upload" classifier). With no publication act there is no intentionally-exposed surface for API consistency to be judged over.
D26 Project Cohesion — 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. `(repository root)` (43271 LoC, 206 module-visible types across 20 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
D34 Knowledge Freshness — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Too few commits to judge knowledge freshness (2 commit(s) sampled).
D35 Change Coupling — measured, with a gap in what it reached — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Git history depth insufficient — this repository has 2 commit(s), too few for a reliable change-coupling signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
AXB2 Runtime readiness — 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. The dev server kept running but no port it opened served a page in the time allowed. (rule: no-answer). The renderer reported: the dev server (`npm run serve`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> athenaion@0.1.0 serve / > node REDACTED / Serving <repo> at http://localhost:8080/" No runtime evidence was gathered.
AXR1 Runtime accessibility — 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. Render strategy: boot via DevServer (serve). the dev server (`npm run serve`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> athenaion@0.1.0 serve / > node REDACTED / Serving <repo> at http://localhost:8080/" No runtime evidence was gathered.
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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
R10 Code Duplication — 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. 43 further occurrence(s) are not listed individually; the score already reflects all 83.
R2 Cyclomatic Complexity — 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. 220 further occurrence(s) are not listed individually; the score already reflects all 260.
R7 Dead Code — 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. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
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. 171 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled certificate validation, obsolete TLS versions, plaintext password storage and session cookies set without HttpOnly, Secure or SameSite, and none was found. The server controls this dimension also scores were not assessed, so no score is given.
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.
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.
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.
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.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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.
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 Dockerfile (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.
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.
+ 170 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 22 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with scatterWorld (cyclomatic 273), buildChain (cyclomatic 208), build (cyclomatic 191). — 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 22 together lifts Cyclomatic 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: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 254 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 263 bodies over 15 down to 15 or less in Cognitive Complexity — start with scatterWorld (cognitive 746), buildChain (cognitive 497), voxel.meshChunk (cognitive 346). — 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 263 together lifts Cognitive Complexity from 2.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes5.1 / 10Adequate✓ 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.
Resolve the 39 FunctionTooLong finding(s) in God Classes — start with figure.js (2), waterfalls.js (2), arcade.js (2). — One of this dimension's main actionable groups (39 warning-level).
Resolve the 7 FileTooLong finding(s) in God Classes — start with flora.js, statues.js, heightfield.js. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 2 MethodTooLong finding(s) in God Classes — start with pipeline.js, banner.js. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
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.
2 outdated direct production npm dependency(ies) of 3 graded, 0 pinning defect(s), across 1 package.json (1 of them the product) and 1 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.
Outdated (npm): puppeteer-core · ×2
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 of 25 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 25 package(s) this repository's committed lockfile installs for a consumer — its 3 production, optional and peer dependency(ies), across 1 product package.json manifest(s), and everything those install in turn. Its 0 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. No third-party code was found shipping without a manifest entry (vendored or copied-in directories, licence comments preserved in committed bundles, bundled module paths, compiled wasm modules).
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.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
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.
21 % 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.
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.
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).
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.
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.
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.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 3 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.
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.
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.
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.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. (×17) — src/acropolis/stair.js:357, src/arch/entablature.js:163, src/arch/ornament.js:206, …
`build` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. (×3) — src/modules/aqueducts.js:117, src/modules/clouds.js:537, src/modules/sets.js:24
What to do
Remove the dead code that looks live: delete dead if(false) branches, which read as logic that runs, and either do the real async work or drop the async keyword from fake-async functions, which promise work they never wait for.
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.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
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.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
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.
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.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
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.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
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.
No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:10
What to do
Run what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.existsSync` in `bake` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/bake/head.js:15
`fs.readdirSync` in `bake` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/bake/head.js:25
`fs.unlinkSync` in `bake` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/bake/head.js:25
`fs.openSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:38
`fs.writeSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:38
`fs.closeSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:38
`fs.readFileSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:42
`fs.rmSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:42
`fs.mkdirSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:100
`fs.writeFileSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:101
`fs.existsSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:104
`execFileSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tools/session.mjs:106
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 183 plain JS — the untyped files are src/acropolis/arcade.js, src/acropolis/balustrade.js, src/acropolis/bastion.js, src/acropolis/bridge.js, src/acropolis/buildings.js, src/acropolis/cliffdress.js (+177 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
28 duplicated blocks under src/ have copies in at least two of the sibling directories acropolis, arch, city, core, flora, materials (+10 more sibling(s) not listed) — 21 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 28 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 28 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 28 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/ruins/sdf.js:37
src/arch/temple.js:257 · src/arch/temple.js:450 — the two spans are one implementation copied and then locally edited — 706 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/arch/temple.js:257
src/flora/surface.js:39 · src/flora/surface.js:141 — the two spans are one implementation copied and then locally edited — 582 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/flora/surface.js:39
src/water/churn.js:90 · src/water/mist.js:212 — the two spans are one implementation copied and then locally edited — 274 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/water/churn.js:90
src/props/brazier.js:51 · src/props/urn.js:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/props/brazier.js:51
src/ruins/sdf.js:37 · src/sculpt/head.js:539 — the two spans are one implementation copied and then locally edited — 289 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/ruins/sdf.js:37
src/city/fleet.js:34 · src/city/fleet.js:165 — the two spans are one implementation copied and then locally edited — 355 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/city/fleet.js:34
src/arch/geom.js:480 · src/sculpt/sdf.js:137 — the two spans are one implementation copied and then locally edited — 241 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/arch/geom.js:480
src/acropolis/geo.js:103 · src/arch/geom.js:117 — the two spans are one implementation copied and then locally edited — 147 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/acropolis/geo.js:103
src/modules/statues.js:667 · src/modules/statues.js:696 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/modules/statues.js:667
src/ruins/sdf.js:72 · src/sculpt/bakeutil.js:73 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — src/ruins/sdf.js:72
tools/render-video.mjs:43 · tools/session.mjs:30 — the two spans are one implementation copied and then locally edited — 197 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — tools/render-video.mjs:43
src/props/lamp.js:66 · src/props/urn.js:72 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/lamp.js:66
src/water/flow.js:14 · src/world/heightfield.js:37 — the two spans are one implementation copied and then locally edited — 232 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/water/flow.js:14
src/core/pipeline.js:171 · src/core/pipeline.js:219 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/core/pipeline.js:171
src/props/brazier.js:113 · src/props/urn.js:61 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/brazier.js:113
src/props/brazier.js:125 · src/props/lamp.js:66 · src/props/urn.js:72 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/brazier.js:125
src/sculpt/props.js:245 · src/sculpt/props.js:282 — the two spans are one implementation copied and then locally edited — 199 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/sculpt/props.js:245
src/core/sky.js:342 · src/water/mist.js:254 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/core/sky.js:342
src/flora/heroes.js:100 · src/modules/ruins.js:373 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/flora/heroes.js:100
src/props/brazier.js:321 · src/props/urn.js:395 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/brazier.js:321
src/city/harbour.js:280 · src/city/harbour.js:292 — the two spans are one implementation copied and then locally edited — 127 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/city/harbour.js:280
src/city/plan.js:98 · src/city/plan.js:110 — the two spans are one implementation copied and then locally edited — 125 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/city/plan.js:98
src/core/noise.js:28 · src/core/noise.js:57 — the two spans are one implementation copied and then locally edited — 164 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/core/noise.js:28
src/modules/birds.js:85 · src/props/urn.js:301 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/modules/birds.js:85
src/modules/clouds.js:156 · src/modules/clouds.js:201 — 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. — src/modules/clouds.js:156
src/props/brazier.js:66 · src/props/urn.js:37 · src/ruins/grass.js:29 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/brazier.js:66
src/sculpt/sdf.js:38 · src/vegetation/util.js:50 — the two spans are one implementation copied and then locally edited — 268 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/sculpt/sdf.js:38
src/terrain/voxel.js:314 · src/terrain/voxel.js:322 — the two spans are one implementation copied and then locally edited — 200 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/terrain/voxel.js:314
src/acropolis/geo.js:92 · src/city/geobuilder.js:78 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — src/acropolis/geo.js:92
src/props/banner.js:49 · src/terrain/farfield.js:41 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/banner.js:49
src/props/lamp.js:11 · src/props/urn.js:17 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/props/lamp.js:11
src/world/heightfield.js:509 · src/world/heightfield.js:623 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/world/heightfield.js:509
src/acropolis/buildings.js:222 · src/acropolis/buildings.js:277 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/acropolis/buildings.js:222
src/acropolis/geo.js:225 · src/sculpt/sdf.js:39 — the two spans are one implementation copied and then locally edited — 231 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/acropolis/geo.js:225
src/aqueducts/geom.js:126 · src/aqueducts/geom.js:136 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/aqueducts/geom.js:126
src/arch/acanthus.js:107 · src/arch/geom.js:239 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/arch/acanthus.js:107
src/arch/acanthus.js:155 · src/arch/orders.js:191 — the two spans are one implementation copied and then locally edited — 100 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/arch/acanthus.js:155
src/arch/geom.js:216 · src/arch/geom.js:326 — 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. — src/arch/geom.js:216
src/city/fleet.js:271 · src/props/urn.js:300 · src/ruins/ivy.js:219 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/city/fleet.js:271
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
scatterWorld has cyclomatic complexity 273 and cognitive complexity 746; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/vegetation/scatter.js:47
buildChain has cyclomatic complexity 206 and cognitive complexity 491; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/walls.js:112
generateFarGrid has cyclomatic complexity 157 and cognitive complexity 233; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/terrain/farfield.js:102
mkVol has cyclomatic complexity 131 and cognitive complexity 153; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/city/buildings.js:120
buildHouse has cyclomatic complexity 128 and cognitive complexity 239; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/city/buildings.js:50
build has cyclomatic complexity 117 and cognitive complexity 152; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/modules/acropolis.js:45
meshChunk has cyclomatic complexity 114 and cognitive complexity 344; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/terrain/voxel.js:19
buildStructure has cyclomatic complexity 102 and cognitive complexity 282; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/aqueducts/arcade.js:57
peripteralTemple has cyclomatic complexity 97 and cognitive complexity 146; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/arch/temple.js:267
scatterCover has cyclomatic complexity 89 and cognitive complexity 169; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/modules/flora.js:135
makeFigure has cyclomatic complexity 80 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/sculpt/figure.js:159
buildEastGarden has cyclomatic complexity 77 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/garden.js:33
build has cyclomatic complexity 71 and cognitive complexity 115; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/modules/city.js:122
build has cyclomatic complexity 70 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/modules/waterfalls.js:57
buildTerraceHouses has cyclomatic complexity 69 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/houses.js:268
buildHouse has cyclomatic complexity 68 and cognitive complexity 129; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/houses.js:122
buildBridgeDeck has cyclomatic complexity 61 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/aqueducts/arcade.js:562
doricRun has cyclomatic complexity 61 and cognitive complexity 103; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/arch/entablature.js:66
compute has cyclomatic complexity 60 and cognitive complexity 153; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/arch/ao.js:69
buildPodium has cyclomatic complexity 59 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/podium.js:41
buildHarbour has cyclomatic complexity 58 and cognitive complexity 129; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/city/harbour.js:113
traceStream has cyclomatic complexity 55 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/water/trace.js:67
gateTower has cyclomatic complexity 55 and cognitive complexity 111; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/arch/elements.js:222
buildBastion has cyclomatic complexity 54 and cognitive complexity 127; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/plaza.js:137
buildTree has cyclomatic complexity 52 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/vegetation/trees.js:49
wallRun has cyclomatic complexity 51 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/masonry.js:35
buildFlowMap has cyclomatic complexity 51 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/water/flow.js:53
emblem has cyclomatic complexity 51 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/sculpt/props.js:47
placePortFleet has cyclomatic complexity 51 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/city/fleet.js:153
placeFleet has cyclomatic complexity 50 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/city/fleet.js:24
prostyleTemple has cyclomatic complexity 50 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/arch/temple.js:456
buildPlatform has cyclomatic complexity 49 and cognitive complexity 98; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/acropolis/buildings.js:70
scatterBoulders has cyclomatic complexity 49 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/terrain/boulders.js:41
tholos has cyclomatic complexity 48 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/arch/tholos.js:19
buildAqueductTop has cyclomatic complexity 47 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/aqueducts/arcade.js:346
buildShip has cyclomatic complexity 47 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/city/ships.js:150
headSDF has cyclomatic complexity 45 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/sculpt/head.js:274
createRock has cyclomatic complexity 45 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/materials/stone.js:374
buildSheet has cyclomatic complexity 43 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/water/fallMesh.js:126
place has cyclomatic complexity 43 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/vegetation/scatter.js:212
Do you agree with this assessment?
R3 · Large Files3.0 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
src/world/heightfield.js has 826 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/world/heightfield.js:1
src/modules/flora.js has 792 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/flora.js:1
src/modules/statues.js has 738 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/statues.js:1
src/aqueducts/arcade.js has 735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/aqueducts/arcade.js:1
src/sculpt/figure.js has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/sculpt/figure.js:1
src/core/pipeline.js has 701 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/pipeline.js:1
src/vegetation/scatter.js has 694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/vegetation/scatter.js:1
src/modules/clouds.js has 611 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/clouds.js:1
src/city/house.js has 603 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/city/house.js:1
src/city/landmarks.js has 586 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/city/landmarks.js:1
src/water/surface.js has 586 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/water/surface.js:1
src/sculpt/head.js has 572 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/sculpt/head.js:1
src/modules/waterfalls.js has 552 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/waterfalls.js:1
src/acropolis/walls.js has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/acropolis/walls.js:1
src/props/owl.js has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/props/owl.js:1
src/water/fallMesh.js has 529 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/water/fallMesh.js:1
src/arch/temple.js has 524 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/arch/temple.js:1
src/acropolis/stair.js has 504 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/acropolis/stair.js:1
src/materials/stone.js has 497 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/materials/stone.js:1
src/modules/city.js has 491 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/city.js:1
src/terrain/material.js has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/terrain/material.js:1
src/arch/geom.js has 478 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/arch/geom.js:1
src/vegetation/atlas.js has 466 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/vegetation/atlas.js:1
src/props/banner.js has 460 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/props/banner.js:1
src/city/buildings.js has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/city/buildings.js:1
src/core/sky.js has 455 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/sky.js:1
src/arch/entablature.js has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/arch/entablature.js:1
src/modules/temple.js has 450 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/temple.js:1
src/modules/ruins.js has 425 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/ruins.js:1
src/modules/acropolis.js has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/modules/acropolis.js:1
src/props/urn.js has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/props/urn.js:1
src/sculpt/props.js has 402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/sculpt/props.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.2 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×14) — src/core/engine.js:1, src/ruins/headpreview.mjs:1, src/main.js:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling0.0 / 10Critical✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✗ · lint ✗ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add a test runner (vitest / jest / playwright) and eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code7.9 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 15 application, 0 tooling and 1 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
no import path from any entry point (15 application, 0 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×4) — src/terrain/preview.mjs, src/bake/terrain.js, src/bake/head.js, …
no import path from any entry point (15 application, 0 tooling, 1 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/bake/terrain.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/terrain/nodeworker.mjs
Nothing imports this binding — it is safe to review for removal. (×34) — src/acropolis/geo.js:226, src/acropolis/geo.js:235, src/acropolis/geo.js:291, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
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.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. 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 `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. 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 question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`buildTerrain` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/modules/terrain.js:20
`loadOrBuild` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/core/cache.js:63
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`makeGarment` accepts `ctx.fem` from the caller and keeps it in `fem` on line 458, where only it can read the value — but nothing ever reads `fem`. Setting `ctx.fem` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `fem` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `ctx.fem` from the accepted options so callers stop setting a knob that does nothing. — src/sculpt/figure.js:458
`makeGarment` accepts `ctx.trunk` from the caller and keeps it in `trunk` on line 458, where only it can read the value — but nothing ever reads `trunk`. Setting `ctx.trunk` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `trunk` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `ctx.trunk` from the accepted options so callers stop setting a knob that does nothing. — src/sculpt/figure.js:458
`makeGarment` accepts `ctx.shR` from the caller and keeps it in `shR` on line 458, where only it can read the value — but nothing ever reads `shR`. Setting `ctx.shR` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `shR` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `ctx.shR` from the accepted options so callers stop setting a knob that does nothing. — src/sculpt/figure.js:458
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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.
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — src/main.js:105
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×8) — src/terrain/far.js:29, src/modules/banners.js:134, src/modules/banners.js:138, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
Unscored — 1 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.
X10 Duplicated predicate — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 73 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 — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
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.
AX2 Stateful singletons — Not applicable: 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
AX6 Interface segregation — not applicable — JavaScript has no interface declaration, so there is no declared member list whose width this check could measure
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run serve`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> athenaion@0.1.0 serve / > node REDACTED / Serving <repo> at http://localhost:8080/" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. 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, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend 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, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
D10 Test Quality — No tests were found in the analyzed repository to assess for quality.
D11 Test Reliability — No test suite was found to re-run, so reliability couldn't be assessed. Two searches produced that zero and both came back empty: the classifier that reads the loaded workspace recognised no suite it could run, and a walk of the source on disk — which covers the JS/TS `*.test.*` and `*.spec.*` conventions and probes for a Pester suite — found no test source in any other ecosystem either. Neither search reaches a suite that is missing from the loaded workspace and carries no name either walk recognises, so this is 'no suite found by those two searches', not a verdict that the repository has none.
D16 Bus Factor — single-contributor repository — bus factor is not applicable
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. 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.
D20 ADR Quality — Repository kind not determined
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 6 candidate(s) found and not reported.
D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
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"]`.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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.
D34 Knowledge Freshness — too few commits to judge knowledge freshness
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
D5 Coupling — Not applicable — this npm build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
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
D8 Code Coverage — Coverage not measured
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
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
P12 CI test-gate honesty — no CI workflow found
P2 Observability — This repository's JavaScript/TypeScript source (1 module(s), 171 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript 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 not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, 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.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — Not assessed: 171 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation, obsolete TLS versions, passwords stored or checked as plaintext and session cookies set without HttpOnly, Secure or SameSite, and none was found. That half of the dimension is clean, but it is not scored on its own: a C# repository with the same clean reading is scored on its server controls as well, or is N/A for having no web surface, and neither can be decided here. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X13 Undrained process stream — 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
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
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
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
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
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 applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Plain JavaScript carries no type annotations and commits no tsconfig, so it states no null-typed discipline for this check to grade: there is nothing here that switches null checking on or off, and TypeScript (or `// @ts-check`) is how a repository acquires one — advice, not a defect this card measures. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
FunctionTooLong: scatter.scatterWorld src/vegetation/scatter.js:47— FunctionTooLong — scatterWorld runs 486 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 386 over it, 4.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buildings.buildHouse src/city/buildings.js:50— FunctionTooLong — buildHouse runs 316 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 216 over it, 3.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: acropolis.build src/modules/acropolis.js:45— FunctionTooLong — build runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cypress.buildCypress src/vegetation/cypress.js:43— FunctionTooLong — buildCypress runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: walls.buildChain src/acropolis/walls.js:112— FunctionTooLong — buildChain runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: figure.makeFigure src/sculpt/figure.js:159— FunctionTooLong — makeFigure runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: voxel.meshChunk src/terrain/voxel.js:19— FunctionTooLong — meshChunk runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: farfield.generateFarGrid src/terrain/farfield.js:102— FunctionTooLong — generateFarGrid runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: figure.makeGarment src/sculpt/figure.js:457— FunctionTooLong — makeGarment runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: trees.buildTree src/vegetation/trees.js:49— FunctionTooLong — buildTree runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: shot2.buildShot2 src/sets/shot2.js:18— FunctionTooLong — buildShot2 runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: waterfalls.build src/modules/waterfalls.js:57— FunctionTooLong — build runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ruins.buildHeadSet src/modules/ruins.js:119— FunctionTooLong — buildHeadSet runs 175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: harbour.buildHarbour src/city/harbour.js:113— FunctionTooLong — buildHarbour runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: city.build src/modules/city.js:122— FunctionTooLong — build runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: arcade.buildStructure src/aqueducts/arcade.js:57— FunctionTooLong — buildStructure runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: flow.buildFlowMap src/water/flow.js:53— FunctionTooLong — buildFlowMap runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tholos.tholos src/arch/tholos.js:19— FunctionTooLong — tholos runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: temple.build src/modules/temple.js:199— FunctionTooLong — build runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: garden.buildEastGarden src/acropolis/garden.js:33— FunctionTooLong — buildEastGarden runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: portico.buildPortico src/ruins/portico.js:65— FunctionTooLong — buildPortico runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: temple.peripteralTemple src/arch/temple.js:267— FunctionTooLong — peripteralTemple runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: plaza.buildBastion src/acropolis/plaza.js:137— FunctionTooLong — buildBastion runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: waterfalls.addMist src/modules/waterfalls.js:300— FunctionTooLong — addMist runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: podium.buildPodium src/acropolis/podium.js:41— FunctionTooLong — buildPodium runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
+ 14 more in this group — see findings.md.
IC1 · Incompleteness & stubs· Both branches are identical · ×17
Both branches are identical — the condition decides nothing src/acropolis/stair.js:357— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/arch/entablature.js:163— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/arch/ornament.js:206— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/arch/temple.js:447— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/city/landmarks.js:55— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/flora/rocks.js:138— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/modules/birds.js:46— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/modules/statues.js:623— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/bannerArt.js:119— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/bannerArt.js:318— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/brazier.js:173— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/brazier.js:201— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/owl.js:161— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/owl.js:267— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/props/owl.js:358— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/sculpt/bakeutil.js:97— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing src/sculpt/figure.js:466— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
R4 · Test Coverage· No test reaches this file · ×14
No test reaches this file src/core/engine.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/ruins/headpreview.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/main.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/terrain/preview.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/bake/terrain.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/video/sequence.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/core/footprints.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/video/player.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/world/index.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/terrain/viz.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/bake/head.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/core/quality.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/bake/statues.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/terrain/nodeworker.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Sync-over-async blocking src/bake/head.js:15— `fs.existsSync` in `bake` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/bake/head.js:25— `fs.readdirSync` in `bake` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/bake/head.js:25— `fs.unlinkSync` in `bake` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:38— `fs.openSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:38— `fs.writeSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:38— `fs.closeSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:42— `fs.readFileSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:42— `fs.rmSync` in `acquire` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:100— `fs.mkdirSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:101— `fs.writeFileSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:104— `fs.existsSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking tools/session.mjs:106— `execFileSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Swallowed exception (empty catch) src/main.js:105— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/terrain/far.js:29— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/modules/banners.js:134— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/modules/banners.js:138— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/modules/terrain.js:40— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/core/cache.js:68— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/core/lighting.js:146— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/acropolis/buildings.js:173— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/acropolis/materials.js:376— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
FileTooLong: modules/flora.js src/modules/flora.js— FileTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 134 over it, 1.27× 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: modules/statues.js src/modules/statues.js— FileTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 88 over it, 1.18× 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: world/heightfield.js src/world/heightfield.js— FileTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 85 over it, 1.17× 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: core/pipeline.js src/core/pipeline.js— FileTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 65% of them inside a single declaration: Pipeline (145-591). The bar is 500 significant lines; this is 59 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: aqueducts/arcade.js src/aqueducts/arcade.js— FileTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 56 over it, 1.11× 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: sculpt/figure.js src/sculpt/figure.js— FileTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 53 over it, 1.11× 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: vegetation/scatter.js src/vegetation/scatter.js— FileTooLong — 513 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 95% of them inside a single declaration: scatterWorld (47-715). The bar is 500 significant lines; this is 13 over it, 1.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
R10 · Code Duplication· Duplicated block with local edits (8 matched lines × 2 locations) · ×5
Duplicated block with local edits (8 matched lines × 2 locations) src/city/harbour.js:280— src/city/harbour.js:280 · src/city/harbour.js:292 — the two spans are one implementation copied and then locally edited — 127 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (8 matched lines × 2 locations) src/city/plan.js:98— src/city/plan.js:98 · src/city/plan.js:110 — the two spans are one implementation copied and then locally edited — 125 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (8 matched lines × 2 locations) src/core/noise.js:28— src/core/noise.js:28 · src/core/noise.js:57 — the two spans are one implementation copied and then locally edited — 164 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (8 matched lines × 2 locations) src/sculpt/sdf.js:38— src/sculpt/sdf.js:38 · src/vegetation/util.js:50 — the two spans are one implementation copied and then locally edited — 268 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (8 matched lines × 2 locations) src/terrain/voxel.js:314— src/terrain/voxel.js:314 · src/terrain/voxel.js:322 — the two spans are one implementation copied and then locally edited — 200 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (7 lines × 2 locations) src/acropolis/geo.js:92— src/acropolis/geo.js:92 · src/city/geobuilder.js:78 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (7 lines × 2 locations) src/props/banner.js:49— src/props/banner.js:49 · src/terrain/farfield.js:41 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) src/props/lamp.js:11— src/props/lamp.js:11 · src/props/urn.js:17 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) src/world/heightfield.js:509— src/world/heightfield.js:509 · src/world/heightfield.js:623 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) src/acropolis/buildings.js:222— src/acropolis/buildings.js:222 · src/acropolis/buildings.js:277 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) src/aqueducts/geom.js:126— src/aqueducts/geom.js:126 · src/aqueducts/geom.js:136 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) src/arch/acanthus.js:107— src/arch/acanthus.js:107 · src/arch/geom.js:239 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) src/arch/geom.js:216— src/arch/geom.js:216 · src/arch/geom.js:326 — 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.
Fake-async — async method never awaits src/modules/aqueducts.js:117— `build` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/modules/clouds.js:537— `build` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/modules/sets.js:24— `build` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Duplicated block (9 lines × 2 locations) src/core/sky.js:342— src/core/sky.js:342 · src/water/mist.js:254 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) src/flora/heroes.js:100— src/flora/heroes.js:100 · src/modules/ruins.js:373 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) src/props/brazier.js:321— src/props/brazier.js:321 · src/props/urn.js:395 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X25 · Inert configuration knob· Option is kept and never read · ×3
Option is kept and never read src/sculpt/figure.js:458— `makeGarment` accepts `ctx.fem` from the caller and keeps it in `fem` on line 458, where only it can read the value — but nothing ever reads `fem`. Setting `ctx.fem` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `fem` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `ctx.fem` from the accepted options so callers stop setting a knob that does nothing.
Option is kept and never read src/sculpt/figure.js:458— `makeGarment` accepts `ctx.trunk` from the caller and keeps it in `trunk` on line 458, where only it can read the value — but nothing ever reads `trunk`. Setting `ctx.trunk` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `trunk` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `ctx.trunk` from the accepted options so callers stop setting a knob that does nothing.
Option is kept and never read src/sculpt/figure.js:458— `makeGarment` accepts `ctx.shR` from the caller and keeps it in `shR` on line 458, where only it can read the value — but nothing ever reads `shR`. Setting `ctx.shR` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `shR` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `ctx.shR` from the accepted options so callers stop setting a knob that does nothing.
scatterWorld::place (cyclomatic 43) src/vegetation/scatter.js:212— scatterWorld::place has cyclomatic complexity 43 (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.
scatterWorld::hero (cyclomatic 19) src/vegetation/scatter.js:266— scatterWorld::hero 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.
growOlive::grow (cyclomatic 33) src/flora/olive.js:115— growOlive::grow 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.
growOlive::leavesAlong (cyclomatic 24) src/flora/olive.js:188— growOlive::leavesAlong 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.
build (cyclomatic 30) src/modules/banners.js:65— build has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build (cyclomatic 30) src/props/brazier.js:262— build has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to 6 function items inside it that branch. 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.
growOlive::grow (cognitive 61) src/flora/olive.js:115— growOlive::grow has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (39 pts), ternaries 3 (9 pts), boolean chains 7, loops 3 (5 pts), other 1 (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.
growOlive::leavesAlong (cognitive 52) src/flora/olive.js:188— growOlive::leavesAlong has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 6 (18 pts), loops 5 (8 pts), boolean chains 2, other 2 (nesting depth added 28). 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.
buildColossusBastion::face (cognitive 46) src/acropolis/bastion.js:141— buildColossusBastion::face has cognitive complexity 46 (threshold 15). Drivers by points: loops 7 (16 pts), ternaries 4 (15 pts), if/else 6 (8 pts), boolean chains 7 (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.
buildColossusBastion::face (cognitive 17) src/acropolis/bastion.js:100— buildColossusBastion::face has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 7). 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.
scatterWorld::place (cognitive 43) src/vegetation/scatter.js:212— scatterWorld::place has cognitive complexity 43 (threshold 15). Drivers by points: other 13, if/else 12, boolean chains 9, ternaries 7 (9 pts) (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.
scatterWorld::hero (cognitive 26) src/vegetation/scatter.js:266— scatterWorld::hero has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), other 5, boolean chains 4, loops 1, ternaries 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.
scatter.scatterWorld::excluded (cognitive 20) src/vegetation/scatter.js:87— scatter.scatterWorld::excluded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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. This shape REPEATS in the file: one other method here (scatter.scatterWorld::blocksShots) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
scatter.scatterWorld::blocksShots (cognitive 20) src/vegetation/scatter.js:153— scatter.scatterWorld::blocksShots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, 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. This shape REPEATS in the file: one other method here (scatter.scatterWorld::excluded) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MethodTooLong: Pipeline.constructor src/core/pipeline.js:146— MethodTooLong — constructor runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BannerSet.build src/props/banner.js:310— MethodTooLong — build runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
R10 · Code Duplication· Duplicated block with local edits (12 matched lines × 2 locations) · ×2
Duplicated block with local edits (12 matched lines × 2 locations) src/acropolis/geo.js:103— src/acropolis/geo.js:103 · src/arch/geom.js:117 — the two spans are one implementation copied and then locally edited — 147 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (12 matched lines × 2 locations) tools/render-video.mjs:43— tools/render-video.mjs:43 · tools/session.mjs:30 — the two spans are one implementation copied and then locally edited — 197 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (12 lines × 2 locations) src/modules/statues.js:667— src/modules/statues.js:667 · src/modules/statues.js:696 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) src/ruins/sdf.js:72— src/ruins/sdf.js:72 · src/sculpt/bakeutil.js:73 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (10 lines × 2 locations) src/core/pipeline.js:171— src/core/pipeline.js:171 · src/core/pipeline.js:219 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (10 lines × 2 locations) src/props/brazier.js:113— src/props/brazier.js:113 · src/props/urn.js:61 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) src/modules/birds.js:85— src/modules/birds.js:85 · src/props/urn.js:301 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) src/modules/clouds.js:156— src/modules/clouds.js:156 · src/modules/clouds.js:201 — 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.
R10 · Code Duplication· Duplicated block with local edits (6 matched lines × 2 locations) · ×2
Duplicated block with local edits (6 matched lines × 2 locations) src/acropolis/geo.js:225— src/acropolis/geo.js:225 · src/sculpt/sdf.js:39 — the two spans are one implementation copied and then locally edited — 231 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (6 matched lines × 2 locations) src/arch/acanthus.js:155— src/arch/acanthus.js:155 · src/arch/orders.js:191 — the two spans are one implementation copied and then locally edited — 100 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
X2 · Cancellation propagation· Async function without AbortSignal · ×2
Async function without AbortSignal: buildTerrain src/modules/terrain.js:20— `buildTerrain` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: loadOrBuild src/core/cache.js:63— `loadOrBuild` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
scatterWorld (cyclomatic 273) src/vegetation/scatter.js:47— scatterWorld has cyclomatic complexity 273 (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.
buildChain (cyclomatic 208) src/acropolis/walls.js:112— buildChain has cyclomatic complexity 208 (threshold 15). Of this number, 206 points are the body's own statements and 2 belong to 15 function items inside it that branch. 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.
build (cyclomatic 191) src/modules/acropolis.js:45— build has cyclomatic complexity 191 (threshold 15). Of this number, 117 points are the body's own statements and 74 belong to 57 function items inside it that branch. 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.
generateFarGrid (cyclomatic 157) src/terrain/farfield.js:102— generateFarGrid has cyclomatic complexity 157 (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.
buildHouse::mkVol (cyclomatic 131) src/city/buildings.js:120— buildHouse::mkVol has cyclomatic complexity 131 (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.
buildings.buildHouse (cyclomatic 128) src/city/buildings.js:50— buildings.buildHouse has cyclomatic complexity 128 (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.
meshChunk (cyclomatic 114) src/terrain/voxel.js:19— meshChunk has cyclomatic complexity 114 (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.
buildStructure (cyclomatic 106) src/aqueducts/arcade.js:57— buildStructure has cyclomatic complexity 106 (threshold 15). Of this number, 102 points are the body's own statements and 4 belong to 9 function items inside it that branch. 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.
peripteralTemple (cyclomatic 97) src/arch/temple.js:267— peripteralTemple has cyclomatic complexity 97 (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.
build (cyclomatic 95) src/modules/waterfalls.js:57— build has cyclomatic complexity 95 (threshold 15). Of this number, 70 points are the body's own statements and 25 belong to 25 function items inside it that branch. 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.
trees.buildTree (cyclomatic 93) src/vegetation/trees.js:49— trees.buildTree has cyclomatic complexity 93 (threshold 15). Of this number, 52 points are the body's own statements and 41 belong to 7 function items inside it that branch. 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.
scatterCover (cyclomatic 91) src/modules/flora.js:135— scatterCover has cyclomatic complexity 91 (threshold 15). Of this number, 89 points are the body's own statements and 2 belong to 5 function literals inside it that branch. 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.
buildEastGarden (cyclomatic 89) src/acropolis/garden.js:33— buildEastGarden has cyclomatic complexity 89 (threshold 15). Of this number, 77 points are the body's own statements and 12 belong to 11 function items inside it that branch. 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.
makeFigure (cyclomatic 80) src/sculpt/figure.js:159— makeFigure has cyclomatic complexity 80 (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.
build (cyclomatic 76) src/modules/city.js:122— build has cyclomatic complexity 76 (threshold 15). Of this number, 71 points are the body's own statements and 5 belong to 24 function items inside it that branch. 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.
houses.buildHouse (cyclomatic 69) src/acropolis/houses.js:122— houses.buildHouse has cyclomatic complexity 69 (threshold 15). Of this number, 68 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
buildTerraceHouses (cyclomatic 69) src/acropolis/houses.js:268— buildTerraceHouses 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.
buildCypress (cyclomatic 68) src/vegetation/cypress.js:43— buildCypress has cyclomatic complexity 68 (threshold 15). Of this number, 17 points are the body's own statements and 51 belong to 30 function items inside it that branch. 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.
placePortFleet (cyclomatic 67) src/city/fleet.js:153— placePortFleet has cyclomatic complexity 67 (threshold 15). Of this number, 51 points are the body's own statements and 16 belong to 6 function items inside it that branch. 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.
arcade.buildBridgeDeck (cyclomatic 64) src/aqueducts/arcade.js:562— arcade.buildBridgeDeck has cyclomatic complexity 64 (threshold 15). Of this number, 61 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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.
doricRun (cyclomatic 62) src/arch/entablature.js:66— doricRun has cyclomatic complexity 62 (threshold 15). Of this number, 61 points are the body's own statements and 1 belongs to 4 function items inside it that branch. 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.
placeFleet (cyclomatic 61) src/city/fleet.js:24— placeFleet has cyclomatic complexity 61 (threshold 15). Of this number, 50 points are the body's own statements and 11 belong to 7 function items inside it that branch. 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.
compute (cyclomatic 60) src/arch/ao.js:69— compute has cyclomatic complexity 60 (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.
bastion.buildColossusBastion (cyclomatic 59) src/acropolis/bastion.js:38— bastion.buildColossusBastion has cyclomatic complexity 59 (threshold 15). Of this number, 24 points are the body's own statements and 35 belong to 2 function literals inside it that branch. 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.
buildPodium (cyclomatic 59) src/acropolis/podium.js:41— buildPodium has cyclomatic complexity 59 (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.
buildHarbour (cyclomatic 58) src/city/harbour.js:113— buildHarbour has cyclomatic complexity 58 (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.
gateTower (cyclomatic 56) src/arch/elements.js:222— gateTower has cyclomatic complexity 56 (threshold 15). Of this number, 55 points are the body's own statements and 1 belongs to 2 function items inside it that branch. 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.
meshSDF (cyclomatic 56) src/sculpt/mesher.js:15— meshSDF has cyclomatic complexity 56 (threshold 15). Of this number, 42 points are the body's own statements and 14 belong to 5 function items inside it that branch. 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.
traceStream (cyclomatic 56) src/water/trace.js:67— traceStream has cyclomatic complexity 56 (threshold 15). Of this number, 55 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
flow.buildFlowMap (cyclomatic 55) src/water/flow.js:53— flow.buildFlowMap has cyclomatic complexity 55 (threshold 15). Of this number, 51 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
buildBastion (cyclomatic 55) src/acropolis/plaza.js:137— buildBastion has cyclomatic complexity 55 (threshold 15). Of this number, 54 points are the body's own statements and 1 belongs to 5 function items inside it that branch. 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.
props.emblem (cyclomatic 54) src/sculpt/props.js:47— props.emblem has cyclomatic complexity 54 (threshold 15). Of this number, 51 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
wallRun (cyclomatic 53) src/acropolis/masonry.js:35— wallRun has cyclomatic complexity 53 (threshold 15). Of this number, 51 points are the body's own statements and 2 belong to 5 function items inside it that branch. 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.
createRock (cyclomatic 52) src/materials/stone.js:374— createRock has cyclomatic complexity 52 (threshold 15). Of this number, 45 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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.
arcade.buildAqueductTop (cyclomatic 51) src/aqueducts/arcade.js:346— arcade.buildAqueductTop has cyclomatic complexity 51 (threshold 15). Of this number, 49 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
prostyleTemple (cyclomatic 51) src/arch/temple.js:456— prostyleTemple has cyclomatic complexity 51 (threshold 15). Of this number, 50 points are the body's own statements and 1 belongs to 6 function literals inside it that branch. 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.
ruins.buildHeadSet (cyclomatic 50) src/modules/ruins.js:119— ruins.buildHeadSet has cyclomatic complexity 50 (threshold 15). Of this number, 24 points are the body's own statements and 26 belong to 8 function items inside it that branch. 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.
tholos (cyclomatic 50) src/arch/tholos.js:19— tholos has cyclomatic complexity 50 (threshold 15). Of this number, 48 points are the body's own statements and 2 belong to 16 function items inside it that branch. 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.
build (cyclomatic 50) src/modules/temple.js:199— build has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 5 of the 50 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 342, a function literal at line 321, a function literal at line 247, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
scatterBoulders (cyclomatic 50) src/terrain/boulders.js:41— scatterBoulders has cyclomatic complexity 50 (threshold 15). Of this number, 49 points are the body's own statements and 1 belongs to 2 function items inside it that branch. 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.
buildPlatform (cyclomatic 49) src/acropolis/buildings.js:70— buildPlatform has cyclomatic complexity 49 (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.
edgeIvySlots (cyclomatic 48) src/modules/flora.js:326— edgeIvySlots has cyclomatic complexity 48 (threshold 15). Of this number, 40 points are the body's own statements and 8 belong to 5 function items inside it that branch. 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.
buildShip (cyclomatic 47) src/city/ships.js:150— buildShip has cyclomatic complexity 47 (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.
head.headSDF (cyclomatic 45) src/sculpt/head.js:274— head.headSDF 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.
lots.makeLots (cyclomatic 45) src/city/lots.js:57— lots.makeLots has cyclomatic complexity 45 (threshold 15). Of this number, 42 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
headpreview.renderView (cyclomatic 43) src/ruins/headpreview.mjs:33— headpreview.renderView has cyclomatic complexity 43 (threshold 15). Of this number, 41 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
rockCluster (cyclomatic 43) src/flora/rocks.js:62— rockCluster has cyclomatic complexity 43 (threshold 15). Of this number, 35 points are the body's own statements and 8 belong to 4 function items inside it that branch. 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.
buildSheet (cyclomatic 43) src/water/fallMesh.js:126— buildSheet has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buildLanding (cyclomatic 42) src/acropolis/stair.js:256— buildLanding 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.
pediment (cyclomatic 42) src/arch/entablature.js:251— pediment 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.
geo.chamferBox (cyclomatic 40) src/acropolis/geo.js:241— geo.chamferBox has cyclomatic complexity 40 (threshold 15). Of this number, 32 points are the body's own statements and 8 belong to 4 function items inside it that branch. 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.
stair.buildFlight (cyclomatic 40) src/acropolis/stair.js:162— stair.buildFlight has cyclomatic complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
landmarks.placeLandmarks (cyclomatic 39) src/city/landmarks.js:336— landmarks.placeLandmarks has cyclomatic complexity 39 (threshold 15). Of this number, 20 points are the body's own statements and 19 belong to 12 function items inside it that branch. 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.
stoa (cyclomatic 39) src/arch/elements.js:132— stoa has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 belong to 6 function items inside it that branch. 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.
site.contours (cyclomatic 38) src/acropolis/site.js:28— site.contours has cyclomatic complexity 38 (threshold 15). Of this number, 29 points are the body's own statements and 9 belong to 4 function items inside it that branch. 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.
build (cyclomatic 38) src/props/banner.js:310— build has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
shaftSegment (cyclomatic 37) src/arch/ruins.js:47— shaftSegment has cyclomatic complexity 37 (threshold 15). Of this number, 17 points are the body's own statements and 20 belong to 10 function items inside it that branch. 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.
build (cyclomatic 37) src/modules/water.js:29— build has cyclomatic complexity 37 (threshold 15). Of this number, 24 points are the body's own statements and 13 belong to 9 function items inside it that branch. 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.
growIvy (cyclomatic 37) src/ruins/ivy.js:124— growIvy has cyclomatic complexity 37 (threshold 15). Of this number, 32 points are the body's own statements and 5 belong to 3 function items inside it that branch. 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.
buildPodiumAndPaving (cyclomatic 37) src/ruins/portico.js:270— buildPodiumAndPaving has cyclomatic complexity 37 (threshold 15). Of this number, 30 points are the body's own statements and 7 belong to 4 function items inside it that branch. 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.
stair.buildStair (cyclomatic 36) src/acropolis/stair.js:89— stair.buildStair has cyclomatic complexity 36 (threshold 15). Of this number, 34 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
crepidoma (cyclomatic 36) src/arch/temple.js:93— crepidoma has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. 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.
shieldGeometry (cyclomatic 36) src/sculpt/props.js:179— shieldGeometry 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.
sweep (cyclomatic 35) src/arch/geom.js:302— sweep has cyclomatic complexity 35 (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.
bankTerraces (cyclomatic 35) src/city/port.js:103— bankTerraces has cyclomatic complexity 35 (threshold 15). Of this number, 30 points are the body's own statements and 5 belong to 4 function items inside it that branch. 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.
lod.planChunks::reqCell (cyclomatic 34) src/terrain/lod.js:55— lod.planChunks::reqCell has cyclomatic complexity 34 (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.
waterfalls.addMist (cyclomatic 34) src/modules/waterfalls.js:300— waterfalls.addMist has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
statues.build (cyclomatic 34) src/modules/statues.js:543— statues.build has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
corinthianCapital (cyclomatic 34) src/arch/acanthus.js:191— corinthianCapital has cyclomatic complexity 34 (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.
droplets (cyclomatic 33) src/terrain/erosion.js:153— droplets 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.
clouds.build (cyclomatic 32) src/modules/clouds.js:537— clouds.build has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 557, 556). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
islandBridge (cyclomatic 32) src/acropolis/bridge.js:17— islandBridge has cyclomatic complexity 32 (threshold 15). Of this number, 26 points are the body's own statements and 6 belong to 13 function items inside it that branch. 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.
flutedShaft (cyclomatic 32) src/arch/orders.js:33— flutedShaft has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 belong to 5 function items inside it that branch. 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.
birds.gullGeometry (cyclomatic 31) src/modules/birds.js:9— birds.gullGeometry has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
buildTerraceBuildings (cyclomatic 31) src/acropolis/buildings.js:167— buildTerraceBuildings has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body's own statements and 7 belong to one function item inside it that branches. 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.
ionicRun (cyclomatic 31) src/arch/entablature.js:183— ionicRun has cyclomatic complexity 31 (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.
parseSpill (cyclomatic 31) src/modules/waterfalls.js:26— parseSpill 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.
ruinStoneMaterial (cyclomatic 31) src/ruins/materials.js:284— ruinStoneMaterial has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to one function literal inside it that branches (line 286). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
buildShot2 (cyclomatic 31) src/sets/shot2.js:18— buildShot2 has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 9 function items inside it that branch. 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.
rapids.planCascade (cyclomatic 30) src/water/rapids.js:181— rapids.planCascade has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 belong to 2 function literals inside it that branch. 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.
temple (cyclomatic 30) src/city/landmarks.js:41— temple has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rapids.buildRapidsRocks (cyclomatic 29) src/water/rapids.js:18— rapids.buildRapidsRocks 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.
atlas.buildTexture (cyclomatic 29) src/vegetation/atlas.js:225— atlas.buildTexture has cyclomatic complexity 29 (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.
buildPrecinctBuildings (cyclomatic 29) src/acropolis/buildings.js:235— buildPrecinctBuildings 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.
planWallLine (cyclomatic 29) src/acropolis/walls.js:45— planWallLine has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
finalize (cyclomatic 29) src/arch/build.js:46— finalize has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 22 function items inside it that branch. 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.
box (cyclomatic 29) src/arch/geom.js:137— box 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.
buildIvy (cyclomatic 29) src/modules/flora.js:494— buildIvy has cyclomatic complexity 29 (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.
placeStatues (cyclomatic 29) src/modules/statues.js:386— placeStatues has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 6 function literals inside it that branch. 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.
ribbon (cyclomatic 29) src/water/fallMesh.js:34— ribbon 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.
leaf (cyclomatic 28) src/arch/acanthus.js:16— leaf has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 11 function items inside it that branch. 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.
buildColumn (cyclomatic 28) src/arch/orders.js:295— buildColumn has cyclomatic complexity 28 (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.
placeSculpture (cyclomatic 28) src/modules/statues.js:498— placeSculpture has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 4 function items inside it that branch. 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.
_update (cyclomatic 28) src/vegetation/instances.js:157— _update has cyclomatic complexity 28 (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.
traceFall (cyclomatic 28) src/water/trace.js:232— traceFall has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to 8 function literals inside it that branch. 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.
previewGrid (cyclomatic 28) src/terrain/preview.mjs:7— previewGrid has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 belong to 8 function items inside it that branch. 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.
podium.dressPrecinct (cyclomatic 27) src/acropolis/podium.js:342— podium.dressPrecinct has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
pediment.composePediment::layer (cyclomatic 27) src/sculpt/pediment.js:27— pediment.composePediment::layer 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.
temple.islandEnsemble (cyclomatic 27) src/modules/temple.js:71— temple.islandEnsemble has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
boot (cyclomatic 27) src/main.js:12— boot has cyclomatic complexity 27 (threshold 15). Of this number, 16 points are the body's own statements and 11 belong to 13 function items inside it that branch. 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.
tiledRoof (cyclomatic 27) src/arch/entablature.js:365— tiledRoof 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.
cella (cyclomatic 27) src/arch/temple.js:209— cella 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.
applyShot (cyclomatic 27) src/core/engine.js:152— applyShot has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
viewIvySlots (cyclomatic 27) src/modules/flora.js:451— viewIvySlots has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
buildColossusBastion::face (cyclomatic 26) src/acropolis/bastion.js:141— buildColossusBastion::face 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.
Pipeline.resolve (cyclomatic 25) src/core/pipeline.js:488— Pipeline.resolve 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.
buildHeroes (cyclomatic 25) src/modules/flora.js:542— buildHeroes has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
surface.surfaceMap (cyclomatic 24) src/flora/surface.js:38— surface.surfaceMap has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 57). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
statues.test (cyclomatic 24) src/modules/statues.js:610— statues.test has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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.
drawLaurelWreath (cyclomatic 24) src/props/owl.js:335— drawLaurelWreath 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.
portico.buildPortico (cyclomatic 23) src/ruins/portico.js:65— portico.buildPortico has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 2 function items inside it that branch. 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.
bannerArt.drawHeader (cyclomatic 23) src/props/bannerArt.js:165— bannerArt.drawHeader 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.
flora.columnIvySlots (cyclomatic 23) src/modules/flora.js:292— flora.columnIvySlots has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 299, 295). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
flora.build (cyclomatic 23) src/modules/flora.js:622— flora.build has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
util.addBlob (cyclomatic 23) src/vegetation/util.js:90— util.addBlob has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
viewSurface (cyclomatic 23) src/flora/surface.js:140— viewSurface has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 145, (anonymous)::onBeforeRender, a function literal at line 143, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
build (cyclomatic 23) src/props/urn.js:339— build has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 9 function items inside it that branch. 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.
drumSDF (cyclomatic 23) src/ruins/columns.js:31— drumSDF has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to one function literal inside it that branches. 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.
stair.parapet (cyclomatic 22) src/acropolis/stair.js:374— stair.parapet has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
pavePrecinct (cyclomatic 22) src/acropolis/podium.js:288— pavePrecinct has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stoneSDF (cyclomatic 22) src/ruins/stones.js:18— stoneSDF has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to one function literal inside it that branches. 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.
stair.stepSlab (cyclomatic 21) src/acropolis/stair.js:483— stair.stepSlab 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.
arcade.makeSpec (cyclomatic 21) src/aqueducts/arcade.js:12— arcade.makeSpec has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
field.protectFlat (cyclomatic 21) src/terrain/field.js:189— field.protectFlat has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
flora.cliffGreenery (cyclomatic 21) src/modules/flora.js:396— flora.cliffGreenery 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.
dressSheerFaces (cyclomatic 21) src/acropolis/cliffdress.js:118— dressSheerFaces has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 3 function items inside it that branch. 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.
buildGateTower (cyclomatic 21) src/aqueducts/arcade.js:706— buildGateTower 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.
pilasterSDF (cyclomatic 21) src/ruins/columns.js:174— pilasterSDF has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 185, (anonymous)::fl). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
arcade.buildArcade (cyclomatic 20) src/acropolis/arcade.js:87— arcade.buildArcade 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.
walls.isoLines (cyclomatic 20) src/city/walls.js:11— walls.isoLines 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.
heightmap.captureHeightMap (cyclomatic 20) src/water/heightmap.js:46— heightmap.captureHeightMap has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. 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.
rapids.planWeirs (cyclomatic 20) src/water/rapids.js:123— rapids.planWeirs has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
util.addTube (cyclomatic 20) src/vegetation/util.js:185— util.addTube 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.
lathe (cyclomatic 20) src/arch/geom.js:210— lathe has cyclomatic complexity 20 (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.
fillLots (cyclomatic 20) src/city/lots.js:158— fillLots 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.
streamPower (cyclomatic 20) src/terrain/erosion.js:93— streamPower 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.
statues.fallbackSlots (cyclomatic 19) src/modules/statues.js:341— statues.fallbackSlots 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.
buildArch (cyclomatic 19) src/acropolis/masonry.js:337— buildArch 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.
roof (cyclomatic 19) src/city/house.js:99— roof 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.
leafMaterial (cyclomatic 19) src/flora/foliage.js:75— leafMaterial has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
heightfield.acropolis (cyclomatic 18) src/world/heightfield.js:430— heightfield.acropolis 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.
heightfield.nearHeight (cyclomatic 18) src/world/heightfield.js:758— heightfield.nearHeight 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.
landmarks.findTheatreSite (cyclomatic 18) src/city/landmarks.js:574— landmarks.findTheatreSite 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.
atlas.drawTwig (cyclomatic 18) src/vegetation/atlas.js:123— atlas.drawTwig has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
city.streetStrip (cyclomatic 18) src/modules/city.js:73— city.streetStrip 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.
findSite (cyclomatic 18) src/acropolis/buildings.js:41— findSite 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.
ivyCurtain (cyclomatic 18) src/flora/ivy.js:63— ivyCurtain 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.
buildAll (cyclomatic 18) src/modules/aqueducts.js:38— buildAll has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. 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.
bannerFromSlot (cyclomatic 18) src/modules/banners.js:45— bannerFromSlot 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.
stairIvySlots (cyclomatic 18) src/modules/flora.js:254— stairIvySlots has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 3 function items inside it that branch. 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.
makeGarment.skirt (cyclomatic 18) src/sculpt/figure.js:471— makeGarment.skirt has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
house.figure (cyclomatic 17) src/city/house.js:499— house.figure has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
erosion.drainage (cyclomatic 17) src/terrain/erosion.js:37— erosion.drainage has cyclomatic complexity 17 (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.
pipeline.solveToneCurve (cyclomatic 17) src/core/pipeline.js:112— pipeline.solveToneCurve has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
textures.drawIvyLeaf (cyclomatic 17) src/flora/textures.js:45— textures.drawIvyLeaf has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
urn.plantAtlas (cyclomatic 17) src/props/urn.js:123— urn.plantAtlas has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
banners.addDefaults (cyclomatic 17) src/modules/banners.js:107— banners.addDefaults has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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· test (cyclomatic 17) · ×1
test (cyclomatic 17) src/modules/flora.js:727— test has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to 5 function items inside it that branch. 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.
cameraAt (cyclomatic 17) src/video/sequence.js:37— cameraAt has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
build (cyclomatic 17) src/water/mist.js:210— build has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 222, order, a function literal at line 221). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
geom.surface (cyclomatic 16) src/arch/geom.js:267— geom.surface 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.
columns.pilasterSDF.<returned closure> (cyclomatic 16) src/ruins/columns.js:185— columns.pilasterSDF.<returned closure> has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
face.classicalHead (cyclomatic 16) src/sculpt/face.js:18— face.classicalHead has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
statues.bake (cyclomatic 16) src/bake/statues.js:8— statues.bake has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
voxel.meshChunk::vertexOf (cyclomatic 16) src/terrain/voxel.js:201— voxel.meshChunk::vertexOf 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.
banner.bannerTextures (cyclomatic 16) src/props/banner.js:81— banner.bannerTextures 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.
library.buildLibrary (cyclomatic 16) src/vegetation/library.js:19— library.buildLibrary 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.
city.addTestTrees (cyclomatic 16) src/modules/city.js:469— city.addTestTrees has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
planArcade (cyclomatic 16) src/acropolis/arcade.js:25— planArcade 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.
roughBlock (cyclomatic 16) src/arch/ruins.js:148— roughBlock has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tube (cyclomatic 16) src/flora/util.js:136— tube 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.
makeGarment (cyclomatic 16) src/sculpt/figure.js:457— makeGarment 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.
scatterWorld (cognitive 746) src/vegetation/scatter.js:47— scatterWorld has cognitive complexity 746 (threshold 15). Drivers by points: ternaries 108 (396 pts), if/else 125 (314 pts), loops 46 (86 pts), boolean chains 85, other 21 (nesting depth added 517). 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.
buildChain (cognitive 497) src/acropolis/walls.js:112— buildChain has cognitive complexity 497 (threshold 15). Drivers by points: if/else 62 (221 pts), ternaries 30 (122 pts), loops 26 (92 pts), boolean chains 50, other 12 (nesting depth added 317). Of this number, 491 points are the body's own statements and 6 belong to 15 function items inside it that branch. 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.
voxel.meshChunk (cognitive 346) src/terrain/voxel.js:19— voxel.meshChunk has cognitive complexity 346 (threshold 15). Drivers by points: if/else 58 (216 pts), loops 37 (84 pts), ternaries 12 (28 pts), boolean chains 18 (nesting depth added 221). Of this number, 317 points are the body's own statements and 29 belong to 5 function items inside it that branch. 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.
buildStructure (cognitive 287) src/aqueducts/arcade.js:57— buildStructure has cognitive complexity 287 (threshold 15). Drivers by points: ternaries 40 (153 pts), if/else 24 (68 pts), loops 22 (53 pts), boolean chains 12, other 1 (nesting depth added 188). Of this number, 282 points are the body's own statements and 5 belong to 9 function items inside it that branch. 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.
build (cognitive 259) src/modules/acropolis.js:45— build has cognitive complexity 259 (threshold 15). Drivers by points: if/else 58 (111 pts), loops 35 (54 pts), boolean chains 50, ternaries 27 (42 pts), other 2 (nesting depth added 87). Of this number, 152 points are the body's own statements and 107 belong to 57 function items inside it that branch. 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.
buildHouse (cognitive 239) src/city/buildings.js:50— buildHouse has cognitive complexity 239 (threshold 15). Drivers by points: ternaries 81 (183 pts), if/else 92 (141 pts), boolean chains 57, loops 11 (24 pts), other 11 (nesting depth added 164). 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.
generateFarGrid (cognitive 233) src/terrain/farfield.js:102— generateFarGrid has cognitive complexity 233 (threshold 15). Drivers by points: if/else 32 (80 pts), loops 38 (66 pts), other 63, ternaries 7 (16 pts), boolean chains 8 (nesting depth added 85). 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.
scatterCover (cognitive 171) src/modules/flora.js:135— scatterCover has cognitive complexity 171 (threshold 15). Drivers by points: ternaries 21 (65 pts), if/else 22 (59 pts), boolean chains 26, other 12, loops 4 (9 pts) (nesting depth added 86). Of this number, 169 points are the body's own statements and 2 belong to 5 function literals inside it that branch. 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.
makeLots (cognitive 160) src/city/lots.js:57— makeLots has cognitive complexity 160 (threshold 15). Drivers by points: if/else 25 (98 pts), ternaries 9 (38 pts), loops 6 (17 pts), boolean chains 7 (nesting depth added 113). Of this number, 155 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
compute (cognitive 153) src/arch/ao.js:69— compute has cognitive complexity 153 (threshold 15). Drivers by points: loops 26 (86 pts), if/else 12 (58 pts), boolean chains 5, other 4 (nesting depth added 106). 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.
buildHouse::mkVol (cognitive 153) src/city/buildings.js:120— buildHouse::mkVol has cognitive complexity 153 (threshold 15). Drivers by points: ternaries 36 (64 pts), if/else 24 (33 pts), boolean chains 29, loops 7 (16 pts), other 11 (nesting depth added 46). 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.
buildPodium (cognitive 149) src/acropolis/podium.js:41— buildPodium has cognitive complexity 149 (threshold 15). Drivers by points: ternaries 22 (65 pts), loops 19 (43 pts), if/else 13 (36 pts), boolean chains 4, other 1 (nesting depth added 90). 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.
peripteralTemple (cognitive 146) src/arch/temple.js:267— peripteralTemple has cognitive complexity 146 (threshold 15). Drivers by points: ternaries 22 (48 pts), other 39, loops 17 (33 pts), if/else 10 (21 pts), boolean chains 5 (nesting depth added 53). 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.
buildTerraceHouses (cognitive 145) src/acropolis/houses.js:268— buildTerraceHouses has cognitive complexity 145 (threshold 15). Drivers by points: if/else 34 (82 pts), ternaries 14 (32 pts), loops 9 (18 pts), boolean chains 9, error handling 2 (3 pts), other 1 (nesting depth added 76). 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.
buildEastGarden (cognitive 142) src/acropolis/garden.js:33— buildEastGarden has cognitive complexity 142 (threshold 15). Drivers by points: if/else 31 (67 pts), loops 25 (43 pts), boolean chains 23, ternaries 2 (5 pts), other 4 (nesting depth added 57). Of this number, 131 points are the body's own statements and 11 belong to 11 function items inside it that branch. 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.
buildAqueductTop (cognitive 141) src/aqueducts/arcade.js:346— buildAqueductTop has cognitive complexity 141 (threshold 15). Drivers by points: ternaries 16 (62 pts), loops 20 (55 pts), if/else 11 (21 pts), boolean chains 3 (nesting depth added 91). Of this number, 138 points are the body's own statements and 3 belong to 9 function literals inside it that branch. 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.
traceStream (cognitive 141) src/water/trace.js:67— traceStream has cognitive complexity 141 (threshold 15). Drivers by points: if/else 29 (83 pts), ternaries 9 (34 pts), boolean chains 9, other 9, loops 2 (6 pts) (nesting depth added 83). Of this number, 140 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
build (cognitive 134) src/modules/waterfalls.js:57— build has cognitive complexity 134 (threshold 15). Drivers by points: if/else 35 (50 pts), loops 12 (23 pts), boolean chains 21, ternaries 11 (21 pts), error handling 7 (12 pts), other 7 (nesting depth added 41). Of this number, 106 points are the body's own statements and 28 belong to 25 function items inside it that branch. 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.
buildHouse (cognitive 132) src/acropolis/houses.js:122— buildHouse has cognitive complexity 132 (threshold 15). Drivers by points: if/else 21 (51 pts), loops 15 (36 pts), ternaries 12 (33 pts), boolean chains 12 (nesting depth added 72). Of this number, 129 points are the body's own statements and 3 belong to 3 function items inside it that branch. 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.
wallRun (cognitive 131) src/acropolis/masonry.js:35— wallRun has cognitive complexity 131 (threshold 15). Drivers by points: if/else 23 (73 pts), ternaries 7 (23 pts), loops 11 (22 pts), boolean chains 8, other 5 (nesting depth added 77). Of this number, 128 points are the body's own statements and 3 belong to 5 function items inside it that branch. 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.
buildHarbour (cognitive 129) src/city/harbour.js:113— buildHarbour has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 17 (56 pts), loops 15 (35 pts), if/else 15 (28 pts), boolean chains 8, other 2 (nesting depth added 72). 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.
buildPodiumAndPaving (cognitive 129) src/ruins/portico.js:270— buildPodiumAndPaving has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 22 (98 pts), if/else 7 (18 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 92). Of this number, 114 points are the body's own statements and 15 belong to 4 function items inside it that branch. 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.
buildBastion (cognitive 128) src/acropolis/plaza.js:137— buildBastion has cognitive complexity 128 (threshold 15). Drivers by points: loops 19 (54 pts), if/else 17 (51 pts), ternaries 5 (12 pts), boolean chains 8, other 3 (nesting depth added 76). Of this number, 127 points are the body's own statements and 1 belongs to 5 function items inside it that branch. 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.
buildBridgeDeck (cognitive 128) src/aqueducts/arcade.js:562— buildBridgeDeck has cognitive complexity 128 (threshold 15). Drivers by points: ternaries 28 (68 pts), if/else 15 (32 pts), loops 18 (25 pts), boolean chains 3 (nesting depth added 64). Of this number, 121 points are the body's own statements and 7 belong to 6 function items inside it that branch. 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.
city.build (cognitive 124) src/modules/city.js:122— city.build has cognitive complexity 124 (threshold 15). Drivers by points: if/else 19 (44 pts), loops 21 (31 pts), ternaries 6 (24 pts), boolean chains 16, error handling 8 (9 pts) (nesting depth added 54). Of this number, 117 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
flow.buildFlowMap (cognitive 121) src/water/flow.js:53— flow.buildFlowMap has cognitive complexity 121 (threshold 15). Drivers by points: if/else 22 (75 pts), loops 14 (32 pts), boolean chains 8, ternaries 5 (6 pts) (nesting depth added 72). Of this number, 118 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
meshSDF (cognitive 118) src/sculpt/mesher.js:15— meshSDF has cognitive complexity 118 (threshold 15). Drivers by points: loops 19 (54 pts), if/else 17 (47 pts), boolean chains 12, other 3, ternaries 2 (nesting depth added 65). Of this number, 100 points are the body's own statements and 18 belong to 5 function items inside it that branch. 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.
gateTower (cognitive 112) src/arch/elements.js:222— gateTower has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 18 (54 pts), loops 20 (38 pts), other 10, if/else 7 (9 pts), boolean chains 1 (nesting depth added 56). Of this number, 111 points are the body's own statements and 1 belongs to 2 function items inside it that branch. 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.
placePortFleet (cognitive 107) src/city/fleet.js:153— placePortFleet has cognitive complexity 107 (threshold 15). Drivers by points: ternaries 25 (55 pts), if/else 10 (19 pts), boolean chains 17, loops 6 (8 pts), other 8 (nesting depth added 41). Of this number, 92 points are the body's own statements and 15 belong to 6 function items inside it that branch. 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.
placeFleet (cognitive 106) src/city/fleet.js:24— placeFleet has cognitive complexity 106 (threshold 15). Drivers by points: ternaries 19 (43 pts), if/else 16 (36 pts), boolean chains 12, loops 5 (8 pts), other 7 (nesting depth added 47). Of this number, 96 points are the body's own statements and 10 belong to 7 function items inside it that branch. 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.
emblem (cognitive 106) src/sculpt/props.js:47— emblem has cognitive complexity 106 (threshold 15). Drivers by points: if/else 24 (54 pts), loops 10 (24 pts), ternaries 8 (17 pts), boolean chains 11 (nesting depth added 53). Of this number, 101 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
doricRun (cognitive 104) src/arch/entablature.js:66— doricRun has cognitive complexity 104 (threshold 15). Drivers by points: ternaries 25 (43 pts), if/else 16 (31 pts), loops 9 (16 pts), boolean chains 13, other 1 (nesting depth added 40). Of this number, 103 points are the body's own statements and 1 belongs to 4 function items inside it that branch. 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.
buildFlight (cognitive 101) src/acropolis/stair.js:162— buildFlight has cognitive complexity 101 (threshold 15). Drivers by points: ternaries 15 (52 pts), if/else 13 (32 pts), loops 6 (11 pts), boolean chains 6 (nesting depth added 61). Of this number, 98 points are the body's own statements and 3 belong to 3 function items inside it that branch. 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.
stair.buildStair (cognitive 99) src/acropolis/stair.js:89— stair.buildStair has cognitive complexity 99 (threshold 15). Drivers by points: if/else 13 (43 pts), ternaries 8 (30 pts), loops 6 (18 pts), boolean chains 8 (nesting depth added 64). Of this number, 91 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
bastion.buildColossusBastion (cognitive 98) src/acropolis/bastion.js:38— bastion.buildColossusBastion has cognitive complexity 98 (threshold 15). Drivers by points: loops 22 (40 pts), ternaries 12 (35 pts), if/else 10 (14 pts), boolean chains 8, error handling 1 (nesting depth added 45). Of this number, 37 points are the body's own statements and 61 belong to 2 function literals inside it that branch. 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.
buildPlatform (cognitive 98) src/acropolis/buildings.js:70— buildPlatform has cognitive complexity 98 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 12 (34 pts), boolean chains 11, ternaries 5 (10 pts), other 1 (nesting depth added 54). 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.
makeFigure (cognitive 93) src/sculpt/figure.js:159— makeFigure has cognitive complexity 93 (threshold 15). Drivers by points: loops 13 (25 pts), ternaries 20 (23 pts), boolean chains 22, other 15, if/else 7 (8 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.
buildShip (cognitive 92) src/city/ships.js:150— buildShip has cognitive complexity 92 (threshold 15). Drivers by points: if/else 25 (43 pts), loops 11 (23 pts), ternaries 10 (18 pts), other 7, boolean chains 1 (nesting depth added 38). 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.
rockCluster (cognitive 92) src/flora/rocks.js:62— rockCluster has cognitive complexity 92 (threshold 15). Drivers by points: ternaries 16 (46 pts), if/else 6 (16 pts), loops 6 (16 pts), boolean chains 9, other 5 (nesting depth added 50). Of this number, 79 points are the body's own statements and 13 belong to 4 function items inside it that branch. 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.
buildSheet (cognitive 88) src/water/fallMesh.js:126— buildSheet has cognitive complexity 88 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 12 (23 pts), other 8, ternaries 3 (7 pts), boolean chains 4 (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.
scatterBoulders (cognitive 87) src/terrain/boulders.js:41— scatterBoulders has cognitive complexity 87 (threshold 15). Drivers by points: if/else 15 (42 pts), ternaries 6 (19 pts), loops 9 (14 pts), boolean chains 11, other 1 (nesting depth added 45). Of this number, 85 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
edgeIvySlots (cognitive 83) src/modules/flora.js:326— edgeIvySlots has cognitive complexity 83 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 9 (19 pts), boolean chains 12, other 7, ternaries 3 (5 pts) (nesting depth added 38). Of this number, 76 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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.
pediment (cognitive 81) src/arch/entablature.js:251— pediment has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 13 (35 pts), if/else 13 (22 pts), loops 6 (13 pts), other 9, boolean chains 2 (nesting depth added 38). 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.
buildHeadSet (cognitive 80) src/modules/ruins.js:119— buildHeadSet has cognitive complexity 80 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 12 (24 pts), boolean chains 12, ternaries 5 (12 pts), error handling 1 (2 pts) (nesting depth added 37). Of this number, 44 points are the body's own statements and 36 belong to 20 function items inside it that branch. 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.
stair.buildLanding (cognitive 79) src/acropolis/stair.js:256— stair.buildLanding has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 12 (45 pts), if/else 10 (19 pts), loops 5 (8 pts), boolean chains 7 (nesting depth added 45). 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.
gullGeometry (cognitive 79) src/modules/birds.js:9— gullGeometry has cognitive complexity 79 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 14 (27 pts), ternaries 5 (16 pts), boolean chains 3 (nesting depth added 48). Of this number, 77 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
buildTexture (cognitive 77) src/vegetation/atlas.js:225— buildTexture has cognitive complexity 77 (threshold 15). Drivers by points: loops 16 (41 pts), if/else 7 (26 pts), ternaries 3 (9 pts), boolean chains 1 (nesting depth added 50). 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.
bankTerraces (cognitive 74) src/city/port.js:103— bankTerraces has cognitive complexity 74 (threshold 15). Drivers by points: if/else 7 (26 pts), ternaries 9 (20 pts), loops 8 (18 pts), boolean chains 9, other 1 (nesting depth added 40). Of this number, 67 points are the body's own statements and 7 belong to 4 function items inside it that branch. 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.
createRock (cognitive 73) src/materials/stone.js:374— createRock has cognitive complexity 73 (threshold 15). Drivers by points: loops 17 (27 pts), ternaries 14 (21 pts), if/else 10 (15 pts), other 8, boolean chains 2 (nesting depth added 22). Of this number, 64 points are the body's own statements and 9 belong to 5 function items inside it that branch. 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.
headSDF (cognitive 71) src/sculpt/head.js:274— headSDF has cognitive complexity 71 (threshold 15). Drivers by points: if/else 28 (48 pts), loops 5 (11 pts), ternaries 3 (7 pts), boolean chains 5 (nesting depth added 30). 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.
previewGrid (cognitive 71) src/terrain/preview.mjs:7— previewGrid has cognitive complexity 71 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 6 (18 pts), ternaries 3 (10 pts), boolean chains 4, other 4 (nesting depth added 44). Of this number, 67 points are the body's own statements and 4 belong to 8 function items inside it that branch. 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.
build (cognitive 70) src/modules/temple.js:199— build has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 6 (14 pts), loops 9 (10 pts), other 9, boolean chains 8, error handling 1 (nesting depth added 22). Most of this is not in the body itself: 4 of the 70 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 342, a function literal at line 321, a function literal at line 247, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buildTree (cognitive 69) src/vegetation/trees.js:49— buildTree has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 40 (61 pts), if/else 24 (43 pts), loops 19 (29 pts), boolean chains 9 (nesting depth added 50). 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.
renderView (cognitive 69) src/ruins/headpreview.mjs:33— renderView has cognitive complexity 69 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 15, loops 8 (15 pts), ternaries 8 (14 pts) (nesting depth added 26). Of this number, 65 points are the body's own statements and 4 belong to 6 function items inside it that branch. 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.
planChunks::reqCell (cognitive 68) src/terrain/lod.js:55— planChunks::reqCell has cognitive complexity 68 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 8 (17 pts), ternaries 3 (8 pts), boolean chains 5 (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.
tiledRoof (cognitive 66) src/arch/entablature.js:365— tiledRoof has cognitive complexity 66 (threshold 15). Drivers by points: loops 9 (26 pts), ternaries 6 (24 pts), if/else 6 (9 pts), other 6, boolean chains 1 (nesting depth added 38). 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.
VegSystem._update (cognitive 65) src/vegetation/instances.js:157— VegSystem._update has cognitive complexity 65 (threshold 15). Drivers by points: if/else 9 (31 pts), ternaries 4 (18 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 43). 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.
sweep (cognitive 65) src/arch/geom.js:302— sweep has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 9 (21 pts), loops 9 (19 pts), if/else 6 (13 pts), boolean chains 10, other 2 (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.
box (cognitive 64) src/arch/geom.js:137— box has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 9 (36 pts), if/else 13 (19 pts), loops 3 (6 pts), boolean chains 2, other 1 (nesting depth added 36). 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.
build (cognitive 64) src/props/banner.js:310— build has cognitive complexity 64 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 7 (16 pts), ternaries 8 (16 pts), other 10, boolean chains 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.
acanthus.corinthianCapital (cognitive 63) src/arch/acanthus.js:191— acanthus.corinthianCapital has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 20 (44 pts), loops 9 (14 pts), if/else 1 (3 pts), boolean chains 2 (nesting depth added 31). 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.
prostyleTemple (cognitive 62) src/arch/temple.js:456— prostyleTemple has cognitive complexity 62 (threshold 15). Drivers by points: other 27, ternaries 9 (13 pts), loops 7 (11 pts), if/else 5 (8 pts), boolean chains 3 (nesting depth added 11). Of this number, 59 points are the body's own statements and 3 belong to 6 function literals inside it that branch. 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.
tholos (cognitive 59) src/arch/tholos.js:19— tholos has cognitive complexity 59 (threshold 15). Drivers by points: loops 14 (19 pts), other 19, ternaries 6 (9 pts), if/else 6 (8 pts), boolean chains 4 (nesting depth added 10). Of this number, 57 points are the body's own statements and 2 belong to 16 function items inside it that branch. 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.
drawHeader (cognitive 59) src/props/bannerArt.js:165— drawHeader has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 7 (21 pts), if/else 10 (19 pts), loops 7 (19 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.
crepidoma (cognitive 57) src/arch/temple.js:93— crepidoma has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 6 (13 pts), other 12, loops 5 (11 pts), boolean chains 6 (nesting depth added 22). Of this number, 48 points are the body's own statements and 9 belong to one function literal inside it that branches. 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.
chamferBox (cognitive 56) src/acropolis/geo.js:241— chamferBox has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 15, loops 7 (11 pts), ternaries 6 (nesting depth added 16). Of this number, 47 points are the body's own statements and 9 belong to 6 function items inside it that branch. 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.
cliffGreenery (cognitive 56) src/modules/flora.js:396— cliffGreenery has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 6 (24 pts), if/else 6 (22 pts), loops 4 (7 pts), boolean chains 3 (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.
flutedShaft (cognitive 55) src/arch/orders.js:33— flutedShaft has cognitive complexity 55 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 6 (15 pts), loops 8 (13 pts), other 7, boolean chains 4 (nesting depth added 23). Of this number, 28 points are the body's own statements and 27 belong to 5 function items inside it that branch. 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.
placeLandmarks (cognitive 55) src/city/landmarks.js:336— placeLandmarks has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 15 (23 pts), if/else 13 (19 pts), loops 6 (8 pts), boolean chains 5 (nesting depth added 16). Of this number, 29 points are the body's own statements and 26 belong to 29 function items inside it that branch. 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.
growIvy (cognitive 55) src/ruins/ivy.js:124— growIvy has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (24 pts), other 12, boolean chains 8, ternaries 3 (7 pts), loops 3 (4 pts) (nesting depth added 19). Of this number, 49 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
build (cognitive 54) src/modules/water.js:29— build has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 8 (12 pts), boolean chains 8, ternaries 5 (7 pts), other 3, error handling 1 (2 pts) (nesting depth added 17). Of this number, 36 points are the body's own statements and 18 belong to 9 function items inside it that branch. 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.
finalize (cognitive 52) src/arch/build.js:46— finalize has cognitive complexity 52 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 8 (18 pts), boolean chains 7, other 4, ternaries 2 (3 pts) (nesting depth added 23). Of this number, 46 points are the body's own statements and 6 belong to 22 function items inside it that branch. 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.
flora.viewIvySlots (cognitive 51) src/modules/flora.js:451— flora.viewIvySlots has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (32 pts), boolean chains 8, loops 4 (7 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.
fillLots (cognitive 51) src/city/lots.js:158— fillLots has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 4 (9 pts), boolean chains 3, other 1 (nesting depth added 31). 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.
addMist (cognitive 51) src/modules/waterfalls.js:300— addMist has cognitive complexity 51 (threshold 15). Drivers by points: loops 14 (25 pts), if/else 11 (17 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 18). Of this number, 37 points are the body's own statements and 14 belong to 4 function items inside it that branch. 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.
islandBridge (cognitive 50) src/acropolis/bridge.js:17— islandBridge has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 11 (22 pts), loops 13 (20 pts), if/else 3 (4 pts), boolean chains 2, other 2 (nesting depth added 19). Of this number, 41 points are the body's own statements and 9 belong to 13 function items inside it that branch. 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.
shaftSegment (cognitive 50) src/arch/ruins.js:47— shaftSegment has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 19 (31 pts), other 9, if/else 5 (7 pts), boolean chains 2, loops 1 (nesting depth added 14). Of this number, 19 points are the body's own statements and 31 belong to 10 function items inside it that branch. 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.
streetStrip (cognitive 50) src/modules/city.js:73— streetStrip has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 5 (25 pts), if/else 4 (15 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 34). 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.
shieldGeometry (cognitive 50) src/sculpt/props.js:179— shieldGeometry has cognitive complexity 50 (threshold 15). Drivers by points: loops 9 (16 pts), ternaries 6 (14 pts), if/else 7 (13 pts), boolean chains 5, other 2 (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.
droplets (cognitive 50) src/terrain/erosion.js:153— droplets has cognitive complexity 50 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 6 (11 pts), other 10, boolean chains 5, ternaries 1 (4 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.
temple (cognitive 49) src/city/landmarks.js:41— temple has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 8 (18 pts), loops 9 (13 pts), if/else 6 (11 pts), other 5, boolean chains 2 (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.
build (cognitive 48) src/modules/statues.js:543— build has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 12, loops 4 (10 pts), ternaries 3 (6 pts), error handling 3 (4 pts) (nesting depth added 16). Of this number, 47 points are the body's own statements and 1 belongs to 3 function items inside it that branch. 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.
planCascade (cognitive 48) src/water/rapids.js:181— planCascade has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 7 (12 pts), ternaries 4 (11 pts), boolean chains 5, error handling 1 (nesting depth added 19). Of this number, 37 points are the body's own statements and 11 belong to 8 function items inside it that branch. 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.
composePediment::layer (cognitive 47) src/sculpt/pediment.js:27— composePediment::layer has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 7 (15 pts), boolean chains 6, 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.
pavePrecinct (cognitive 46) src/acropolis/podium.js:288— pavePrecinct has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 7 (12 pts), boolean chains 2, other 2 (nesting depth added 25). 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.
contours (cognitive 46) src/acropolis/site.js:28— contours has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 7 (17 pts), loops 5 (6 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 21). Of this number, 34 points are the body's own statements and 12 belong to 12 function items inside it that branch. 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.
stoa (cognitive 46) src/arch/elements.js:132— stoa has cognitive complexity 46 (threshold 15). Drivers by points: other 15, loops 11 (12 pts), ternaries 6 (12 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 8). Of this number, 42 points are the body's own statements and 4 belong to 6 function items inside it that branch. 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.
ribbon (cognitive 45) src/water/fallMesh.js:34— ribbon has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 5 (7 pts), other 7, ternaries 2 (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.
ionicRun (cognitive 44) src/arch/entablature.js:183— ionicRun has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 7 (10 pts), loops 4 (7 pts), other 5, boolean chains 3 (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.
buildShot2 (cognitive 44) src/sets/shot2.js:18— buildShot2 has cognitive complexity 44 (threshold 15). Drivers by points: loops 19 (27 pts), ternaries 5 (9 pts), if/else 3 (5 pts), boolean chains 2, other 1 (nesting depth added 14). Of this number, 40 points are the body's own statements and 4 belong to 9 function items inside it that branch. 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.
cella (cognitive 43) src/arch/temple.js:209— cella has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 13 (25 pts), if/else 4 (8 pts), loops 4 (5 pts), other 3, boolean chains 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.
findTheatreSite (cognitive 43) src/city/landmarks.js:574— findTheatreSite has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 4 (10 pts), ternaries 2 (6 pts), boolean chains 4 (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.
placeStatues (cognitive 43) src/modules/statues.js:386— placeStatues has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 8, loops 4 (8 pts), ternaries 3 (6 pts), other 3 (nesting depth added 16). Of this number, 40 points are the body's own statements and 3 belong to 6 function literals inside it that branch. 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.
build (cognitive 43) src/props/brazier.js:262— build has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 8 (12 pts), boolean chains 5, other 5, loops 3 (nesting depth added 13). Of this number, 40 points are the body's own statements and 3 belong to 6 function items inside it that branch. 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.
thermal (cognitive 43) src/terrain/erosion.js:123— thermal has cognitive complexity 43 (threshold 15). Drivers by points: if/else 4 (20 pts), loops 6 (16 pts), ternaries 1 (4 pts), other 3 (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.
planWallLine (cognitive 42) src/acropolis/walls.js:45— planWallLine has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 8, loops 4 (6 pts), other 4 (nesting depth added 14). Of this number, 39 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
islandEnsemble (cognitive 42) src/modules/temple.js:71— islandEnsemble has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 8 (16 pts), loops 11 (14 pts), if/else 6 (11 pts), boolean chains 1 (nesting depth added 16). Of this number, 40 points are the body's own statements and 2 belong to 7 function items inside it that branch. 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.
arcade.buildArcade (cognitive 41) src/acropolis/arcade.js:87— arcade.buildArcade has cognitive complexity 41 (threshold 15). Drivers by points: loops 10 (17 pts), ternaries 6 (17 pts), if/else 2 (6 pts), boolean chains 1 (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.
flora.stairIvySlots (cognitive 41) src/modules/flora.js:254— flora.stairIvySlots has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 5 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 25). Of this number, 39 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
buildPrecinctBuildings (cognitive 41) src/acropolis/buildings.js:235— buildPrecinctBuildings has cognitive complexity 41 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (10 pts), boolean chains 7, ternaries 3 (5 pts), error handling 2 (3 pts), other 3 (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.
isoLines (cognitive 40) src/city/walls.js:11— isoLines has cognitive complexity 40 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 4 (12 pts), loops 6 (10 pts), boolean chains 3 (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.
bannerTextures (cognitive 39) src/props/banner.js:81— bannerTextures has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (27 pts), loops 4 (6 pts), if/else 3 (5 pts), boolean chains 1 (nesting depth added 23). 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.
olive.canopyAO (cognitive 38) src/flora/olive.js:53— olive.canopyAO has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (21 pts), loops 6 (16 pts), boolean chains 1 (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.
banners.build (cognitive 38) src/modules/banners.js:65— banners.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 9, loops 6, if/else 2 (3 pts), error handling 1 (2 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.
findSite (cognitive 38) src/acropolis/buildings.js:41— findSite has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 4 (10 pts), boolean chains 4, ternaries 1 (3 pts), other 2 (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.
buildGateTower (cognitive 38) src/aqueducts/arcade.js:706— buildGateTower has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 10 (24 pts), loops 9 (13 pts), other 1 (nesting depth added 18). 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.
drawLaurelWreath (cognitive 38) src/props/owl.js:335— drawLaurelWreath has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 5 (14 pts), loops 5 (9 pts), other 8, if/else 3 (5 pts), boolean chains 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.
rapids.buildRapidsRocks (cognitive 37) src/water/rapids.js:18— rapids.buildRapidsRocks has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (8 pts), boolean chains 6, error handling 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.
clouds.build (cognitive 37) src/modules/clouds.js:537— clouds.build has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 11, loops 4, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 557, 556). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buildTerraceBuildings (cognitive 37) src/acropolis/buildings.js:167— buildTerraceBuildings has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (8 pts), boolean chains 5, error handling 3 (4 pts), other 4, loops 3 (nesting depth added 10). Of this number, 28 points are the body's own statements and 9 belong to one function item inside it that branches. 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.
dressPrecinct (cognitive 37) src/acropolis/podium.js:342— dressPrecinct has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 12, loops 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 11). Of this number, 35 points are the body's own statements and 2 belong to 3 function items inside it that branch. 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.
parapet (cognitive 37) src/acropolis/stair.js:374— parapet has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (27 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). Of this number, 35 points are the body's own statements and 2 belong to 3 function items inside it that branch. 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.
walls.tower (cognitive 36) src/city/walls.js:109— walls.tower has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 7 (24 pts), loops 4 (8 pts), if/else 3 (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.
planWeirs (cognitive 36) src/water/rapids.js:123— planWeirs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 5 (8 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 16). Of this number, 30 points are the body's own statements and 6 belong to 4 function items inside it that branch. 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.
heightmap.captureHeightMap (cognitive 35) src/water/heightmap.js:46— heightmap.captureHeightMap has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 6 (15 pts), boolean chains 2, ternaries 2 (nesting depth added 16). Of this number, 32 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
ivyCurtain (cognitive 35) src/flora/ivy.js:63— ivyCurtain has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 6 (12 pts), other 4, ternaries 1 (2 pts), boolean chains 1 (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.
plantAtlas (cognitive 35) src/props/urn.js:123— plantAtlas has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 5 (18 pts), loops 9 (13 pts), if/else 2 (4 pts) (nesting depth added 19). Of this number, 33 points are the body's own statements and 2 belong to 3 function items inside it that branch. 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.
stair.stepSlab (cognitive 34) src/acropolis/stair.js:483— stair.stepSlab has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 6 (11 pts), loops 4 (5 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.
atlas.drawTwig (cognitive 34) src/vegetation/atlas.js:123— atlas.drawTwig has cognitive complexity 34 (threshold 15). Drivers by points: loops 9 (16 pts), ternaries 5 (13 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 17). Of this number, 28 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
leaf (cognitive 34) src/arch/acanthus.js:16— leaf has cognitive complexity 34 (threshold 15). Drivers by points: other 14, loops 5 (7 pts), ternaries 4 (7 pts), if/else 3 (5 pts), boolean chains 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 12 belong to 11 function items inside it that branch. 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.
streamPower (cognitive 34) src/terrain/erosion.js:93— streamPower has cognitive complexity 34 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (9 pts), other 7, loops 3 (5 pts), boolean chains 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.
landmarks.findSite (cognitive 33) src/city/landmarks.js:14— landmarks.findSite has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (6 pts), boolean chains 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.
flora.test (cognitive 33) src/modules/flora.js:727— flora.test has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 4 (18 pts), if/else 5 (6 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 18). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
city.addTestTrees (cognitive 33) src/modules/city.js:469— city.addTestTrees has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 6 (21 pts), if/else 4 (6 pts), loops 3 (4 pts), boolean chains 1, error handling 1 (nesting depth added 18). Of this number, 30 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
traceFall (cognitive 33) src/water/trace.js:232— traceFall has cognitive complexity 33 (threshold 15). Drivers by points: loops 6 (10 pts), other 9, ternaries 5 (8 pts), boolean chains 3, if/else 2 (3 pts) (nesting depth added 8). Of this number, 32 points are the body's own statements and 1 belongs to 8 function literals inside it that branch. 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.
props.mouldedBlock (cognitive 32) src/sculpt/props.js:314— props.mouldedBlock has cognitive complexity 32 (threshold 15). Drivers by points: loops 6 (13 pts), ternaries 4 (12 pts), if/else 2 (5 pts), boolean chains 2 (nesting depth added 18). 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.
flora.build (cognitive 32) src/modules/flora.js:622— flora.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 6 (9 pts), loops 6 (8 pts), boolean chains 3 (nesting depth added 10). Of this number, 28 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
util.addBlob (cognitive 32) src/vegetation/util.js:90— util.addBlob has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 7 (12 pts), loops 6 (8 pts), boolean chains 7, if/else 2 (5 pts) (nesting depth added 10). Of this number, 28 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
buildArch (cognitive 32) src/acropolis/masonry.js:337— buildArch has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (24 pts), loops 6 (7 pts), other 1 (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.
roof (cognitive 32) src/city/house.js:99— roof has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (8 pts), loops 2 (4 pts), boolean chains 2, other 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.
fallbackSlots (cognitive 32) src/modules/statues.js:341— fallbackSlots has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (6 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.
cypress.buildCypress (cognitive 31) src/vegetation/cypress.js:43— cypress.buildCypress has cognitive complexity 31 (threshold 15). Drivers by points: loops 25 (41 pts), if/else 13 (24 pts), ternaries 11 (24 pts), boolean chains 3 (nesting depth added 40). 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.
addDefaults (cognitive 31) src/modules/banners.js:107— addDefaults has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (7 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 15). Of this number, 17 points are the body's own statements and 14 belong to 4 function items inside it that branch. 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.
placeSculpture (cognitive 31) src/modules/statues.js:498— placeSculpture has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 11, loops 3 (4 pts), other 1, ternaries 1 (nesting depth added 7). Of this number, 20 points are the body's own statements and 11 belong to 4 function items inside it that branch. 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.
build (cognitive 31) src/props/urn.js:339— build has cognitive complexity 31 (threshold 15). Drivers by points: other 9, loops 3 (7 pts), ternaries 4 (7 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 9). Of this number, 28 points are the body's own statements and 3 belong to 9 function items inside it that branch. 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.
buildPortico (cognitive 31) src/ruins/portico.js:65— buildPortico has cognitive complexity 31 (threshold 15). Drivers by points: loops 8 (10 pts), if/else 5 (9 pts), boolean chains 6, ternaries 2 (6 pts) (nesting depth added 10). Of this number, 23 points are the body's own statements and 8 belong to 5 function items inside it that branch. 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.
boot (cognitive 30) src/main.js:12— boot has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 10, ternaries 4 (6 pts), loops 2, other 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 14 belong to 13 function items inside it that branch. 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.
opening (cognitive 30) src/acropolis/houses.js:76— opening has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 5 (6 pts), loops 3 (6 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.
lathe (cognitive 30) src/arch/geom.js:210— lathe has cognitive complexity 30 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 4 (8 pts), other 4, boolean chains 3 (nesting depth added 11). 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.
buildAll (cognitive 30) src/modules/aqueducts.js:38— buildAll has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 3 (6 pts), loops 4 (6 pts), other 2, error handling 1 (nesting depth added 13). Of this number, 29 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. 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.
buildIvy (cognitive 30) src/modules/flora.js:494— buildIvy has cognitive complexity 30 (threshold 15). Drivers by points: other 12, boolean chains 8, if/else 5 (7 pts), loops 2 (3 pts) (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.
buildHeroes (cognitive 30) src/modules/flora.js:542— buildHeroes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, other 6, loops 3, ternaries 1 (2 pts) (nesting depth added 7). Of this number, 29 points are the body's own statements and 1 belongs to 2 function items inside it that branch. 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.
pilasterSDF (cognitive 30) src/ruins/columns.js:174— pilasterSDF has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (10 pts), boolean chains 4, other 3, loops 2 (nesting depth added 10). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 185, (anonymous)::fl). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ruinStoneMaterial (cognitive 30) src/ruins/materials.js:284— ruinStoneMaterial has cognitive complexity 30 (threshold 15). Drivers by points: other 14, ternaries 11, boolean chains 5. None of this is in the body itself: all 30 points belong to one function literal inside it that branches (line 286). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
util.addTube (cognitive 29) src/vegetation/util.js:185— util.addTube has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (8 pts), boolean chains 7, ternaries 2 (4 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.
statues.test (cognitive 29) src/modules/statues.js:610— statues.test has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (8 pts), loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 18 points are the body's own statements and 11 belong to 5 function items inside it that branch. 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.
merge (cognitive 29) src/arch/geom.js:72— merge has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (5 pts), ternaries 2 (3 pts), boolean chains 1, other 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.
buildCypress::emitShingles (cognitive 29) src/vegetation/cypress.js:207— buildCypress::emitShingles has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 2 (6 pts), loops 2 (3 pts), boolean chains 1, other 1 (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.
geom.surface (cognitive 28) src/arch/geom.js:267— geom.surface has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (7 pts), loops 4 (6 pts), boolean chains 4 (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.
buildColumn (cognitive 28) src/arch/orders.js:295— buildColumn has cognitive complexity 28 (threshold 15). Drivers by points: other 11, ternaries 10, if/else 5, boolean chains 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.
buildWalls (cognitive 28) src/city/walls.js:57— buildWalls has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (11 pts), boolean chains 4 (nesting depth added 16). Of this number, 25 points are the body's own statements and 3 belong to 6 function items inside it that branch. 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.
applyShot (cognitive 28) src/core/engine.js:152— applyShot has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts), other 6, loops 5, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
resolve (cognitive 28) src/core/pipeline.js:488— resolve has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 6 (8 pts), boolean chains 7, loops 1 (2 pts), error handling 1 (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.
stair.archedPassages (cognitive 27) src/acropolis/stair.js:435— stair.archedPassages has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (13 pts), ternaries 3 (11 pts), if/else 1 (2 pts), boolean chains 1 (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.
dressSheerFaces (cognitive 27) src/acropolis/cliffdress.js:118— dressSheerFaces has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 3 (4 pts), other 4, ternaries 1 (3 pts) (nesting depth added 7). Of this number, 25 points are the body's own statements and 2 belong to 3 function items inside it that branch. 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.
makeSpec (cognitive 27) src/aqueducts/arcade.js:12— makeSpec has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 5, loops 1 (nesting depth added 7). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
lavender (cognitive 27) src/flora/ground.js:144— lavender has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (15 pts), ternaries 4 (10 pts), if/else 1 (2 pts) (nesting depth added 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.
ivyColumn (cognitive 27) src/flora/ivy.js:174— ivyColumn has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 3 (8 pts), other 3, boolean chains 1, ternaries 1 (nesting depth added 13). 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.
parseSpill (cognitive 27) src/modules/waterfalls.js:26— parseSpill has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 5 (6 pts), other 5 (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.
tube (cognitive 26) src/flora/util.js:136— tube has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (11 pts), loops 5 (8 pts), if/else 3 (5 pts), other 2 (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.
stoneSDF (cognitive 26) src/ruins/stones.js:18— stoneSDF has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5, boolean chains 4, other 4, ternaries 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 12 belong to one function literal inside it that branches. 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.
textures.bleed (cognitive 25) src/flora/textures.js:156— textures.bleed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 4 (10 pts), boolean chains 2 (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.
voxel.maxFilter (cognitive 25) src/terrain/voxel.js:314— voxel.maxFilter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (11 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. This shape REPEATS in the file: one other method here (voxel.minFilter) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
voxel.minFilter (cognitive 25) src/terrain/voxel.js:322— voxel.minFilter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (11 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. This shape REPEATS in the file: one other method here (voxel.maxFilter) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
flora.columnIvySlots (cognitive 25) src/modules/flora.js:292— flora.columnIvySlots has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 299, 295). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buildPodiumStair (cognitive 25) src/acropolis/podium.js:224— buildPodiumStair has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 2 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 14). Of this number, 21 points are the body's own statements and 4 belong to 5 function items inside it that branch. 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.
drumSDF (cognitive 25) src/ruins/columns.js:31— drumSDF has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (9 pts), other 9, loops 4, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 12 belong to one function literal inside it that branches. 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.
drawSubSpray (cognitive 25) src/vegetation/atlas.js:329— drawSubSpray has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 5 (10 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.
acropolis (cognitive 25) src/world/heightfield.js:430— acropolis has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (6 pts), boolean chains 3, ternaries 2 (3 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.
heightfield.nearHeight (cognitive 24) src/world/heightfield.js:758— heightfield.nearHeight has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 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.
agora (cognitive 24) src/city/landmarks.js:281— agora has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (10 pts), ternaries 3 (9 pts), if/else 2 (4 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.
yellowFlowers (cognitive 24) src/flora/ground.js:84— yellowFlowers has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (16 pts), loops 4 (8 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.
dressRocks (cognitive 24) src/modules/flora.js:597— dressRocks has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (14 pts), loops 5 (9 pts), other 1 (nesting depth added 11). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
buildLibrary (cognitive 24) src/vegetation/library.js:19— buildLibrary has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (19 pts), loops 3 (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.
vegetation.test (cognitive 23) src/modules/vegetation.js:38— vegetation.test has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 6, boolean chains 1, if/else 1 (nesting depth added 10). 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.
buildTower (cognitive 23) src/acropolis/walls.js:508— buildTower has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (9 pts), loops 4 (7 pts), if/else 3 (6 pts), boolean chains 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.
figure (cognitive 23) src/city/house.js:499— figure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 6 (8 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). Of this number, 20 points are the body's own statements and 3 belong to 4 function items inside it that branch. 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.
drawIvyLeaf (cognitive 23) src/flora/textures.js:45— drawIvyLeaf has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 5 (6 pts), ternaries 5 (6 pts), boolean chains 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 2 belong to 7 function items inside it that branch. 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.
geom.tube (cognitive 22) src/arch/geom.js:430— geom.tube has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (9 pts), ternaries 4 (7 pts), if/else 2 (5 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.
OceanTile.constructor (cognitive 22) src/water/ocean.js:45— OceanTile.constructor has cognitive complexity 22 (threshold 15). Drivers by points: loops 8 (10 pts), if/else 2 (6 pts), ternaries 2 (6 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.
trees.buildTree::clusterBlobs (cognitive 22) src/vegetation/trees.js:237— trees.buildTree::clusterBlobs has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 4 (10 pts) (nesting depth added 11). 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· run (cognitive 22) · ×1
run (cognitive 22) src/city/plan.js:201— run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (8 pts), ternaries 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.
surfaceMap (cognitive 22) src/flora/surface.js:38— surfaceMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, loops 2, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 43, (anonymous)::onBeforeRender, a function literal at line 41, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mergeGeos (cognitive 22) src/props/metals.js:115— mergeGeos has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (9 pts), ternaries 2 (3 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.
masonry.planRuns (cognitive 21) src/acropolis/masonry.js:253— masonry.planRuns has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (9 pts), ternaries 1 (nesting depth added 12). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (offFor, hs). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
temple.bronzeDoor (cognitive 21) src/arch/temple.js:177— temple.bronzeDoor has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (10 pts), ternaries 4 (8 pts), if/else 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.
columns.baseSDF.f (cognitive 21) src/ruins/columns.js:113— columns.baseSDF.f has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (7 pts), boolean chains 4, 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.
columns.pilasterSDF.<returned closure> (cognitive 21) src/ruins/columns.js:185— columns.pilasterSDF.<returned closure> has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
statues.pedestalOrnaments (cognitive 21) src/modules/statues.js:127— statues.pedestalOrnaments has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). 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.
addGeometry (cognitive 21) src/city/geobuilder.js:77— addGeometry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (7 pts), ternaries 1 (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.
solveToneCurve (cognitive 21) src/core/pipeline.js:112— solveToneCurve has cognitive complexity 21 (threshold 15). Drivers by points: loops 11 (14 pts), if/else 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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.
baseSDF.f (cognitive 21) src/ruins/columns.js:113— baseSDF.f has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (7 pts), boolean chains 4, 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.
stair.buildQuay (cognitive 20) src/acropolis/stair.js:323— stair.buildQuay has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (15 pts), loops 4 (5 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.
Builder.hexa (cognitive 20) src/aqueducts/geom.js:78— Builder.hexa has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 6 (9 pts), ternaries 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.
buildings.pickRoof (cognitive 20) src/city/buildings.js:36— buildings.pickRoof has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 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.
theatre (cognitive 20) src/city/landmarks.js:519— theatre has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), loops 5 (7 pts), other 4 (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.
makeHand (cognitive 20) src/sculpt/figure.js:57— makeHand has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (8 pts), loops 4 (6 pts), boolean chains 4, other 2 (nesting depth added 6). Of this number, 14 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
setupVideo::__renderVideoFrame (cognitive 20) src/video/player.js:19— setupVideo::__renderVideoFrame has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 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.
erosion.drainage (cognitive 19) src/terrain/erosion.js:37— erosion.drainage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (6 pts), boolean chains 4 (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.
terrain.bake (cognitive 19) src/bake/terrain.js:22— terrain.bake has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). Of this number, 10 points are the body's own statements and 9 belong to 2 function literals inside it that branch. 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.
Footprints.query (cognitive 19) src/core/footprints.js:45— Footprints.query has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 pts), boolean chains 2 (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.
index.buildWorld (cognitive 19) src/world/index.js:22— index.buildWorld has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (7 pts), error handling 2 (4 pts), 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.
util.addCard (cognitive 19) src/vegetation/util.js:154— util.addCard has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 3 (4 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.
planArcade (cognitive 19) src/acropolis/arcade.js:25— planArcade has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 4 (5 pts), other 4, boolean chains 2, ternaries 1 (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.
pedestal (cognitive 19) src/arch/elements.js:19— pedestal has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), other 4, loops 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.
rotunda (cognitive 19) src/city/landmarks.js:197— rotunda has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (7 pts), ternaries 2 (6 pts), if/else 2 (4 pts), other 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.
leafMaterial (cognitive 19) src/flora/foliage.js:75— leafMaterial has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, other 6, if/else 3, ternaries 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
viewSurface (cognitive 19) src/flora/surface.js:140— viewSurface has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, other 2, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 145, (anonymous)::onBeforeRender, a function literal at line 143, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buildTree::grow (cognitive 19) src/vegetation/trees.js:75— buildTree::grow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 4, loops 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.
Simplex.noise3 (cognitive 18) src/core/noise.js:38— Simplex.noise3 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (18 pts) (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.
ivy.ivyMeshes (cognitive 18) src/ruins/ivy.js:196— ivy.ivyMeshes has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 5 (7 pts) (nesting depth added 8). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
head.bake (cognitive 18) src/bake/head.js:9— head.bake has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, 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.
PointHash.nearest (cognitive 18) src/city/plan.js:55— PointHash.nearest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 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.
OceanTile.update (cognitive 18) src/water/ocean.js:100— OceanTile.update has cognitive complexity 18 (threshold 15). Drivers by points: loops 10 (17 pts), if/else 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
urn.plantGeometry (cognitive 18) src/props/urn.js:219— urn.plantGeometry has cognitive complexity 18 (threshold 15). Drivers by points: loops 9 (12 pts), boolean chains 2, if/else 1 (2 pts), ternaries 2 (nesting depth added 4). Of this number, 14 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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.
wreath (cognitive 18) src/acropolis/ornament.js:12— wreath has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 1 (3 pts), other 2 (nesting depth added 9). 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.
planStair (cognitive 18) src/acropolis/stair.js:41— planStair has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (6 pts), other 5, if/else 1 (3 pts), loops 2 (3 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.
balustrade (cognitive 18) src/arch/elements.js:89— balustrade has cognitive complexity 18 (threshold 15). Drivers by points: other 6, loops 4 (5 pts), ternaries 1 (3 pts), boolean chains 2, if/else 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.
arcadeFacade (cognitive 18) src/arch/temple.js:45— arcadeFacade has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (8 pts), other 5, if/else 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 4). 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.
drawSideBands (cognitive 18) src/props/bannerArt.js:138— drawSideBands has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (5 pts), loops 2 (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.
drawLegs (cognitive 18) src/props/owl.js:130— drawLegs has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (6 pts), ternaries 2 (6 pts), if/else 2 (5 pts), boolean chains 1 (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.
jointGrass (cognitive 18) src/ruins/grass.js:68— jointGrass has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (7 pts), loops 3 (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.
mergeGeos (cognitive 18) src/ruins/sdf.js:66— mergeGeos has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 7). 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.
buildHeadGeometry (cognitive 18) src/sculpt/head.js:534— buildHeadGeometry has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (7 pts), if/else 2 (5 pts), boolean chains 2, other 2, ternaries 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (skyVis, f, f0). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
arcade.buildCutwaters (cognitive 17) src/aqueducts/arcade.js:300— arcade.buildCutwaters has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 2 (3 pts), ternaries 1 (nesting depth added 9). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
face.classicalHead (cognitive 17) src/sculpt/face.js:18— face.classicalHead has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (7 pts), boolean chains 4, ternaries 4, if/else 1 (2 pts) (nesting depth added 2). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. 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.
farfield.boxBlur (cognitive 17) src/terrain/farfield.js:34— farfield.boxBlur has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (17 pts) (nesting depth added 10). 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.
Grid.blur (cognitive 17) src/city/plan.js:22— Grid.blur has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (17 pts) (nesting depth added 10). 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.
banner.clothGeometry (cognitive 17) src/props/banner.js:224— banner.clothGeometry has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
addRun (cognitive 17) src/acropolis/balustrade.js:24— addRun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, loops 4 (5 pts), other 1 (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.
sample (cognitive 17) src/city/plan.js:83— sample has cognitive complexity 17 (threshold 15). Drivers by points: loops 8 (12 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 6). 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.
bowlOuterGeometry (cognitive 17) src/props/brazier.js:83— bowlOuterGeometry has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 3, loops 1 (2 pts), boolean chains 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
mergeGeos (cognitive 17) src/sculpt/bakeutil.js:68— mergeGeos has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). 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.
summitEnvelope (cognitive 17) src/world/heightfield.js:218— summitEnvelope has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 pts), 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.
geo.sweepStraight (cognitive 16) src/acropolis/geo.js:298— geo.sweepStraight has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), ternaries 1 (2 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.
geo.simplify (cognitive 16) src/acropolis/geo.js:348— geo.simplify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 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.
geom.extrudeOutline (cognitive 16) src/arch/geom.js:390— geom.extrudeOutline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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.
acanthus.ribbon (cognitive 16) src/arch/acanthus.js:90— acanthus.ribbon has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (8 pts), ternaries 3 (7 pts), if/else 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.
stair.scanLedges (cognitive 16) src/acropolis/stair.js:17— stair.scanLedges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 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.
statues.bake (cognitive 16) src/bake/statues.js:8— statues.bake has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (4 pts), loops 2 (3 pts), ternaries 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
erosion.steepestReceivers (cognitive 16) src/terrain/erosion.js:70— erosion.steepestReceivers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (4 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.
CityPlan.trace::half (cognitive 16) src/city/plan.js:143— CityPlan.trace::half has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (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.
CityPlan.streets (cognitive 16) src/city/plan.js:168— CityPlan.streets has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (10 pts), boolean chains 3, if/else 3 (nesting depth added 3). Of this number, 9 points are the body's own statements and 7 belong to one function item inside it that branches. 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.
harbour.traceCoast (cognitive 16) src/city/harbour.js:17— harbour.traceCoast has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 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.
ground.grassTuft (cognitive 16) src/flora/ground.js:50— ground.grassTuft has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), loops 2 (4 pts), if/else 1 (2 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.
clouds.buildMistMap (cognitive 16) src/modules/clouds.js:165— clouds.buildMistMap has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (7 pts) (nesting depth added 10). 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.
buildCastellum (cognitive 16) src/aqueducts/arcade.js:510— buildCastellum has cognitive complexity 16 (threshold 15). Drivers by points: loops 9 (12 pts), ternaries 2 (4 pts) (nesting depth added 5). 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.
rosemary (cognitive 16) src/flora/ground.js:199— rosemary has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (7 pts), ternaries 2 (6 pts), if/else 1 (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.
bannerFromSlot (cognitive 16) src/modules/banners.js:45— bannerFromSlot has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10, boolean chains 3, other 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.
cord (cognitive 16) src/props/bannerArt.js:75— cord has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 3 (5 pts), loops 2 (5 pts) (nesting depth added 8). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
drawGreekText (cognitive 16) src/props/owl.js:488— drawGreekText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (3 pts), other 2, boolean chains 1, loops 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
makeGarment.skirt (cognitive 16) src/sculpt/figure.js:471— makeGarment.skirt has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4, other 4, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
meshChunk::vertexOf (cognitive 16) src/terrain/voxel.js:201— meshChunk::vertexOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4, boolean chains 2, loops 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.
cameraAt (cognitive 16) src/video/sequence.js:37— cameraAt has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, other 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
hilltops (cognitive 16) src/world/heightfield.js:592— hilltops has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, other 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.
Duplication concentrated across 16 sibling directories (28 clone groups) src/ruins/sdf.js:37— 28 duplicated blocks under src/ have copies in at least two of the sibling directories acropolis, arch, city, core, flora, materials (+10 more sibling(s) not listed) — 21 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 28 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 28 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 28 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (45 matched lines × 2 locations) · ×1
Duplicated block with local edits (45 matched lines × 2 locations) src/arch/temple.js:257— src/arch/temple.js:257 · src/arch/temple.js:450 — the two spans are one implementation copied and then locally edited — 706 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (35 matched lines × 2 locations) · ×1
Duplicated block with local edits (35 matched lines × 2 locations) src/flora/surface.js:39— src/flora/surface.js:39 · src/flora/surface.js:141 — the two spans are one implementation copied and then locally edited — 582 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (26 matched lines × 2 locations) · ×1
Duplicated block with local edits (26 matched lines × 2 locations) src/water/churn.js:90— src/water/churn.js:90 · src/water/mist.js:212 — the two spans are one implementation copied and then locally edited — 274 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (23 lines × 2 locations) src/props/brazier.js:51— src/props/brazier.js:51 · src/props/urn.js:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (19 matched lines × 2 locations) · ×1
Duplicated block with local edits (19 matched lines × 2 locations) src/ruins/sdf.js:37— src/ruins/sdf.js:37 · src/sculpt/head.js:539 — the two spans are one implementation copied and then locally edited — 289 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (18 matched lines × 2 locations) · ×1
Duplicated block with local edits (18 matched lines × 2 locations) src/city/fleet.js:34— src/city/fleet.js:34 · src/city/fleet.js:165 — the two spans are one implementation copied and then locally edited — 355 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (13 matched lines × 2 locations) · ×1
Duplicated block with local edits (13 matched lines × 2 locations) src/arch/geom.js:480— src/arch/geom.js:480 · src/sculpt/sdf.js:137 — the two spans are one implementation copied and then locally edited — 241 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (11 lines × 2 locations) src/props/lamp.js:66— src/props/lamp.js:66 · src/props/urn.js:72 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (11 matched lines × 2 locations) · ×1
Duplicated block with local edits (11 matched lines × 2 locations) src/water/flow.js:14— src/water/flow.js:14 · src/world/heightfield.js:37 — the two spans are one implementation copied and then locally edited — 232 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (10 lines × 3 locations) src/props/brazier.js:125— src/props/brazier.js:125 · src/props/lamp.js:66 · src/props/urn.js:72 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (10 matched lines × 2 locations) · ×1
Duplicated block with local edits (10 matched lines × 2 locations) src/sculpt/props.js:245— src/sculpt/props.js:245 · src/sculpt/props.js:282 — the two spans are one implementation copied and then locally edited — 199 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (8 lines × 3 locations) src/props/brazier.js:66— src/props/brazier.js:66 · src/props/urn.js:37 · src/ruins/grass.js:29 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 3 locations) src/city/fleet.js:271— src/city/fleet.js:271 · src/props/urn.js:300 · src/ruins/ivy.js:219 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function scatterWorld (cyclomatic 273, cognitive 746) src/vegetation/scatter.js:47— scatterWorld has cyclomatic complexity 273 and cognitive complexity 746; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildChain (cyclomatic 206, cognitive 491) src/acropolis/walls.js:112— buildChain has cyclomatic complexity 206 and cognitive complexity 491; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function generateFarGrid (cyclomatic 157, cognitive 233) src/terrain/farfield.js:102— generateFarGrid has cyclomatic complexity 157 and cognitive complexity 233; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function mkVol (cyclomatic 131, cognitive 153) src/city/buildings.js:120— mkVol has cyclomatic complexity 131 and cognitive complexity 153; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildHouse (cyclomatic 128, cognitive 239) src/city/buildings.js:50— buildHouse has cyclomatic complexity 128 and cognitive complexity 239; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function build (cyclomatic 117, cognitive 152) src/modules/acropolis.js:45— build has cyclomatic complexity 117 and cognitive complexity 152; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function meshChunk (cyclomatic 114, cognitive 344) src/terrain/voxel.js:19— meshChunk has cyclomatic complexity 114 and cognitive complexity 344; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildStructure (cyclomatic 102, cognitive 282) src/aqueducts/arcade.js:57— buildStructure has cyclomatic complexity 102 and cognitive complexity 282; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function peripteralTemple (cyclomatic 97, cognitive 146) src/arch/temple.js:267— peripteralTemple has cyclomatic complexity 97 and cognitive complexity 146; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function scatterCover (cyclomatic 89, cognitive 169) src/modules/flora.js:135— scatterCover has cyclomatic complexity 89 and cognitive complexity 169; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function makeFigure (cyclomatic 80, cognitive 93) src/sculpt/figure.js:159— makeFigure has cyclomatic complexity 80 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildEastGarden (cyclomatic 77, cognitive 131) src/acropolis/garden.js:33— buildEastGarden has cyclomatic complexity 77 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function build (cyclomatic 71, cognitive 115) src/modules/city.js:122— build has cyclomatic complexity 71 and cognitive complexity 115; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function build (cyclomatic 70, cognitive 106) src/modules/waterfalls.js:57— build has cyclomatic complexity 70 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildTerraceHouses (cyclomatic 69, cognitive 145) src/acropolis/houses.js:268— buildTerraceHouses has cyclomatic complexity 69 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildHouse (cyclomatic 68, cognitive 129) src/acropolis/houses.js:122— buildHouse has cyclomatic complexity 68 and cognitive complexity 129; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildBridgeDeck (cyclomatic 61, cognitive 121) src/aqueducts/arcade.js:562— buildBridgeDeck has cyclomatic complexity 61 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function doricRun (cyclomatic 61, cognitive 103) src/arch/entablature.js:66— doricRun has cyclomatic complexity 61 and cognitive complexity 103; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function compute (cyclomatic 60, cognitive 153) src/arch/ao.js:69— compute has cyclomatic complexity 60 and cognitive complexity 153; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildPodium (cyclomatic 59, cognitive 149) src/acropolis/podium.js:41— buildPodium has cyclomatic complexity 59 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildHarbour (cyclomatic 58, cognitive 129) src/city/harbour.js:113— buildHarbour has cyclomatic complexity 58 and cognitive complexity 129; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function traceStream (cyclomatic 55, cognitive 140) src/water/trace.js:67— traceStream has cyclomatic complexity 55 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function gateTower (cyclomatic 55, cognitive 111) src/arch/elements.js:222— gateTower has cyclomatic complexity 55 and cognitive complexity 111; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildBastion (cyclomatic 54, cognitive 127) src/acropolis/plaza.js:137— buildBastion has cyclomatic complexity 54 and cognitive complexity 127; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildTree (cyclomatic 52, cognitive 69) src/vegetation/trees.js:49— buildTree has cyclomatic complexity 52 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function wallRun (cyclomatic 51, cognitive 128) src/acropolis/masonry.js:35— wallRun has cyclomatic complexity 51 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildFlowMap (cyclomatic 51, cognitive 118) src/water/flow.js:53— buildFlowMap has cyclomatic complexity 51 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function emblem (cyclomatic 51, cognitive 101) src/sculpt/props.js:47— emblem has cyclomatic complexity 51 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function placePortFleet (cyclomatic 51, cognitive 92) src/city/fleet.js:153— placePortFleet has cyclomatic complexity 51 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function placeFleet (cyclomatic 50, cognitive 96) src/city/fleet.js:24— placeFleet has cyclomatic complexity 50 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function prostyleTemple (cyclomatic 50, cognitive 59) src/arch/temple.js:456— prostyleTemple has cyclomatic complexity 50 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildPlatform (cyclomatic 49, cognitive 98) src/acropolis/buildings.js:70— buildPlatform has cyclomatic complexity 49 and cognitive complexity 98; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function scatterBoulders (cyclomatic 49, cognitive 85) src/terrain/boulders.js:41— scatterBoulders has cyclomatic complexity 49 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function tholos (cyclomatic 48, cognitive 57) src/arch/tholos.js:19— tholos has cyclomatic complexity 48 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildAqueductTop (cyclomatic 47, cognitive 138) src/aqueducts/arcade.js:346— buildAqueductTop has cyclomatic complexity 47 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildShip (cyclomatic 47, cognitive 92) src/city/ships.js:150— buildShip has cyclomatic complexity 47 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function headSDF (cyclomatic 45, cognitive 71) src/sculpt/head.js:274— headSDF has cyclomatic complexity 45 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function createRock (cyclomatic 45, cognitive 64) src/materials/stone.js:374— createRock has cyclomatic complexity 45 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildSheet (cyclomatic 43, cognitive 88) src/water/fallMesh.js:126— buildSheet has cyclomatic complexity 43 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function place (cyclomatic 43, cognitive 43) · ×1
Complex function place (cyclomatic 43, cognitive 43) src/vegetation/scatter.js:212— place has cyclomatic complexity 43 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
src/world/heightfield.js: 826 lines of code src/world/heightfield.js:1— src/world/heightfield.js has 826 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/flora.js: 792 lines of code src/modules/flora.js:1— src/modules/flora.js has 792 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/statues.js: 738 lines of code src/modules/statues.js:1— src/modules/statues.js has 738 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/aqueducts/arcade.js: 735 lines of code src/aqueducts/arcade.js:1— src/aqueducts/arcade.js has 735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/sculpt/figure.js: 705 lines of code src/sculpt/figure.js:1— src/sculpt/figure.js has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/pipeline.js: 701 lines of code src/core/pipeline.js:1— src/core/pipeline.js has 701 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/vegetation/scatter.js: 694 lines of code src/vegetation/scatter.js:1— src/vegetation/scatter.js has 694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/clouds.js: 611 lines of code src/modules/clouds.js:1— src/modules/clouds.js has 611 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/city/house.js: 603 lines of code src/city/house.js:1— src/city/house.js has 603 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/city/landmarks.js: 586 lines of code src/city/landmarks.js:1— src/city/landmarks.js has 586 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/water/surface.js: 586 lines of code src/water/surface.js:1— src/water/surface.js has 586 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/sculpt/head.js: 572 lines of code src/sculpt/head.js:1— src/sculpt/head.js has 572 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/waterfalls.js: 552 lines of code src/modules/waterfalls.js:1— src/modules/waterfalls.js has 552 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/acropolis/walls.js: 534 lines of code src/acropolis/walls.js:1— src/acropolis/walls.js has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/props/owl.js: 534 lines of code src/props/owl.js:1— src/props/owl.js has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/water/fallMesh.js: 529 lines of code src/water/fallMesh.js:1— src/water/fallMesh.js has 529 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/arch/temple.js: 524 lines of code src/arch/temple.js:1— src/arch/temple.js has 524 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/acropolis/stair.js: 504 lines of code src/acropolis/stair.js:1— src/acropolis/stair.js has 504 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/materials/stone.js: 497 lines of code src/materials/stone.js:1— src/materials/stone.js has 497 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/city.js: 491 lines of code src/modules/city.js:1— src/modules/city.js has 491 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/terrain/material.js: 489 lines of code src/terrain/material.js:1— src/terrain/material.js has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/arch/geom.js: 478 lines of code src/arch/geom.js:1— src/arch/geom.js has 478 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/vegetation/atlas.js: 466 lines of code src/vegetation/atlas.js:1— src/vegetation/atlas.js has 466 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/props/banner.js: 460 lines of code src/props/banner.js:1— src/props/banner.js has 460 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/city/buildings.js: 459 lines of code src/city/buildings.js:1— src/city/buildings.js has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/sky.js: 455 lines of code src/core/sky.js:1— src/core/sky.js has 455 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/arch/entablature.js: 451 lines of code src/arch/entablature.js:1— src/arch/entablature.js has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/temple.js: 450 lines of code src/modules/temple.js:1— src/modules/temple.js has 450 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/ruins.js: 425 lines of code src/modules/ruins.js:1— src/modules/ruins.js has 425 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/modules/acropolis.js: 413 lines of code src/modules/acropolis.js:1— src/modules/acropolis.js has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/props/urn.js: 405 lines of code src/props/urn.js:1— src/props/urn.js has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/sculpt/props.js: 402 lines of code src/sculpt/props.js:1— src/sculpt/props.js has 402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· No test, lint or typecheck script · ×1
No test, lint or typecheck script — test ✗ · lint ✗ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
Dead file (~75 LoC) src/terrain/preview.mjs— no import path from any entry point (15 application, 0 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~73 LoC) src/bake/terrain.js— no import path from any entry point (15 application, 0 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~28 LoC) src/bake/head.js— no import path from any entry point (15 application, 0 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~18 LoC) src/bake/statues.js— no import path from any entry point (15 application, 0 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~14 LoC) src/terrain/nodeworker.mjs— no import path from any entry point (15 application, 0 tooling, 1 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/bake/terrain.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Duplicated predicate src/modules/water.js:91— `Array.isArray(v) && U[k].value?.fromArray` appears character-identically in 2 files — src/modules/water.js, src/modules/waterfalls.js. 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 src/core/engine.js:251— `k < 20000 && gl.clientWaitSync(sync, 0, 0) === gl.TIMEOUT_EXPIRED` appears character-identically in 2 files — src/core/engine.js, src/video/player.js. 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 src/materials/foliage.js:254— `species === 'shrub' || species === 'thicket'` appears character-identically in 2 files — src/materials/foliage.js, src/vegetation/trees.js. 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.
redundant comment src/water/surface.js:434— "debug 16..19: direct diffuse / direct specular / indirect diffuse / indirect specular" repeats the code it sits on: 7 of its 7 words (debug, 16, 19, direct, diffuse, specular, indirect) are already in `const DBG_LIGHT = /* glsl */``. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
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.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation package.json:10— `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
Unused export 'MODULE_ORDER' src/world/index.js:4— Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Outdated (npm): puppeteer-core — puppeteer-core is pinned at 25.14.0; registry.npmjs.org publishes 25.17.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): three — three is pinned at 0.186.1; registry.npmjs.org publishes 0.187.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
doc comments repeat the names src/arch/temple.js:260— 0 of 85 documented parameters and 3 of 575 summaries in `athenaion` only repeat the member or parameter name (e.g. "Peripteral temple." for `peripteralTemple`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
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.
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.
Run 01a1e790-5c3b-78eb-9bce-cec770137855 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 2 · Warnings: 670 · Recommendations: 43 · Info: 3 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 03:32 UTC.
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.