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

block/trailblaze

Measured 16 November 2026, 22:31 UTC, at code version b5617c7

First survey, so nothing to compare with yet Knowledge freshness: not measured

Knowledge freshness is not measured: History too condensed to judge knowledge freshness.

CAI score 48.2out of 100 Weak
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 large codebase: 398,320 lines of product code in 33 projects, tests not counted · Estimated rebuild effort: about 5.9 person-years · Weakest lens: Code Health, 41.5

Findings by how serious they are

165 critical 2158 serious 680 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 22:31 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 ▸

80of 80 dimensions measured by tools.
2439of 3003 findings point to an exact file and line, so you can open each one in the code. The other 564 concern the repository as a whole, such as missing documentation.
80dimensions across 7 lenses, read from 398,320 lines of product code in 33 projects.
Chapters

Executive summary

block/trailblaze falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 48.2 out of 100 and is rated Weak, and 89 of its 165 critical findings are security problems.

Code Health, at 41.5, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the package under a licence on your banned list, worth about 2.5 points. Splitting the oversized files would lift Code Health itself, worth about 4.0 points. Raising Code Health to 70 would lift the score to about 53.7.

Seventy-four pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Five pipeline steps run downloads nobody checks, and thirty-five controls can't be used without a mouse. Pinning each tool to an exact version, checking each download against a checksum and making the controls work with a keyboard would close these risks. Fixing the weaknesses the scanner points to would fix the five security weaknesses in the code, and updating the vulnerable packages would deal with the two packages with a known security hole. The 28 form fields without a label need a label.

The product code is 398,320 lines, about €860,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 41.5 · counts for 46%Production Readiness 42.6 · counts for 25%Accessibility 59.0 · counts for 14%Performance 60.0 · counts for 8%Security and Compliance 71.7 · counts for 4%Maturity 72.9 · counts for 2%Architecture 84.8 · counts for 1%

If Code Health rose from 41.5 to 70, the lowest score rated Strong, the score would rise from 48.2 to about 53.7.

Code composition: what the lines of code are
Product code 51%Tests 49%
Rebuild cost: about €860,000 · Estimate
Cost to rebuild€290,000 to €1,400,000, for 4,774 to 15,146 hours of work, about 5.9 person-years for 3 to 12 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 48. 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.
SizeLarge: 398,320 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 Banned license finding(s) in License Compliance.
Raises the score by about 2.5 points · Low effort · License Compliance
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 4.0 points · Medium effort · Large Files
3
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Raises the score by about 3.8 points · Medium effort · Security & performance tooling

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 €860,000 to build again, about 5.9 person-years of work. Its weakest lens is Code Health, at 41.5 (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
Resolve the 1 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 2.5 points for low effort, because it clears the 1 License Compliance findings. 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 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 883,809 lines over the last 90 days, which is about 3,584,336 lines a year. At that pace, the extra work comes to an estimated 479.6 to 2877.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch :docs:generator :docs:generator :trailblaze-common :trailblaze-common :docs:generator->:trailblaze-common :trailblaze-host :trailblaze-host :docs:generator->:trailblaze-host :trailblaze-models :trailblaze-models :docs:generator->:trailblaze-models :trailblaze-quickjs-tools :trailblaze-quickjs-tools :docs:generator->:trailblaze-quickjs-tools :trailblaze-agent :trailblaze-agent :trailblaze-agent->:trailblaze-common :trailblaze-tracing :trailblaze-tracing :trailblaze-agent->:trailblaze-tracing :trailblaze-android :trailblaze-android :trailblaze-android->:trailblaze-agent :trailblaze-android->:trailblaze-common :trailblaze-android->:trailblaze-quickjs-tools :trailblaze-scripting-fetch :trailblaze-scripting-fetch :trailblaze-android->:trailblaze-scripting-fetch :trailblaze-android->:trailblaze-tracing :trailblaze-android-ondevice-mcp :trailblaze-android-ondevice-mcp :trailblaze-android-ondevice-mcp->:trailblaze-agent :trailblaze-android-ondevice-mcp->:trailblaze-common :trailblaze-android-ondevice-mcp->:trailblaze-models :trailblaze-android-ondevice-mcp->:trailblaze-tracing :trailblaze-android-test :trailblaze-android-test :trailblaze-android-test->:trailblaze-android-ondevice-mcp :trailblaze-android-test->:trailblaze-common :trailblaze-android-test->:trailblaze-quickjs-tools :trailblaze-android-test->:trailblaze-scripting-fetch :trailblaze-android-test->:trailblaze-tracing :trailblaze-capture :trailblaze-capture :trailblaze-capture->:trailblaze-common :trailblaze-common->:trailblaze-models :trailblaze-common->:trailblaze-tracing :trailblaze-compose :trailblaze-compose :trailblaze-compose->:trailblaze-agent :trailblaze-compose->:trailblaze-common :trailblaze-desktop :trailblaze-desktop :trailblaze-desktop->:trailblaze-agent :trailblaze-desktop->:trailblaze-common :trailblaze-desktop->:trailblaze-host :trailblaze-desktop->:trailblaze-models :trailblaze-report :trailblaze-report :trailblaze-desktop->:trailblaze-report :trailblaze-revyl :trailblaze-revyl :trailblaze-desktop->:trailblaze-revyl :trailblaze-server :trailblaze-server :trailblaze-desktop->:trailblaze-server :trailblaze-host->:trailblaze-agent :trailblaze-host->:trailblaze-capture :trailblaze-host->:trailblaze-common :trailblaze-host->:trailblaze-compose :trailblaze-playwright :trailblaze-playwright :trailblaze-host->:trailblaze-playwright :trailblaze-host->:trailblaze-quickjs-tools :trailblaze-host->:trailblaze-report :trailblaze-host->:trailblaze-revyl :trailblaze-host->:trailblaze-scripting-fetch :trailblaze-scripting-mcp-common :trailblaze-scripting-mcp-common :trailblaze-host->:trailblaze-scripting-mcp-common :trailblaze-scripting-subprocess :trailblaze-scripting-subprocess :trailblaze-host->:trailblaze-scripting-subprocess :trailblaze-host->:trailblaze-server :trailblaze-host->:trailblaze-tracing :trailblaze-playwright->:trailblaze-agent :trailblaze-playwright->:trailblaze-capture :trailblaze-playwright->:trailblaze-common :trailblaze-playwright->:trailblaze-tracing :trailblaze-quickjs-tools->:trailblaze-common :trailblaze-quickjs-tools->:trailblaze-models :trailblaze-report->:trailblaze-capture :trailblaze-report->:trailblaze-common :trailblaze-report->:trailblaze-models :trailblaze-report->:trailblaze-tracing :trailblaze-revyl->:trailblaze-agent :trailblaze-revyl->:trailblaze-common :trailblaze-revyl->:trailblaze-tracing :trailblaze-scripting-fetch->:trailblaze-quickjs-tools :trailblaze-scripting-mcp-common->:trailblaze-common :trailblaze-scripting-mcp-common->:trailblaze-models :trailblaze-scripting-subprocess->:trailblaze-common :trailblaze-scripting-subprocess->:trailblaze-models :trailblaze-scripting-subprocess->:trailblaze-scripting-mcp-common :trailblaze-server->:trailblaze-capture :trailblaze-server->:trailblaze-common :trailblaze-server->:trailblaze-models :trailblaze-server->:trailblaze-quickjs-tools :trailblaze-server->:trailblaze-report :trailblaze-server->:trailblaze-scripting-fetch :trailblaze-server->:trailblaze-scripting-mcp-common :trailblaze-server->:trailblaze-scripting-subprocess :trailblaze-server->:trailblaze-tracing __more__ +11 more projects

Architecture: which parts of the code depend on which

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

1181 modules, with 2125 dependencies between them. 11 loops run through 229 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1141 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 sdks.typescript.src.surveys2 trailblaze-report.src.main.resources.xyz.block.trailblaze.trailrunner.web.app3 xyz.block.trailblaze.api.waypoint4 xyz.block.trailblaze.capture.video5 xyz.block.trailblaze.mcp.android.ondevice.rpc6 xyz.block.trailblaze.toolcalls.commands7 xyz.block.trailblaze.yaml.unified8 xyz.block.trailblaze.toolcalls9 xyz.block.trailblaze.model10 xyz.block.trailblaze.host.recording11 xyz.block.trailblaze.logs.model12 xyz.block.trailblaze.compose.driver.rpc13 xyz.block.trailblaze.mcp.agent14 xyz.block.trailblaze.report.models15 xyz.block.trailblaze.report.utils16 xyz.block.trailblaze.cli17 xyz.block.trailblaze.host.rules18 xyz.block.trailblaze.scripting19 xyz.block.trailblaze.ui20 xyz.block.trailblaze.host.yaml21 xyz.block.trailblaze.host.driver22 xyz.block.trailblaze.host.ios23 xyz.block.trailblaze.host.devices24 xyz.block.trailblaze.host25 xyz.block.trailblaze.mcp26 xyz.block.trailblaze.logs.client.TrailblazeLog27 xyz.block.trailblaze.logs.client28 xyz.block.trailblaze.agent29 xyz.block.trailblaze.llm30 xyz.block.trailblaze.llm.config31 xyz.block.trailblaze.config.project32 xyz.block.trailblaze.config33 xyz.block.trailblaze.yaml34 xyz.block.trailblaze.devices35 xyz.block.trailblaze.api36 xyz.block.trailblaze37 xyz.block.trailblaze.mcp.newtools38 xyz.block.trailblaze.trailrunner39 xyz.block.trailblaze.android40 xyz.block.trailblaze.android.accessibility
1 sdks.typescript.src.surveys
2 trailblaze-report.src.main.resources.xyz.block.trailblaze.trailrunner.web.app
3 xyz.block.trailblaze.api.waypoint31
4 xyz.block.trailblaze.capture.video8
5 xyz.block.trailblaze.mcp.android.ondevice.rpc3116
6 xyz.block.trailblaze.toolcalls.commands1385221
7 xyz.block.trailblaze.yaml.unified125
8 xyz.block.trailblaze.toolcalls12721923
9 xyz.block.trailblaze.model911119
10 xyz.block.trailblaze.host.recording36312111712
11 xyz.block.trailblaze.logs.model12132
12 xyz.block.trailblaze.compose.driver.rpc69242382
13 xyz.block.trailblaze.mcp.agent284262431142
14 xyz.block.trailblaze.report.models1821211
15 xyz.block.trailblaze.report.utils16232
16 xyz.block.trailblaze.cli334543511232252228
17 xyz.block.trailblaze.host.rules148272112138181241
18 xyz.block.trailblaze.scripting15221665
19 xyz.block.trailblaze.ui11216312111121121
20 xyz.block.trailblaze.host.yaml12383211412
21 xyz.block.trailblaze.host.driver111191
22 xyz.block.trailblaze.host.ios5731310351192
23 xyz.block.trailblaze.host.devices12222144
24 xyz.block.trailblaze.host38201028113115103110101015104
25 xyz.block.trailblaze.mcp5124621112212112171
26 xyz.block.trailblaze.logs.client.TrailblazeLog4101722133113
27 xyz.block.trailblaze.logs.client717731326
28 xyz.block.trailblaze.agent2783261313
29 xyz.block.trailblaze.llm113122121
30 xyz.block.trailblaze.llm.config122
31 xyz.block.trailblaze.config.project31201
32 xyz.block.trailblaze.config1265128
33 xyz.block.trailblaze.yaml961112
34 xyz.block.trailblaze.devices1
35 xyz.block.trailblaze.api1115
36 xyz.block.trailblaze1835575
37 xyz.block.trailblaze.mcp.newtools413172325322111178
38 xyz.block.trailblaze.trailrunner84442321542122123212
39 xyz.block.trailblaze.android5741218131035
40 xyz.block.trailblaze.android.accessibility45255252
Uses a module listed above itPart of a loopThe module itself
1 sdks.typescript.src.surveys2 trailblaze-report.src.main.resources.xyz.block.trailblaze.trailrunner.web.app3 xyz.block.trailblaze.api.waypoint4 xyz.block.trailblaze.capture.video5 xyz.block.trailblaze.mcp.android.ondevice.rpc6 xyz.block.trailblaze.toolcalls.commands7 xyz.block.trailblaze.yaml.unified8 xyz.block.trailblaze.toolcalls9 xyz.block.trailblaze.model10 xyz.block.trailblaze.host.recording11 xyz.block.trailblaze.logs.model12 xyz.block.trailblaze.compose.driver.rpc13 xyz.block.trailblaze.mcp.agent14 xyz.block.trailblaze.report.models15 xyz.block.trailblaze.report.utils16 xyz.block.trailblaze.cli17 xyz.block.trailblaze.host.rules18 xyz.block.trailblaze.scripting19 xyz.block.trailblaze.ui20 xyz.block.trailblaze.host.yaml21 xyz.block.trailblaze.host.driver22 xyz.block.trailblaze.host.ios23 xyz.block.trailblaze.host.devices24 xyz.block.trailblaze.host25 xyz.block.trailblaze.mcp26 xyz.block.trailblaze.logs.client.TrailblazeLog27 xyz.block.trailblaze.logs.client28 xyz.block.trailblaze.agent29 xyz.block.trailblaze.llm30 xyz.block.trailblaze.llm.config31 xyz.block.trailblaze.config.project32 xyz.block.trailblaze.config33 xyz.block.trailblaze.yaml34 xyz.block.trailblaze.devices35 xyz.block.trailblaze.api36 xyz.block.trailblaze37 xyz.block.trailblaze.mcp.newtools38 xyz.block.trailblaze.trailrunner39 xyz.block.trailblaze.android40 xyz.block.trailblaze.android.accessibilitysdks.typescript.src.surveys1trailblaze-report.src.main.resources.xyz.block.trailblaze.trailrunner.web.app2xyz.block.trailblaze.api.waypoint3xyz.block.trailblaze.capture.video4xyz.block.trailblaze.mcp.android.ondevice.rpc5xyz.block.trailblaze.toolcalls.commands6xyz.block.trailblaze.yaml.unified7xyz.block.trailblaze.toolcalls8xyz.block.trailblaze.model9xyz.block.trailblaze.host.recording10xyz.block.trailblaze.logs.model11xyz.block.trailblaze.compose.driver.rpc12xyz.block.trailblaze.mcp.agent13xyz.block.trailblaze.report.models14xyz.block.trailblaze.report.utils15xyz.block.trailblaze.cli16xyz.block.trailblaze.host.rules17xyz.block.trailblaze.scripting18xyz.block.trailblaze.ui19xyz.block.trailblaze.host.yaml20xyz.block.trailblaze.host.driver21xyz.block.trailblaze.host.ios22xyz.block.trailblaze.host.devices23xyz.block.trailblaze.host24xyz.block.trailblaze.mcp25xyz.block.trailblaze.logs.client.TrailblazeLog26xyz.block.trailblaze.logs.client27xyz.block.trailblaze.agent28xyz.block.trailblaze.llm29xyz.block.trailblaze.llm.config30xyz.block.trailblaze.config.project31xyz.block.trailblaze.config32xyz.block.trailblaze.yaml33xyz.block.trailblaze.devices34xyz.block.trailblaze.api35xyz.block.trailblaze36xyz.block.trailblaze.mcp.newtools37xyz.block.trailblaze.trailrunner38xyz.block.trailblaze.android39xyz.block.trailblaze.android.accessibility4031831161385221125127219239111193631211171212132692423822842624311421821211162323345435112322522281482721121381812411522166511216312111121121123832114121111915731310351192122221443820102811311510311010101510451246211122121121714101722133113717731326278326131311312212112231201126512896111211115183557541317232532211117884442321542122123212574121813103545255252+1141 more modules (most-connected shown)

At a glance — Code Health · 41.5 · Weak · gated by D1, D2, R3, X4 ·

At a glance — Architecture · 84.8 · Strong ·

At a glance — Maturity · 72.9 · Strong ·

At a glance — Readiness · 42.6 · Weak · gated by P3, P7 ·

At a glance — Security · 71.7 · Adequate · gated by D29, D36 ·

At a glance — Accessibility · 59.0 · Adequate · gated by AC4 ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection98High / Critical
A03:2025 — Software Supply Chain Failures25High / Critical

Roadmap

Top priorities: Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing; Resolve the 1 Banned license finding(s) in License Compliance.

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

Do thisHelpsEffortDimension
Resolve the 1 Banned license finding(s) in License Compliance.+2.5 ptsLowLicense Compliance
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+4.0 ptsMediumLarge Files
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.8 ptsMediumSecurity & performance tooling
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).+1.8 ptsMediumOutbound HTTP resilience
Interpolated log message defeats structured logging+1.7 ptsMediumStructured logging
Kotlin: call the suspend function directly instead of wrapping it in runBlocking, use delay() instead of Thread.sleep, and move unavoidable blocking I/O into withContext(Dispatchers.IO).+1.4 ptsMediumAsync & latency hygiene
Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with run-report-viewer.RUN_REPORT_VIEWER::render (cognitive 549), run-report-extract.extractTrace (cognitive 309), steps-board.StepsBoard (cognitive 300).+1.1 ptsHighCognitive Complexity
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+1.1 ptsMediumKeyboard semantics

File quality

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

FileScoreBandWorst signal
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED

How the grades work

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

Critical — 165

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 — 2158

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 — 680

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

Could not be resolved — 11

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 80 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 — 80 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D17D19D20D21D24D26D27D28D29D30D31D35D36D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX5AX6AX9M1M2M3P1P10P2P3P4P6P7PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X23X25X26X27X28X29X3X30X4X5

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1e67c-fb66-7e5f-b294-f2762fca72a6.

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

Run transparency — what happened this run

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

  • 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: this repository's production source spans .ts, .tsx, .kt, and our analyzer cannot run the .kt test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 85.6% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D10 Test Quality — 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. The 3,113 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,398 test source file(s) (.kt) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — 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. Test reliability NOT SCORED: this repository's production source includes .kt, and the jvm executor ran against the .kt half and did not finish re-running within its tier budget — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (bun:test via `npm install --ignore-scripts` (no lockfile) in sdks/typescript/ (1091 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D12 Dependency Hygiene — 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. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either — no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Gradle tree, and its score reflects currency alone.
  • 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-maintainer repository — bus factor is not applicable (10 contributor(s) across 214 commit(s) sampled, automation and bot accounts excluded). One of them holds 86% of the history; the other 9 hold 1.6% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — 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. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — 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. `docs/generator/src/main/java/xyz/block/trailblaze/docs/LlmConfigDocsGenerator.kt`, `sdks/typescript/src/memory.ts`, `sdks/typescript/src/surveys/match.ts`, `sdks/typescript/src/surveys/phase.ts`, `sdks/typescript/src/surveys/stream.ts`, … (+99 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D34 Knowledge Freshness — git history too condensed for a reliable signal — The history looks squashed or freshly imported, so per-file ownership reflects those commits rather than real maintenance. This dimension is reported as a low-confidence advisory and is not scored.
  • AC1 Text alternatives — 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. This repository builds user interface as HTML STRINGS — 4 script file(s) building 44 markup element(s) as HTML strings, carrying 11 role/aria/tabindex attribute(s) (e.g. trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 35 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC2 Forms & labels — 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. This repository builds user interface as HTML STRINGS — 4 script file(s) building 44 markup element(s) as HTML strings, carrying 11 role/aria/tabindex attribute(s) (e.g. trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 35 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC2 Forms & labels — 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. 23 further occurrence(s) are not listed individually; the score already reflects all 63.
  • AC3 Page structure — 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. This repository builds user interface as HTML STRINGS — 4 script file(s) building 44 markup element(s) as HTML strings, carrying 11 role/aria/tabindex attribute(s) (e.g. trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 35 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC4 Keyboard semantics — 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. This repository builds user interface as HTML STRINGS — 4 script file(s) building 44 markup element(s) as HTML strings, carrying 11 role/aria/tabindex attribute(s) (e.g. trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 35 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC4 Keyboard semantics — 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. 27 further occurrence(s) are not listed individually; the score already reflects all 67.
  • AC5 ARIA correctness — 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. This repository builds user interface as HTML STRINGS — 4 script file(s) building 44 markup element(s) as HTML strings, carrying 11 role/aria/tabindex attribute(s) (e.g. trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 35 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC6 Visual & motion safety — 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. This repository builds user interface as HTML STRINGS — 4 script file(s) building 44 markup element(s) as HTML strings, carrying 11 role/aria/tabindex attribute(s) (e.g. trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 35 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC6 Visual & motion safety — 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. 16 further occurrence(s) are not listed individually; the score already reflects all 56.
  • AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is an unrecognised JSR-330 (javax.inject / jakarta.inject) container, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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. Boot via AndroidApp (trailblaze-accessibility-app). the Android app `xyz.block.trailblaze.evalapp` installed but declares no launcher activity — nothing to open.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • ED5 Idempotency — 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Kotlin, Python, Swift, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Kotlin, Python, Swift, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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. 122 further occurrence(s) are not listed individually; the score already reflects all 162.
  • 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. 493 further occurrence(s) are not listed individually; the score already reflects all 533.
  • R3 Large Files — 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. 21 further occurrence(s) are not listed individually; the score already reflects all 61.
  • X10 Duplicated predicate — 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. 80 further occurrence(s) are not listed individually; the score already reflects all 120.
  • X24 Document value interpolated into markup unescaped — 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X24 Document value interpolated into markup unescaped — 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. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • X26 Unsynchronised callback handoff — 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. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X27 Collection changed while being enumerated — 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. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X3 Exception handling — 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. 314 further occurrence(s) are not listed individually; the score already reflects all 354.
  • X7 Silent fallback defaults — 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. 1 further occurrence(s) are not listed individually; the score already reflects all 41.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • 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.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity2.7 / 10Weak✓ Tool-verified

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

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

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

505 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was steps-board.StepsBoard at 299. A further 15 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being InstrumentationUtil.inputTextByTyping at 38 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/InstrumentationUtil.kt (InstrumentationUtil.inputTextByTyping at 38), trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt (AccessibilityDeviceManager.dispatchAction at 32), trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt (AccessibilityTrailRunner.mapToAgentDriverAction at 32), trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/AdbCommandUtil.kt (AdbCommandUtil.pressKey at 31), trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/IosDriverTrailRunner.kt (IosDriverTrailRunner.mapToAgentDriverAction at 31), and 5 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

run-report-viewer.RUN_REPORT_VIEWER::render (cyclomatic 164) · ×43trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8245
record.RecordScreen::propose (cyclomatic 29) · ×2REDACTED:962
perf-viewer.PERF_VIEWER::drawBlock (cyclomatic 26) · ×2trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:331
trail-yaml.normalizeScratchTrailYaml::legacyTrailheadToUnified (cyclomatic 18) · ×2trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:236
steps-board.StepsBoard (cyclomatic 299)trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:440

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

What to do

  1. Bring the 1 body over 240 down to 240 or less in Cyclomatic Complexity — start with steps-board.StepsBoard (cyclomatic 299). — Refactoring it lifts Cyclomatic Complexity from 2.7 to about 3.1/10.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

629 method(s) exceeded the cognitive complexity threshold of 15; the worst was run-report-viewer.RUN_REPORT_VIEWER::render at 549.

run-report-viewer.RUN_REPORT_VIEWER::render (cognitive 549) · ×41trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8245
perf-viewer.PERF_VIEWER::drawBlock (cognitive 51) · ×2trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:331
record.RecordScreen::propose (cognitive 30) · ×2REDACTED:962
normalizeScratchTrailYaml::fragmentToStep (cognitive 21) · ×2trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:352
run-report-extract.extractTrace (cognitive 309)trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556

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

What to do

  1. Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with run-report-viewer.RUN_REPORT_VIEWER::render (cognitive 549), run-report-extract.extractTrace (cognitive 309), steps-board.StepsBoard (cognitive 300). — 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 10 together lifts Cognitive Complexity from 2.0 to about 3.4/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes8.4 / 10Strong✓ Tool-verified

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

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

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

206 god class(es) detected.

FileTooLong: app/run-report-viewer.ts · ×74trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts
MethodTooLong: TrailCommand.runTrail · ×52REDACTED:764
TooManyMethods: TrailblazeMcpBridgeImpl · ×29trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126
FunctionTooLong: waypoint-graph-template.html.SubwayView · ×26trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1992
ClassTooLong: TrailCommand · ×25REDACTED:126

What to do

  1. Resolve the 74 FileTooLong finding(s) in God Classes — start with run-report-viewer.ts, REDACTED, external-agents.tsx. — One of this dimension's main actionable groups (74 warning-level).
  2. Resolve the 52 MethodTooLong finding(s) in God Classes — start with REDACTED (3), TrailblazeMcpServer.kt (3), ExternalAgentRoutes.kt. — One of this dimension's main actionable groups (52 warning-level).
  3. Resolve the 29 TooManyMethods finding(s) in God Classes — start with TrailblazeMcpBridgeImpl.kt, TrailblazeDeviceManager.kt, TrailblazeAccessibilityService.kt. — One of this dimension's main actionable groups (29 warning-level).

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

D4 · Code Duplication9.0 / 10Stronggated by 364 serious findings✓ Tool-verified

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

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

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

203 duplicated block group(s) detected. 2.5 % of the production lines (9,937 of 398,320) are in a reported copy. A further 161 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 364 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (5 lines × 2) · ×20trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:276
Duplicated block (11 lines × 2) · ×16trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:53
Duplicated block (10 lines × 2) · ×15trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:151
Duplicated block (8 lines × 2) · ×14build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:140
Duplicated block (7 lines × 2) · ×14trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:538

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

What to do

  1. Resolve the 20 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with CliReportGenerator.kt (2), TrailblazeNodeSelectorGeneratorHelpers.kt (2), AndroidVectorIconRasterizer.kt. — One of this dimension's main actionable groups (20 warning-level).
  2. Resolve the 16 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with TrailblazeNodeMapperMaestro.kt, CliReportGenerator.kt, SelectorDialectLint.kt. — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 15 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with TrailMcpTool.kt (2), InteractionRecorder.kt, CliMcpClient.kt. — One of this dimension's main actionable groups (15 warning-level).

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

D5 · Coupling6.7 / 10Adequate✓ Tool-verified

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

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

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

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

31 production modules (Gradle+npm), 0 dependency cycle(s), 3 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 10 module(s) off the main sequence, with abstractness counted on 28 of the 31 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: :trailblaze-http · ×9
Unstable project :trailblaze-android-ondevice-mcp · ×3
Off the main sequence: :trailblaze-common

What to do

  1. Resolve the 9 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 3 Unstable project finding(s) in Coupling. — One of this dimension's main actionable groups (3 warning-level).

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 6 serious findings✓ Tool-verified

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

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

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

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

6 of 293 classes have LCOM4 above 3.

Low cohesion: AndroidDeviceCommandExecutor (LCOM4 10) · ×6trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/device/AndroidDeviceCommandExecutor.android.kt:23

What to do

  1. Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with AndroidDeviceCommandExecutor.android.kt, AndroidDeviceCommandExecutor.kt, TrailblazeMcpSessionContext.kt. — One of this dimension's main actionable groups (6 warning-level).

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

D10 · Test Quality10.0 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

4 skipped (4 with a documented reason), 1 zero-assertion, 1 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3113 tests. Measured on the JavaScript/TypeScript suite only — at least 1,398 test source file(s) (.kt) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: every line identical to the JVM-produced goldentrailblaze-selector-engine-js/parity/engine-parity.test.ts:159
Fixed-sleep synchronisation: waits for another run writing the same session, so neither saves over the othersdks/typescript/src/surveys/stream.test.ts:590
Skipped (documented): (unnamed test) · ×4REDACTED:84

What to do

  1. Resolve the 1 No assertions finding(s) in Test Quality — start with engine-parity.test.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Fixed-sleep synchronisation finding(s) in Test Quality — start with stream.test.ts. — One of this dimension's main actionable groups (1 warning-level).

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

D12 · Dependency Hygiene8.0 6.2 / 10Adequate✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 6.2 / 10 · rule-coverage 78% · ceiling Verified

This repository's Gradle dependency graph was RESOLVED BY A BUILD, across every subproject rather than the root alone: 786 artifact(s) resolved, 610 of them gradable against Maven Central, and 542 behind a shipped release. Where a version was requested and a different one won conflict resolution, the RESOLVED version is what is graded — grading the request would recommend an upgrade already applied. Known CVEs in the same graph are a separate question again, reported under D30.

Outdated (compile): org.jetbrains.dokka:analysis-kotlin-descriptors · ×542

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

1 of 97 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 41 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. 4 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. A further 20 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.

Banned license: com.guardsquare:proguard-gradle

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).

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

D15 · Churn × Complexity Hotspots7.6 / 10Strong✓ Tool-verified

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

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

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

Top hotspots: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts (19×4771=90649); trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts (14×198=2772); REDACTED (4×575=2300)

Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts · ×93trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:60

What to do

  1. Resolve the 93 Hotspot finding(s) in Churn × Complexity Hotspots — start with run-report-viewer.ts, run-report-extract.ts, REDACTED. — One of this dimension's main actionable groups (93 warning-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 3 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×3trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/McpContentBuilder.kt:63

What to do

  1. Resolve the 3 TodoComment finding(s) in Explicit Debt — start with McpContentBuilder.kt, TrailmapRoutes.kt, client.ts. — One of this dimension's main actionable groups (3 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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.

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

1 of 1 documentation facets pass in full. 156 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundbuild.gradle.kts:73

What to do

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

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

D21 · Naming Consistency8.4 / 10Strong✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

3 naming inconsistencies among 182 declarations measured against a convention their peers follow.

`createIOS` spells `IOS` where 49 names in the project spell it `Ios`trailblaze-host/src/main/java/xyz/block/trailblaze/host/devices/HostIosDriverFactory.kt:137
`getLLMClientForProviderIfAvailable` spells `LLM` where 45 names in the project spell it `Llm`trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/providers/TrailblazeDynamicLlmTokenProvider.kt:17
`collectIOSElements` spells `IOS` where 25 names in the project spell it `Ios`trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/ViewHierarchyFilter.kt:540

What to do

  1. Resolve the 1 `createIOS` spells `IOS` where 49 names in the project spell it `Ios` finding(s) in Naming Consistency — start with HostIosDriverFactory.kt. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `getLLMClientForProviderIfAvailable` spells `LLM` where 45 names in the… finding(s) in Naming Consistency — start with TrailblazeDynamicLlmTokenProvider.kt. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `collectIOSElements` spells `IOS` where 25 names in the project spell it… finding(s) in Naming Consistency — start with ViewHierarchyFilter.kt. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value10.0 9.9 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 99% · ceiling Documented

0 of 5863 judged comments only repeat the code they sit on (0.0 %). 62 comment(s) in another language or script were not judged.

doc comments repeat the namessdks/typescript/src/surveys/live-plan.ts:13

✓ On the Gold path — maintain.

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

D26 · Project Cohesion4.2 / 10Weak✓ Tool-verified

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

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

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

10 of 33 build units (Gradle, Python, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×10trailblaze-host/build.gradle.kts:1

What to do

  1. Resolve the 10 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with build.gradle.kts (8), package.json, build.gradle. — One of this dimension's main actionable groups (10 recommendation-level).

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

D27 · Navigability9.8 / 10Exemplary✓ Tool-verified

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

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

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

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

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

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

98 finding(s): 0 critical, 87 high, 8 medium, 3 low. 68 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 25 file(s) — `.github/actions/trailblaze/scripts/summary.sh` (line 46), `.github/showcase-trail.sh` (line 24, line 25), `gradlew` (line 74, line 178), `scripts/dev-jar-cache.sh` (line 127, line 157, line 163), `scripts/git-hooks/pre-push` (line 86), … (+20 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 6 REDACTED finding(s) charged to Static Analysis (SAST) — the other 68 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (74 issue-level, 6 of them charged here).
  2. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  3. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

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

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

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

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

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

REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

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

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

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

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

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

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

AC2 · Forms & labels5.1 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). — trailblaze-host/src/main/resources/xyz/block/trailblaze/devices/index.html:222
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×24) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:905, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:8, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:234, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:144, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:553, REDACTED:417
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:504, REDACTED:1964, REDACTED:2383, …
  • This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×4) — REDACTED:412, REDACTED:1955, REDACTED:1963, …
  • This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. (×4) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:850, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:325, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:707, …

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.7 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:2, trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1278

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics3.2 / 10Weak✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • The repo's own CSS styles .tb-pick with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:288
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×5) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:577, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:325, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:707, …
  • This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it. (×6) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:145, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:165, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:289, …
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×13) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:156, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:181, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:229, …
  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×4) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:525, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:764, REDACTED:435, …
  • This <span> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — REDACTED:1669
  • This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it. (×10) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:333, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:349, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:361, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety7.3 / 10Strong✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `.tool-runner summary::before` moves (`transition: transform .12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/devices/index.html:170
  • `.agentic-pill .agentic-icon` moves (`animation: pulse 2.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:230
  • `.matcher-entry summary::before` moves (`transition: transform 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:417
  • `.waypoint-node` moves (`transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:433
  • `.edge-label` moves (`transition: background 0.12s, color 0.12s, transform 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:555
  • `.subway-flow .react-flow__node[class*="subway-depth-"] .waypoint-node` moves (`transition: width 0.35s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1102
  • `.subway-flow .react-flow__node` moves (`transition: transform 0.6s cubic-bezier(0.34, 1.35, 0.64, 1), opacity 0.3s ease-out, filter 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1128
  • `.subway-trailhead-pill` moves (`transition: transform 0.12s, box-shadow 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1158
  • `.screen-card` moves (`transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1223
  • `.waypoint-no-screenshot` sets color: #8b94a6 on background-color: #f4f6fa — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:468
  • `.screen-card .screen-no-thumb` sets color: #8b94a6 on background-color: #f4f6fa — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1241
  • <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator. (×9) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:176, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:234, REDACTED:1956, …
  • <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator. (×9) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:905, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:8, REDACTED:217, …
  • <div> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator. (×4) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:134, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:392, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:340, …
  • <span> moves — its inline style sets `transition: transform .15s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:157, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:526
  • <div> moves — its inline style sets `transition: max-height .28s var(--ease-out-soft), opacity .2s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — REDACTED:381
  • <textarea> moves — its inline style sets `transition: min-height .25s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — REDACTED:2232
  • <div> moves — its inline style sets `transition: max-height .25s var(--ease-out-soft), opacity .2s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — REDACTED:2236
  • <div> moves — its inline style sets `transition: width .2s var(--ease-out-soft), flex-basis .2s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:338
  • <div> moves — its inline style sets `transition: opacity .2s ease, transform .2s ease` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1105

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition7.7 / 10Strong✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

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

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

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

M1 · Documentation (README)9.0 / 10Exemplary✓ Tool-verified

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

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

M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

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

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

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

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

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

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

P10 · Library API & versioning10.0 / 10Exemplary✓ Tool-verified

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

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 1 public type in `xyz.block.trailblaze.host` is marked as implementation by its own namespace, folder or name: `MaestroHostRunnerImpl` (trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:54, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:54
  • 1 public type in `xyz.block.trailblaze.mcp` is marked as implementation by its own namespace, folder or name: `TrailblazeMcpBridgeImpl` (trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126
  • 1 public type in `xyz.block.trailblaze.mcp.newtools` is marked as implementation by its own namespace, folder or name: `TrailExecutorImpl` (trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:157, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:157

What to do

  • Hide `xyz.block.trailblaze.host` (`MaestroHostRunnerImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports; Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `xyz.block.trailblaze.mcp` (`TrailblazeMcpBridgeImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports; Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `xyz.block.trailblaze.mcp.newtools` (`TrailExecutorImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports; Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability8.8 / 10Strong✓ Tool-verified

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

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

  • Only 9/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `docs/generator`, `trailblaze-android-ondevice-mcp`, `trailblaze-desktop`, `trailblaze-inprocess-apk`, `trailblaze-report` and 1 more.
  • `sdks/typescript/src/memory.ts` reports through `console.*` at line 233 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/memory.ts:233
  • `sdks/typescript/src/memory.ts` reports through `console.*` at line 252 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/memory.ts:252
  • `sdks/typescript/src/run.ts` reports through `console.*` at line 23 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/run.ts:23
  • `sdks/typescript/src/tool-core.ts` reports through `console.*` at line 409 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/tool-core.ts:409
  • `sdks/typescript/src/tool.ts` reports through `console.*` at line 292 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/tool.ts:292
  • `sdks/typescript/src/tool.ts` reports through `console.*` at line 500 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/tool.ts:500
  • `sdks/typescript/src/surveys/workspace.ts` reports through `console.*` at line 26 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/surveys/workspace.ts:26
  • `sdks/typescript/src/rpc/example.ts` reports through `console.*` at line 44 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — sdks/typescript/src/rpc/example.ts:44

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 10 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. — REDACTED:5
  • `examples/android-sample-app/trails/config/host-tools/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`. — examples/android-sample-app/trails/config/host-tools/package.json:7

What to do

  • Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — 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.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

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

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

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release. — REDACTED:81

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:572

What to do

  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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.

  • `runAll` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/SessionCleanups.kt:89
  • `execute` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/LaunchAppTrailblazeTool.kt:186
  • `runHostAgentWithOnDeviceRpc` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:458
  • `streamAndroidLiveH264AccessUnits` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/AndroidLiveFrameStream.kt:62
  • `streamIosLiveH264AccessUnits` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/IosLiveFrameStream.kt:46
  • `connect` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolHost.kt:627
  • `install` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-scripting-fetch/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/fetch/OkHttpFetchExtension.kt:149
  • `startStdioMcpServer` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3231
  • `writeFileSync` in `runSurveyCli` 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. — sdks/typescript/src/surveys/cli-main.ts:203
  • `mkdtempSync` in `ensureExtractDir` 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. — sdks/typescript/src/surveys/discover.ts:44
  • `mkdirSync` in `ensureExtractDir` 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. — sdks/typescript/src/surveys/discover.ts:45
  • `realpathSync` in `inside` 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. (×2) — sdks/typescript/src/surveys/discover.ts:60, sdks/typescript/src/surveys/discover.ts:61
  • `existsSync` in `intoExtractDir` 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. — sdks/typescript/src/surveys/discover.ts:75
  • `existsSync` in `walk` 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. (×2) — sdks/typescript/src/surveys/discover.ts:100, sdks/typescript/src/surveys/discover.ts:294
  • `statSync` in `walk` 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. (×4) — sdks/typescript/src/surveys/discover.ts:117, sdks/typescript/src/surveys/discover.ts:142, sdks/typescript/src/surveys/discover.ts:298, …
  • `readdirSync` in `walk` 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. (×2) — sdks/typescript/src/surveys/discover.ts:134, sdks/typescript/src/surveys/discover.ts:304
  • `statSync` in `extractZip` 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. — sdks/typescript/src/surveys/discover.ts:171
  • `existsSync` in `extractZip` 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. — sdks/typescript/src/surveys/discover.ts:174
  • `readdirSync` in `extractZip` 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. — sdks/typescript/src/surveys/discover.ts:174
  • `mkdirSync` in `extractZip` 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. — sdks/typescript/src/surveys/discover.ts:175
  • `existsSync` in `callback to filter` 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. — sdks/typescript/src/surveys/discover.ts:291
  • `statSync` in `callback to filter` 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. — sdks/typescript/src/surveys/discover.ts:291
  • `rmSync` in `main` 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. — sdks/typescript/src/surveys/snapshot/cli.ts:86
  • `mkdirSync` in `main` 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. — sdks/typescript/src/surveys/snapshot/cli.ts:87
  • `writeFileSync` in `main` 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. — sdks/typescript/src/surveys/snapshot/cli.ts:105
  • `existsSync` in `loadWorkspace` 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. (×2) — sdks/typescript/src/surveys/workspace.ts:55, sdks/typescript/src/surveys/workspace.ts:57
  • `statSync` in `loadWorkspace` 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. — sdks/typescript/src/surveys/workspace.ts:55

What to do

  • Kotlin: call the suspend function directly instead of wrapping it in runBlocking, use delay() instead of Thread.sleep, and move unavoidable blocking I/O into withContext(Dispatchers.IO).
  • 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.
R1 · Type Safety9.3 / 10Exemplary✓ 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.

R10 · Code Duplication8.5 / 10Strong✓ Tool-verified

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.

  • 8 duplicated blocks under the repository root have copies in at least two of the sibling directories sdks, trailblaze-host, trailblaze-report — 3 of them are reported below, and 5 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 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 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 8 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. — sdks/typescript/src/surveys/log-clock.ts:43
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:19 · REDACTED:583 — the two spans are one implementation copied and then locally edited — 1074 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:19
  • sdks/typescript/src/surveys/log-clock.ts:43 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:48 — the two spans are one implementation copied and then locally edited — 382 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. — sdks/typescript/src/surveys/log-clock.ts:43
  • sdks/typescript/src/in-process.ts:152 · sdks/typescript/src/tool.ts:408 — the two spans are one implementation copied and then locally edited — 253 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. — sdks/typescript/src/in-process.ts:152
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2553 · REDACTED:901 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2553
  • sdks/typescript/src/client.ts:571 · sdks/typescript/src/testing.ts:303 — 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. — sdks/typescript/src/client.ts:571
  • sdks/typescript/src/client.ts:653 · sdks/typescript/src/testing.ts:333 — 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. — sdks/typescript/src/client.ts:653
  • sdks/typescript/src/tool-core.ts:458 · sdks/typescript/src/tool-core.ts:516 — 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. — sdks/typescript/src/tool-core.ts:458
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:477 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:458 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:477
  • trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:13 · trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts:14 · trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts:13 — the 3 copies are spread across 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:13
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10590 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10608 — 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10590
  • REDACTED:423 · REDACTED:493 — 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. — REDACTED:423
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:378 · REDACTED:997 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:378
  • trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:17 · trails/config/trailmaps/clock/tools/clock_android_launchApp.ts:67 · trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts:18 · trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts:17 — the 4 copies are spread across 4 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. — trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:17
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2496 · REDACTED:548 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2496
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:607 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:484 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:465 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:607
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:593 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:636 — 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:593
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2933 · REDACTED:1685 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2933
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:851 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:422 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:851
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:20 · trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:54 — 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:20
  • trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:1 · trails/config/trailmaps/clock/tools/clock_clearAlarms.ts:1 · trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts:1 · trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts:1 — the 4 copies are spread across 4 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. — trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:1
  • sdks/typescript/src/client.ts:480 · sdks/typescript/src/client.ts:645 · sdks/typescript/src/testing.ts:328 — the 3 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. — sdks/typescript/src/client.ts:480
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:972 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1015 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:972
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor-sync.js:97 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/lsp-convert.js:48 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:437 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor-sync.js:97
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:714 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:758 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:714
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:386 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:562 — the two spans are one implementation copied and then locally edited — 76 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:386
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer-bundle.macro.ts:12 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell-bundle.macro.ts:11 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer-bundle.macro.ts:18 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer-bundle.macro.ts:12
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2089 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2104 — 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2089
  • sdks/typescript/src/history.ts:75 · sdks/typescript/src/session-events.ts:104 — 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. — sdks/typescript/src/history.ts:75
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:151 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:183 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:199 — all 3 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:151
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:586 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:445 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:586
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1588 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8932 — 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1588
  • sdks/typescript/src/memory.ts:405 · sdks/typescript/src/trailhead.ts:193 — 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. — sdks/typescript/src/memory.ts:405
  • sdks/typescript/tools/extract-tool-defs.mjs:598 · sdks/typescript/tools/extract-tool-defs.mjs:636 — 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. — sdks/typescript/tools/extract-tool-defs.mjs:598
  • sdks/typescript/tools/in-process-wrapper-template.mjs:25 · sdks/typescript/tools/in-process-wrapper-template.mjs:46 — 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. — sdks/typescript/tools/in-process-wrapper-template.mjs:25
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:725 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:914 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:725
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1003 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1194 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1003
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:692 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:725 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:692
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:469 · REDACTED:1049 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:469
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1035 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1134 — 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1035

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.
R11 · Import Boundaries9.1 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • sdks/typescript/src/tool.ts:12 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — sdks/typescript/src/tool.ts:12
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:56 reaches into another package with a relative path (../../../../../../../../../../../sdks/typescript/src/rpc/client) — import the package by name instead. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:56

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity5.0 / 10Adequate✓ Tool-verified

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.

  • extractTrace has cyclomatic complexity 176 and cognitive complexity 307; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556
  • RecordScreen has cyclomatic complexity 168 and cognitive complexity 158; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — REDACTED:474
  • render has cyclomatic complexity 164 and cognitive complexity 177; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8245
  • renderViewerState has cyclomatic complexity 145 and cognitive complexity 154; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:343
  • buildSummaryModel has cyclomatic complexity 109 and cognitive complexity 172; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1652
  • RunConfigDialog has cyclomatic complexity 102 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:6
  • TrailsScreen has cyclomatic complexity 82 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:6
  • renderTimeline has cyclomatic complexity 77 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3622
  • applyRoute has cyclomatic complexity 71 and cognitive complexity 148; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1994
  • SessionsScreen has cyclomatic complexity 71 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:71
  • renderCompareView has cyclomatic complexity 60 and cognitive complexity 55; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7482
  • routeParams has cyclomatic complexity 59 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2174
  • stepRowHtml has cyclomatic complexity 58 and cognitive complexity 56; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3547
  • AgentComposer has cyclomatic complexity 58 and cognitive complexity 49; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1019
  • runSurveyCli has cyclomatic complexity 56 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. — sdks/typescript/src/surveys/cli-main.ts:56
  • AgentToolCard has cyclomatic complexity 56 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2144
  • TrailheadStep has cyclomatic complexity 55 and cognitive complexity 49; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — REDACTED:334
  • onKeydown has cyclomatic complexity 54 and cognitive complexity 67; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:11041
  • buildRunMeta has cyclomatic complexity 54 and cognitive complexity 54; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:521
  • (anonymous) has cyclomatic complexity 54 and cognitive complexity 40; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — REDACTED:529
  • TrailYamlEditor has cyclomatic complexity 53 and cognitive complexity 45; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:667
  • RUN_REPORT_VIEWER has cyclomatic complexity 52 and cognitive complexity 47; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:60
  • matchesAndroidAccessibility has cyclomatic complexity 50 and cognitive complexity 51; 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. — REDACTED:335
  • txCallContext has cyclomatic complexity 48 and cognitive complexity 38; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3902
  • ToolComposer has cyclomatic complexity 48 and cognitive complexity 33; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:400
  • onTreeKeyDown has cyclomatic complexity 47 and cognitive complexity 67; 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:182
  • toolChildren has cyclomatic complexity 47 and cognitive complexity 52; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:990
  • querySelector has cyclomatic complexity 47 and cognitive complexity 46; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:658
  • TraceViewer has cyclomatic complexity 47 and cognitive complexity 42; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:72
  • querySelectorAll has cyclomatic complexity 46 and cognitive complexity 45; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:543
  • applyDetailRoute has cyclomatic complexity 46 and cognitive complexity 45; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1899
  • isInteractive has cyclomatic complexity 46 and cognitive complexity 39; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — sdks/typescript/src/matcher/driver-node-detail.ts:439
  • run has cyclomatic complexity 45 and cognitive complexity 54; 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:301
  • paintLane has cyclomatic complexity 44 and cognitive complexity 77; 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:6723
  • extractLlmLogs has cyclomatic complexity 43 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1301
  • update has cyclomatic complexity 43 and cognitive complexity 42; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:11218
  • DemoGeneratePhase has cyclomatic complexity 43 and cognitive complexity 40; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:532
  • buildTheaterStory has cyclomatic complexity 42 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. — REDACTED:400
  • readRoute has cyclomatic complexity 42 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1836
  • getElementById has cyclomatic complexity 42 and cognitive complexity 40; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:1124
R3 · Large Files0.0 / 10Critical✓ 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.

  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts has 11186 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx has 2887 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1
  • REDACTED has 2434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts has 2015 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-css.ts has 1973 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-css.ts:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts has 1842 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts has 1746 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts has 1428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts has 1337 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx has 1258 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts has 1253 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx has 1249 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1
  • REDACTED has 1209 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js has 1074 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:1
  • sdks/typescript/tools/extract-tool-defs.mjs has 1066 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/tools/extract-tool-defs.mjs:1
  • REDACTED has 987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts has 983 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx has 975 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:1
  • sdks/typescript/src/client.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/src/client.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts has 944 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx has 925 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx has 913 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts has 840 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx has 833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:1
  • sdks/typescript/src/surveys/session.ts has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/src/surveys/session.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx has 807 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js has 778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:1
  • sdks/typescript/src/tool.ts has 769 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/src/tool.ts:1
  • sdks/typescript/src/surveys/live.ts has 718 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/src/surveys/live.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx has 689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx has 645 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx has 613 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts has 597 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx has 583 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage7.7 / 10Strong✓ 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. (×40) — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1, REDACTED:1, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling6.7 / 10Adequate✓ 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 eslint as package.json scripts and run them in CI.
R7 · Dead Code9.8 / 10Exemplary✓ 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 216 application, 8 tooling and 86 test entry point(s) detected in this repo. Gate removals on `npm run typecheck` — an undetected custom entry would make these reachable.
  • no import path from any entry point (216 application, 8 tooling, 86 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 (×6) — trails/config/trailmaps/clock/tools/clock_android_launchApp.ts, trails/config/trailmaps/clock/tools/clock_clearAlarms.ts, trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts, …
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×3) — sdks/typescript/src/built-in-tools.ts:64, sdks/typescript/src/built-in-tools.ts:65, sdks/typescript/src/tool.test.ts:64

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene6.0 / 10Adequate✓ Tool-verified

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.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. — sdks/typescript/tools/in-process-wrapper-template.mjs:2
  • Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×4) — sdks/typescript/package.json:52, sdks/typescript/package.json:53, sdks/typescript/package.json:54, …

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports8.1 / 10Strong✓ Tool-verified

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.

  • sdks/typescript/src/surveys/cli-main.ts → sdks/typescript/src/surveys/discover.ts → sdks/typescript/src/surveys/index.ts → sdks/typescript/src/surveys/cli-main.ts (one verified cycle inside a mutually-dependent group of 4 files) — sdks/typescript/src/surveys/cli-main.ts:9

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `https://unpkg.com/react@18.3.1/umd/react.production.min.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 11 such include(s) across the repository's markup. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/index.html:20

What to do

  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
X1 · Async correctness8.0 / 10Strong✓ Tool-verified

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

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

  • This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`. (×2) — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:96, trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:128

What to do

  • Blocking `Thread.sleep` inside a coroutine
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader3.5 / 10Weak✓ Tool-verified

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

  • `stringCount` is read from the bytes being parsed at line 134 (`int`), then used to size a `IntArray` at line 140 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating. — trailblaze-inprocess-apk/src/main/kotlin/xyz/block/trailblaze/inprocess/apk/AndroidBinaryXml.kt:140

What to do

  • Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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.

X17 · Uncapped recursion over a caller-supplied document1.9 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `YamlJsonBridge.jsonElementToSerializable` is public and takes `jsonElement: JsonElement` from its caller, and it calls itself at line 51 with a piece of `jsonElement` (and at line 52) — the function is not `tailrec`, so every call is a real frame — and nowhere in `YamlJsonBridge.jsonElementToSerializable` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `YamlJsonBridge.jsonElementToSerializable` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/logs/client/temp/YamlJsonBridge.kt:51
  • `eventLines` is exported, takes a document from its caller (line 906) and hands it to `emit`, which calls itself at line 913 (`emit`) with a piece of `v` (and at line 918) — and nowhere in `emit` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `emit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:913
  • `mergeWebHierarchyBounds` is exported, takes a document from its caller (line 447) and hands it to `compatible`, which calls itself at line 471 (`compatible`) with a piece of `a` — and nowhere in `compatible` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `compatible` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:471
  • `mergeWebHierarchyBounds` is exported, takes a document from its caller (line 447) and hands it to `graft`, which calls itself at line 481 (`graft`) with a piece of `a` — and nowhere in `graft` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `graft` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:481
  • `inspectorModel` is exported, takes a document from its caller (line 158) and hands it to `walk`, which calls itself at line 179 (`walk`) with a piece of `raw` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:179
  • `jsonToYaml` is exported, takes a document from its caller (line 275) and hands it to `append`, which calls itself at line 292 (`append`) with a piece of `element` (and at line 305, line 308) — and nowhere in `append` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `append` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:292
  • `findAttachmentRefs` is exported, takes a document from its caller (line 246) and hands it to `walk`, which calls itself at line 250 (`walk`) with a piece of `v` (and at line 253) — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:250
  • `interpolateVariablesInJson` is public and takes `element: JsonElement` from its caller, and it calls itself at line 504 with a piece of `element` (and at line 507) — the function is not `tailrec`, so every call is a real frame — and nowhere in `interpolateVariablesInJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `interpolateVariablesInJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/AgentMemory.kt:504
  • `withCredentialFieldsMasked` is public and takes its `JsonElement` receiver from its caller, and it calls itself at line 32 with a piece of its receiver (and at line 35) — the function is not `tailrec`, so every call is a real frame — and nowhere in `withCredentialFieldsMasked` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `withCredentialFieldsMasked` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/CredentialFieldNames.kt:32
  • `AttachmentRef.findAll` is public, takes a document from its caller (line 119) and hands it to `walk`, which calls itself at line 125 with a piece of `el` (and at line 127) — the function is not `tailrec`, so every call is a real frame — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/events/AttachmentRef.kt:125
  • `callTool` is public and takes `arguments: Map<String, Any ?>` from its caller, and it calls itself at line 222 with a piece of `arguments` — the function is not `tailrec`, so every call is a real frame — and nowhere in `callTool` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `callTool` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:222
  • `KeyValueParser.jsonElementToAny` is public and takes `element: JsonElement` from its caller, and it calls itself at line 97 with a piece of `element` (and at line 98) — the function is not `tailrec`, so every call is a real frame — and nowhere in `KeyValueParser.jsonElementToAny` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `KeyValueParser.jsonElementToAny` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/KeyValueParser.kt:97
  • `TrailheadMatchKey.digestArgs` is public, takes a document from its caller (line 53) and hands it to `TrailheadMatchKey.canonicalJson`, which calls itself at line 66 with a piece of `element` — the function is not `tailrec`, so every call is a real frame — and nowhere in `TrailheadMatchKey.canonicalJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `TrailheadMatchKey.canonicalJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/trailhead/TrailheadHandoffStore.kt:66
  • `toolDecodeFailureReason` is public, takes a document from its caller (line 15) and hands it to `collect`, which calls itself at line 19 with a piece of `value` (and at line 20) — the function is not `tailrec`, so every call is a real frame — and nowhere in `collect` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `collect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolDecodeFailure.kt:19
  • `scrubSensitivePayload` is public and takes `payload: JsonElement` from its caller, and it calls itself at line 265 with a piece of `payload` (and at line 268) — the function is not `tailrec`, so every call is a real frame — and nowhere in `scrubSensitivePayload` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `scrubSensitivePayload` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolMemoryInterpolation.kt:265
  • `maestroLaunchArgumentSecrets` is public and takes `value: JsonElement` from its caller, and it calls itself at line 45 with a piece of `value` (and at line 48) — the function is not `tailrec`, so every call is a real frame — and nowhere in `maestroLaunchArgumentSecrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `maestroLaunchArgumentSecrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:45
  • `maestroLaunchArgumentSecrets` is public, takes a document from its caller (line 38) and hands it to `argumentValues`, which calls itself at line 60 with a piece of `value` (and at line 61) — the function is not `tailrec`, so every call is a real frame — and nowhere in `argumentValues` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `argumentValues` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:60
  • `maestroAuthoredLaunchLiterals` is public, takes a document from its caller (line 67) and hands it to `authoredLaunchArgumentPairs`, which calls itself at line 106 with a piece of `authored` (and at line 109) — the function is not `tailrec`, so every call is a real frame — and nowhere in `authoredLaunchArgumentPairs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `authoredLaunchArgumentPairs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:106
  • `withKnownMaestroLaunchValuesRedacted` is public, takes a document from its caller (line 129) and hands it to `scrubKnownValues`, which calls itself at line 145 with a piece of `value` (and at line 148) — the function is not `tailrec`, so every call is a real frame — and nowhere in `scrubKnownValues` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `scrubKnownValues` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:145
  • `withMaestroLaunchArgumentsRedacted` is public, takes a document from its caller (line 121) and hands it to `redactLaunches`, which calls itself at line 191 with a piece of `value` (and at line 202, line 204, line 207) — the function is not `tailrec`, so every call is a real frame — and nowhere in `redactLaunches` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `redactLaunches` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:191
  • `EventStreamScanner.needlesFor` is public, takes a document from its caller (line 253) and hands it to `EventStreamScanner.collect`, which calls itself at line 266 with a piece of `element` — the function is not `tailrec`, so every call is a real frame — and nowhere in `EventStreamScanner.collect` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `EventStreamScanner.collect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:266
  • `ScriptedToolSchemaRefFlattener.flatten` is public, takes a document from its caller (line 65) and hands it to `ScriptedToolSchemaRefFlattener.resolveObject`, which calls itself at line 108 with a piece of `node` — the function is not `tailrec`, so every call is a real frame — and nowhere in `ScriptedToolSchemaRefFlattener.resolveObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `ScriptedToolSchemaRefFlattener.resolveObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — trailblaze-common/src/commonMain/kotlin/xyz/block/trailblaze/scripting/ScriptedToolSchemaRefFlattener.kt:108
  • `redactSecrets` is exported and takes `args: Record<string, unknown>` from its caller, and it calls itself at line 77 (`redactSecrets`) with a piece of `args` (and at line 78) — and nowhere in `redactSecrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `redactSecrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/surveys/parse.ts:77
  • `matchNode` is exported and takes `node: HierarchyNode` from its caller, and it calls itself at line 168 (`matchNode`) with a piece of `node` — and nowhere in `matchNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `matchNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:168
  • `anyNode` is exported and takes `root: HierarchyNode` from its caller, and it calls itself at line 175 (`anyNode`) with a piece of `root` — and nowhere in `anyNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `anyNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:175
  • `matchScreen` is exported, takes a document from its caller (line 187) and hands it to `unverifiable`, which calls itself at line 199 (`unverifiable`) with a piece of `sel` — and nowhere in `unverifiable` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `unverifiable` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:199
  • `redactDeep` is exported and takes `v: unknown` from its caller, and it calls itself at line 37 (`redactDeep`) with a piece of `v` (and at line 44) — and nowhere in `redactDeep` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `redactDeep` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/surveys/snapshot/redact.ts:37
  • `withRefs` is exported and takes `node: TrailblazeNode` from its caller, and it calls itself at line 125 (`withRefs`) with a piece of `node` — and nowhere in `withRefs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `withRefs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/matcher/trailblaze-node.ts:125
  • `aggregate` is exported, takes a document from its caller (line 133) and hands it to `aggregateInto`, which calls itself at line 144 (`aggregateInto`) with a piece of `node` — and nowhere in `aggregateInto` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `aggregateInto` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/matcher/trailblaze-node.ts:144
  • `findFirst` is exported and takes `node: TrailblazeNode` from its caller, and it calls itself at line 167 (`findFirst`) with a piece of `node` — and nowhere in `findFirst` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `findFirst` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/matcher/trailblaze-node.ts:167
  • `findAllNodes` is exported, takes a document from its caller (line 180) and hands it to `findAllInto`, which calls itself at line 196 (`findAllInto`) with a piece of `node` — and nowhere in `findAllInto` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `findAllInto` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/matcher/trailblaze-node.ts:196
  • `hitTest` is exported, takes a document from its caller (line 218) and hands it to `visit`, which calls itself at line 269 (`visit`) with a piece of `node` — and nowhere in `visit` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `visit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/matcher/trailblaze-node.ts:269

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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.

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

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

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

X2 · Cancellation propagation6.4 / 10Adequate✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on an AbortSignal or the coroutine's cancellation (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 26/64 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; Ktor, OkHttp newCall, URL streams) accept an AbortSignal or the coroutine's cancellation or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` () and hand it to the request; in a Kotlin suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `executeFetch` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — trailblaze-scripting-fetch/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/fetch/OkHttpFetchExtension.kt:173
  • `safeJson` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:112
  • `safeText` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:122
  • `importSessionArchive` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:616
  • `reviewSession` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:676
  • `createBundle` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:693
  • `deleteTrailFolder` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:712
  • `revealTrailFolder` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:725
  • `saveTrailFolderFile` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:741
  • `deleteTrailFolderFile` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:754
  • `recordTrailFolder` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:766
  • `recordTrailRange` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:784
  • `recordScreen` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:816
  • `recordTree` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:876
  • `recordSelectorAdvice` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:891
  • `recordDisconnect` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:903
  • `recordToolParams` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:914
  • `scriptedToolParams` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:926
  • `toolToolUsages` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:940
  • `toolToolUsageCounts` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:951
  • `cancelExternalAgent` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:998
  • `replyExternalAgent` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1007
  • `demoMarkStart` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1041
  • `demoFinish` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1054
  • `demoGenerate` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1067
  • `demoDeleteStep` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1082
  • `demoAddPlatform` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1098
  • `demoRevealBundle` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1113
  • `decideExternalAgentPermission` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1126
  • `setExternalAgentAutoApprove` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1141
  • `fetchTrailContent` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1156
  • `companionRevealFolder` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1189
  • `companionOpenFile` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1200
  • `companionUserAction` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1214
  • `companionSaveRecording` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1237
  • `saveRunShareHtml` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/share-export.tsx:27
  • `rpc` 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 })`. — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:88
  • `downloadToTempFile` suspends, but makes its request with `URL(…).openStream()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/MobileDeviceUtils.kt:357

What to do

  • Thread an AbortSignal or the coroutine's cancellation through functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. 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 `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

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

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

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

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

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.

X3 · Exception handling5.2 / 10Adequate✓ Tool-verified

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

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

  • 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. (×15) — trails/config/trailmaps/clock/tools/clock_android_launchApp.ts:65, trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:134, trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:198, …
  • `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailFormatYaml.kt:361, trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailFormatYaml.kt:519, trailblaze-trail-format/src/androidMain/kotlin/xyz/block/trailblaze/util/Console.android.kt:32, …
  • `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×17) — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/HttpRequestUtils.kt:64, trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/RpcScreenStateAdapter.kt:204, trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ConfigToolSet.kt:159, …
  • `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:316
  • `.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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:543
  • `.then(…, () => {})` 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. — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1563

What to do

  • Swallowed exception (empty catch)
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.

X4 · Structured logging3.5 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. 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 `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `debug` at line 103 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/AssertionLogger.kt:103

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.9 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.

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

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

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

LensScoreRatingImpact
Code Health41.5Weak — gated by D1, D2, R3, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture84.8StrongStrongest area.
Maturity72.9StrongSolid.
Readiness42.6Weak — gated by P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security71.7Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility59.0Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 4 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.

  • SC1 Supply-chain hygiene — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 44 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.

  • AX1 Captive dependencies — 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
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the Android app `xyz.block.trailblaze.evalapp` installed but declares no launcher activity — nothing to open This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
  • 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 Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no data at rest for these controls to protect.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named column (email, first_name, date_of_birth, phone_number, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • 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.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Kotlin surface was not measured.
  • 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
  • D32 Data Compliance (PII/GDPR) — 104 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D34 Knowledge Freshness — history too condensed to judge knowledge freshness
  • 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.
  • 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 — polyglot repository, one half has no runner
  • DM1 Domain Modelling — applicable but not scored (4 signals for this style, 3 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (entities that raise its domain events); 4 strongly-typed id(s); 1285 value object(s); 42 domain event(s); no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — Not assessed, and this one is on us: 33 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • M4 Documentation accuracy — Not applicable: the 155 current-state document(s) make no claim of a kind M4 checks. 543 claim(s) of kinds M4 does not check were not checked (path 257, command argument 15, environment variable 213, setting 1, package 47, route 10); M4 checks only links and versions and artefact counts.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 165 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, 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.
  • R5 Dependency Freshness — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 21% of this repository's production lines — kotlin (320,651 lines), swift (484 lines), objectivec (84 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 165 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 49 more in this group — see findings.md.
AC2 · Forms & labels · <input> without a programmatic label · ×18
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:905 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:8 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:326 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:437 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:497 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:504 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:506 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:540 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:541 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:577 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:217 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:1875 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:2113 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:2443 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:2481 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:348 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx:53 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx:149 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Clickable role="button" that no keyboard user can reach · ×16
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:145 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:165 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:289 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:333 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:349 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:361 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:711 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:747 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:768 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:815 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:828 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:862 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1092 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1131 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1135 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
  • Clickable role="button" that no keyboard user can reach trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1248 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×15
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:577 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:156 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:505 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:322 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:328 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2208 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> REDACTED:360 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> REDACTED:2157 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:749 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:850 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:855 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:325 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:707 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:824 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1058 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels · <textarea> without a programmatic label · ×10
  • <textarea> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:234 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:506 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:512 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1293 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label REDACTED:1956 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label REDACTED:1964 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label REDACTED:2232 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label REDACTED:2345 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label REDACTED:2383 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1018 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <label> that labels no control · ×4
  • <label> that labels no control REDACTED:412 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:1955 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:1963 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:2344 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · Custom control with no accessible name on <div> · ×4
  • Custom control with no accessible name on <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:850 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
  • Custom control with no accessible name on <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:325 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
  • Custom control with no accessible name on <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:707 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
  • Custom control with no accessible name on <div> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:824 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <span> · ×2
  • Click handler on a non-interactive <span> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:181 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <span> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:229 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×2
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <button> with no accessible text · ×1
  • <button> with no accessible text trailblaze-host/src/main/resources/xyz/block/trailblaze/devices/index.html:222 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×1
  • Clickable element isn't keyboard-operable trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:288 — The repo's own CSS styles .tb-pick with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Click handler on a non-interactive <img> · ×1
  • Click handler on a non-interactive <img> trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2193 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics · Focusable <span> isn't keyboard-operable · ×1
  • Focusable <span> isn't keyboard-operable REDACTED:1669 — This <span> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
D14 · License Compliance · Banned license · ×1
  • Banned license: com.guardsquare:proguard-gradle — `com.guardsquare:proguard-gradle` 7.8.2 is published on Maven Central under `GPL-2.0`, which this policy bans, and this repository declares it in a Maven or Gradle manifest. The licence was read from the artifact's POM `<licenses>` block — following `<parent>` where the POM inherits them — and normalised to SPDX before it was judged, because Maven publishes the name as free text (`GNU Affero General Public License v3` is AGPL-3.0). Where a POM lists several licences they are read as a CHOICE, per Maven's own documentation, so this is charged only because EVERY listed licence is banned. Replace the dependency, or record an accepted exception.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '__TRAILBLAZE_IMPORT_SOURCE__' · ×1
  • Unlisted import '__TRAILBLAZE_IMPORT_SOURCE__' sdks/typescript/tools/in-process-wrapper-template.mjs:2 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) sdks/typescript/src/surveys/cli-main.ts:9 — sdks/typescript/src/surveys/cli-main.ts → sdks/typescript/src/surveys/discover.ts → sdks/typescript/src/surveys/index.ts → sdks/typescript/src/surveys/cli-main.ts (one verified cycle inside a mutually-dependent group of 4 files)
Serious — 2158 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×93
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:60 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 4771 in run-report-viewer.RUN_REPORT_VIEWER at line 60. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 198 in run-report-extract.extractTrace at line 556. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:474 — REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 575 in record.RecordScreen at line 474. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:6 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 221 in runconfig.RunConfigDialog at line 6. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt:1017 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in DesktopYamlRunner.runYaml at line 1017. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:771 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in run-report-shell.RUN_REPORT_SHELL at line 771. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:764 — REDACTED changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in TrailCommand.runTrail at line 764. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:521 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in zip-report-core.buildRunMeta at line 521. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:126 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 258 in perf-viewer.PERF_VIEWER at line 126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:322 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in StepToolSet.step at line 322. 1 of those changes was a fix/bug commit, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:6 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 189 in trails.TrailsScreen at line 6. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:262 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 135 in trail-detail.UnifiedStepsBoard at line 262. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt:272 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in TrailblazeRecordingGeneratorKt.generateRecordedTrailItems at line 272. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:372 — trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in TrailblazeMcpBridgeImpl.selectDevice at line 372. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:747 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in shell.App at line 747. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:458 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc at line 458. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:71 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in sessions.SessionsScreen at line 71. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:187 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in DeviceManagerToolSet.device at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt:776 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in ReportCommandKt.generateSessionReport at line 776. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:936 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in TrailblazeAccessibilityService.awaitTreeStable at line 936. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1652 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in run-report-summary-model.buildSummaryModel at line 1652. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2587 — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in TrailblazeMcpServer.registerToolsLocked at line 2587. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:978 — trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in UnifiedTrailAdapter.mergeRecordedClassifier at line 978. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:928 — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in run-report-cli.main at line 928. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDesktopApp.kt trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDesktopApp.kt:203 — trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDesktopApp.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in TrailblazeDesktopApp.handleCliRunRequest at line 203. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 12:31:18 -05:00' --until='2026-11-12 12:31:18 -05:00' --full-history --no-merges -- trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDesktopApp.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 68 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×74
  • FileTooLong: app/run-report-viewer.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts — FileTooLong — 7288 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6788 over it, 14.58× 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: REDACTED REDACTED — FileTooLong — 2206 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: TrailCommand (126-4299). The bar is 500 significant lines; this is 1706 over it, 4.41× 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: screens/external-agents.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx — FileTooLong — 2078 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1578 over it, 4.16× 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: trailrunner/ExternalAgentSupervisor.kt trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentSupervisor.kt — FileTooLong — 1985 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1485 over it, 3.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1910 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1410 over it, 3.82× 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: mcp/TrailblazeMcpBridgeImpl.kt trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt — FileTooLong — 1756 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TrailblazeMcpBridgeImpl (126-3612). The bar is 500 significant lines; this is 1256 over it, 3.51× 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: yaml/DesktopYamlRunner.kt trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt — FileTooLong — 1691 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: DesktopYamlRunner (111-3217). The bar is 500 significant lines; this is 1191 over it, 3.38× 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: server/TrailblazeMcpServer.kt trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt — FileTooLong — 1646 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: TrailblazeMcpServer (211-3483). The bar is 500 significant lines; this is 1146 over it, 3.29× 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: app/run-report-summary-model.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts — FileTooLong — 1519 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1019 over it, 3.04× 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: app/run-report-summary.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts — FileTooLong — 1414 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 914 over it, 2.83× 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: graph/waypoint-graph-template.html trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html — FileTooLong — 1392 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 892 over it, 2.78× 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: accessibility/TrailblazeAccessibilityService.kt trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt — FileTooLong — 1318 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: TrailblazeAccessibilityService (62-2783). The bar is 500 significant lines; this is 818 over it, 2.64× 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: cli/CliInfrastructure.kt trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt — FileTooLong — 1254 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 754 over it, 2.51× 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: ui/TrailblazeDeviceManager.kt trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDeviceManager.kt — FileTooLong — 1218 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 718 over it, 2.44× 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: playwright/PlaywrightScreenState.kt trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt — FileTooLong — 1194 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 694 over it, 2.39× 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: app/run-report-extract.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts — FileTooLong — 1070 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 570 over it, 2.14× 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: app/run-report-theater.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts — FileTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 520 over it, 2.04× 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: cli/SessionCommand.kt trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt — FileTooLong — 987 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 487 over it, 1.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: host/TrailblazeHostYamlRunner.kt trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt — FileTooLong — 986 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 486 over it, 1.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: screens/steps-board.tsx trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx — FileTooLong — 972 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 472 over it, 1.94× 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: project/TrailblazeProjectConfigLoader.kt trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeProjectConfigLoader.kt — FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 408 over it, 1.82× 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: cli/CheckCommand.kt trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt — FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 408 over it, 1.82× 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: kotlin/TrailblazeBundledConfigTasks.kt build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt — FileTooLong — 887 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: TrailmapTargetGenerator (243-1698). The bar is 500 significant lines; this is 387 over it, 1.77× 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: app/run-report-compare-model.ts trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts — FileTooLong — 884 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 384 over it, 1.77× 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: REDACTED REDACTED — FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 379 over it, 1.76× 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.
  • + 49 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×52
  • MethodTooLong: TrailCommand.runTrail REDACTED:764 — MethodTooLong — runTrail runs 306 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 206 over it, 3.06× 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: ExternalAgentRoutesKt.externalAgentRoutes trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:60 — MethodTooLong — externalAgentRoutes runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.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.
  • MethodTooLong: TrailblazeMcpServer.registerToolsLocked trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2587 — MethodTooLong — registerToolsLocked runs 234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× 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: RevylHostDriverDescriptor.runRevylYaml trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:149 — MethodTooLong — runRevylYaml runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.26× 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: TrailblazeMcpServer.startStreamableHttpMcpServer trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2093 — MethodTooLong — startStreamableHttpMcpServer runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× 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: StepToolSet.step trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:322 — MethodTooLong — step 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.
  • MethodTooLong: SessionRoutesKt.sessionRoutes trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:291 — MethodTooLong — sessionRoutes runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× 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: ComposeHostDriverDescriptor.runComposeYaml trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:164 — MethodTooLong — runComposeYaml runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× 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: RunYamlRequestHandler.handle trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/RunYamlRequestHandler.kt:192 — MethodTooLong — handle runs 206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 106 over it, 2.06× 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: ReportCommandKt.generateSessionReport trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt:776 — MethodTooLong — generateSessionReport runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× 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: KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mcp/agent/KoogStrategyGraphHostRunner.kt:70 — MethodTooLong — runPromptsWithKoogStrategyGraph runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× 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: Companion.fromLogs trailblaze-report/src/main/java/xyz/block/trailblaze/report/models/SessionSummary.kt:65 — MethodTooLong — fromLogs runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/HostAndroidDeviceConnectUtils.kt:433 — MethodTooLong — connectToInstrumentationExclusive 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.
  • MethodTooLong: GenerateTestResultsCliCommand.run trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:192 — MethodTooLong — run 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.
  • MethodTooLong: TrailCommand.delegateToDaemon REDACTED:1365 — MethodTooLong — delegateToDaemon runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× 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: TrailblazeRecordingGeneratorKt.generateRecordedTrailItems trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt:272 — MethodTooLong — generateRecordedTrailItems runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× 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: CompanionRoutesKt.companionRoutes trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/CompanionRoutes.kt:31 — MethodTooLong — companionRoutes 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.
  • MethodTooLong: RecordRoutesKt.recordRoutes trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:99 — MethodTooLong — recordRoutes 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.
  • MethodTooLong: UnifiedTrailAdapter.mergeRecordedClassifier trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:978 — MethodTooLong — mergeRecordedClassifier 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.
  • MethodTooLong: BlazeRoutesKt.blazeRoutes trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/BlazeRoutes.kt:31 — MethodTooLong — blazeRoutes runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× 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: TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:1776 — MethodTooLong — addToolsAsMcpToolsFromRegistry runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: WaypointMigrateTrailCommand.call trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointMigrateTrailCommand.kt:183 — MethodTooLong — call runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× 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: QuickJsToolHost.evaluateMemberOnEngine trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolHost.kt:241 — MethodTooLong — evaluateMemberOnEngine runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× 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: DeviceManagerToolSet.device trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:187 — MethodTooLong — device runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.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.
  • MethodTooLong: IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/IosViewHierarchyFilter.kt:42 — MethodTooLong — findVisibleViewHierarchyTreeNodes runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× 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.
  • + 27 more in this group — see findings.md.
D1 · Cyclomatic Complexity · run-report-viewer.RUN_REPORT_VIEWER · ×43
  • run-report-viewer.RUN_REPORT_VIEWER::render (cyclomatic 164) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8245 — run-report-viewer.RUN_REPORT_VIEWER::render has cyclomatic complexity 164 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderTimeline (cyclomatic 78) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3622 — run-report-viewer.RUN_REPORT_VIEWER::renderTimeline has cyclomatic complexity 78 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::applyRoute (cyclomatic 68) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1994 — run-report-viewer.RUN_REPORT_VIEWER::applyRoute has cyclomatic complexity 68 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderCompareView (cyclomatic 65) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7482 — run-report-viewer.RUN_REPORT_VIEWER::renderCompareView has cyclomatic complexity 65 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::routeParams (cyclomatic 59) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2174 — run-report-viewer.RUN_REPORT_VIEWER::routeParams 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::stepRowHtml (cyclomatic 58) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3547 — run-report-viewer.RUN_REPORT_VIEWER::stepRowHtml 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::wire (cyclomatic 58) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10132 — run-report-viewer.RUN_REPORT_VIEWER::wire has cyclomatic complexity 58 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::onKeydown (cyclomatic 54) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:11041 — run-report-viewer.RUN_REPORT_VIEWER::onKeydown has cyclomatic complexity 54 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::txCallContext (cyclomatic 49) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3902 — run-report-viewer.RUN_REPORT_VIEWER::txCallContext 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::applyDetailRoute (cyclomatic 46) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1899 — run-report-viewer.RUN_REPORT_VIEWER::applyDetailRoute has cyclomatic complexity 46 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay::paintLane (cyclomatic 44) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:6723 — run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay::paintLane has cyclomatic complexity 44 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::readRoute (cyclomatic 42) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1836 — run-report-viewer.RUN_REPORT_VIEWER::readRoute has cyclomatic complexity 42 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay (cyclomatic 40) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:6341 — run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay has cyclomatic complexity 40 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail (cyclomatic 38) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1675 — run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail has cyclomatic complexity 38 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::readRoute, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::playTimeline::paintAt (cyclomatic 36) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:9945 — run-report-viewer.RUN_REPORT_VIEWER::playTimeline::paintAt 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::paintTimelinePane (cyclomatic 35) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:9756 — run-report-viewer.RUN_REPORT_VIEWER::paintTimelinePane 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderFailureSummary (cyclomatic 33) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2525 — run-report-viewer.RUN_REPORT_VIEWER::renderFailureSummary has cyclomatic complexity 33 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::scrubberHtml (cyclomatic 29) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3379 — run-report-viewer.RUN_REPORT_VIEWER::scrubberHtml has cyclomatic complexity 29 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::compareStepAnchors (cyclomatic 29) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7389 — run-report-viewer.RUN_REPORT_VIEWER::compareStepAnchors has cyclomatic complexity 29 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::parseFailure (cyclomatic 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2434 — run-report-viewer.RUN_REPORT_VIEWER::parseFailure has cyclomatic complexity 25 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::txHeaderHtml (cyclomatic 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8727 — run-report-viewer.RUN_REPORT_VIEWER::txHeaderHtml 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::timelinePaneView (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2781 — run-report-viewer.RUN_REPORT_VIEWER::timelinePaneView has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderCompareView::manyEventSection (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7931 — run-report-viewer.RUN_REPORT_VIEWER::renderCompareView::manyEventSection has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::failureMessageHtml (cyclomatic 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2464 — run-report-viewer.RUN_REPORT_VIEWER::failureMessageHtml 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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • run-report-viewer.RUN_REPORT_VIEWER::shotClipMark (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:733 — run-report-viewer.RUN_REPORT_VIEWER::shotClipMark has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, run-report-viewer.RUN_REPORT_VIEWER::readRoute, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
  • + 18 more in this group — see findings.md.
D2 · Cognitive Complexity · run-report-viewer.RUN_REPORT_VIEWER · ×41
  • run-report-viewer.RUN_REPORT_VIEWER::render (cognitive 549) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8245 — run-report-viewer.RUN_REPORT_VIEWER::render has cognitive complexity 549 (threshold 15). Drivers by points: ternaries 72 (466 pts), boolean chains 52, if/else 22 (31 pts) (nesting depth added 403). 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::routeParams (cognitive 132) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2174 — run-report-viewer.RUN_REPORT_VIEWER::routeParams has cognitive complexity 132 (threshold 15). Drivers by points: if/else 37 (94 pts), ternaries 7 (23 pts), boolean chains 15 (nesting depth added 73). 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::applyRoute (cognitive 114) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1994 — run-report-viewer.RUN_REPORT_VIEWER::applyRoute has cognitive complexity 114 (threshold 15). Drivers by points: ternaries 18 (56 pts), if/else 22 (41 pts), boolean chains 17 (nesting depth added 57). 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderTimeline (cognitive 97) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3622 — run-report-viewer.RUN_REPORT_VIEWER::renderTimeline has cognitive complexity 97 (threshold 15). Drivers by points: ternaries 38 (76 pts), boolean chains 18, if/else 3 (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderCompareView (cognitive 91) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7482 — run-report-viewer.RUN_REPORT_VIEWER::renderCompareView has cognitive complexity 91 (threshold 15). Drivers by points: ternaries 34 (64 pts), boolean chains 22, if/else 4 (5 pts) (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::stepRowHtml (cognitive 70) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3547 — run-report-viewer.RUN_REPORT_VIEWER::stepRowHtml has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 42 (57 pts), boolean chains 12, if/else 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::onKeydown (cognitive 67) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:11041 — run-report-viewer.RUN_REPORT_VIEWER::onKeydown has cognitive complexity 67 (threshold 15). Drivers by points: if/else 30 (49 pts), boolean chains 18 (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::playTimeline::paintAt (cognitive 63) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:9945 — run-report-viewer.RUN_REPORT_VIEWER::playTimeline::paintAt has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (50 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 31). 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::wire (cognitive 59) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10132 — run-report-viewer.RUN_REPORT_VIEWER::wire has cognitive complexity 59 (threshold 15). Drivers by points: if/else 34 (35 pts), boolean chains 23, ternaries 1 (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::txCallContext (cognitive 49) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3902 — run-report-viewer.RUN_REPORT_VIEWER::txCallContext has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 20 (29 pts), boolean chains 20 (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: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay::paintLane (cognitive 49) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:6723 — run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay::paintLane has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (32 pts), ternaries 7 (10 pts), boolean chains 7 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::failureMessageHtml (cognitive 45) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2464 — run-report-viewer.RUN_REPORT_VIEWER::failureMessageHtml has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::applyDetailRoute (cognitive 44) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1899 — run-report-viewer.RUN_REPORT_VIEWER::applyDetailRoute has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 13 (14 pts), boolean chains 10 (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::readRoute (cognitive 41) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1836 — run-report-viewer.RUN_REPORT_VIEWER::readRoute has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 23, ternaries 9 (13 pts), if/else 5 (nesting depth added 4). 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay (cognitive 41) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:6341 — run-report-viewer.RUN_REPORT_VIEWER::wireTrailReplay has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 27, if/else 12 (14 pts) (nesting depth added 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::paintTimelinePane (cognitive 36) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:9756 — run-report-viewer.RUN_REPORT_VIEWER::paintTimelinePane has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 14, 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderFailureSummary (cognitive 35) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2525 — run-report-viewer.RUN_REPORT_VIEWER::renderFailureSummary has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 14 (17 pts), boolean chains 16, if/else 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail (cognitive 33) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1675 — run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 18, if/else 7 (9 pts), ternaries 5 (6 pts) (nesting depth added 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::readRoute, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::scrubberHtml (cognitive 31) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3379 — run-report-viewer.RUN_REPORT_VIEWER::scrubberHtml has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 5, if/else 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::compareStepAnchors (cognitive 30) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7389 — run-report-viewer.RUN_REPORT_VIEWER::compareStepAnchors has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, ternaries 4 (9 pts), if/else 4, loops 1 (nesting depth added 5). 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::centerTimelineRow::center (cognitive 29) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:9468 — run-report-viewer.RUN_REPORT_VIEWER::centerTimelineRow::center has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), boolean chains 6, ternaries 2 (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::timelinePaneView (cognitive 28) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2781 — run-report-viewer.RUN_REPORT_VIEWER::timelinePaneView has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 18 (23 pts), boolean chains 4, if/else 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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::renderCompareView::manyEventSection (cognitive 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7931 — run-report-viewer.RUN_REPORT_VIEWER::renderCompareView::manyEventSection has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 15 (20 pts), if/else 4, boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::captureMoments (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:4379 — run-report-viewer.RUN_REPORT_VIEWER::captureMoments has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), loops 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • run-report-viewer.RUN_REPORT_VIEWER::highlightedYaml (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:4851 — run-report-viewer.RUN_REPORT_VIEWER::highlightedYaml has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (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. This shape REPEATS in the file: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER, run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
  • + 16 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx: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 REDACTED: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx: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 sdks/typescript/tools/extract-tool-defs.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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-hooks.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-extract.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx: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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/integrations.tsx: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.
  • + 15 more in this group — see findings.md.
X2 · Cancellation propagation · Async function without AbortSignal · ×36
  • Async function without AbortSignal: safeJson trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:112 — `safeJson` 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: safeText trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:122 — `safeText` 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: importSessionArchive trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:616 — `importSessionArchive` 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: reviewSession trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:676 — `reviewSession` 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: createBundle trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:693 — `createBundle` 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: deleteTrailFolder trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:712 — `deleteTrailFolder` 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: revealTrailFolder trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:725 — `revealTrailFolder` 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: saveTrailFolderFile trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:741 — `saveTrailFolderFile` 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: deleteTrailFolderFile trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:754 — `deleteTrailFolderFile` 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: recordTrailFolder trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:766 — `recordTrailFolder` 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: recordTrailRange trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:784 — `recordTrailRange` 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: recordScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:816 — `recordScreen` 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: recordTree trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:876 — `recordTree` 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: recordSelectorAdvice trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:891 — `recordSelectorAdvice` 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: recordDisconnect trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:903 — `recordDisconnect` 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: recordToolParams trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:914 — `recordToolParams` 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: scriptedToolParams trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:926 — `scriptedToolParams` 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: toolToolUsages trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:940 — `toolToolUsages` 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: toolToolUsageCounts trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:951 — `toolToolUsageCounts` 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: cancelExternalAgent trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:998 — `cancelExternalAgent` 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: replyExternalAgent trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1007 — `replyExternalAgent` 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: demoMarkStart trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1041 — `demoMarkStart` 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: demoFinish trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1054 — `demoFinish` 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: demoGenerate trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1067 — `demoGenerate` 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: demoDeleteStep trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1082 — `demoDeleteStep` 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 })`.
  • + 11 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×34
  • Sync-over-async blocking trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/SessionCleanups.kt:89 — `runAll` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/LaunchAppTrailblazeTool.kt:186 — `execute` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:458 — `runHostAgentWithOnDeviceRpc` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/AndroidLiveFrameStream.kt:62 — `streamAndroidLiveH264AccessUnits` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/IosLiveFrameStream.kt:46 — `streamIosLiveH264AccessUnits` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolHost.kt:627 — `connect` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-scripting-fetch/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/fetch/OkHttpFetchExtension.kt:149 — `install` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3231 — `startStdioMcpServer` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking sdks/typescript/src/surveys/cli-main.ts:203 — `writeFileSync` in `runSurveyCli` 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 sdks/typescript/src/surveys/discover.ts:44 — `mkdtempSync` in `ensureExtractDir` 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 sdks/typescript/src/surveys/discover.ts:45 — `mkdirSync` in `ensureExtractDir` 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 sdks/typescript/src/surveys/discover.ts:60 — `realpathSync` in `inside` 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 sdks/typescript/src/surveys/discover.ts:61 — `realpathSync` in `inside` 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 sdks/typescript/src/surveys/discover.ts:75 — `existsSync` in `intoExtractDir` 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 sdks/typescript/src/surveys/discover.ts:100 — `existsSync` in `walk` 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 sdks/typescript/src/surveys/discover.ts:117 — `statSync` in `walk` 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 sdks/typescript/src/surveys/discover.ts:134 — `readdirSync` in `walk` 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 sdks/typescript/src/surveys/discover.ts:142 — `statSync` in `walk` 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 sdks/typescript/src/surveys/discover.ts:171 — `statSync` in `extractZip` 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 sdks/typescript/src/surveys/discover.ts:174 — `existsSync` in `extractZip` 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 sdks/typescript/src/surveys/discover.ts:174 — `readdirSync` in `extractZip` 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 sdks/typescript/src/surveys/discover.ts:175 — `mkdirSync` in `extractZip` 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 sdks/typescript/src/surveys/discover.ts:291 — `existsSync` in `callback to filter` 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 sdks/typescript/src/surveys/discover.ts:291 — `statSync` in `callback to filter` 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 sdks/typescript/src/surveys/discover.ts:294 — `existsSync` in `walk` 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.
  • + 9 more in this group — see findings.md.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×32
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/logs/client/temp/YamlJsonBridge.kt:51 — `YamlJsonBridge.jsonElementToSerializable` is public and takes `jsonElement: JsonElement` from its caller, and it calls itself at line 51 with a piece of `jsonElement` (and at line 52) — the function is not `tailrec`, so every call is a real frame — and nowhere in `YamlJsonBridge.jsonElementToSerializable` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `YamlJsonBridge.jsonElementToSerializable` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:913 — `eventLines` is exported, takes a document from its caller (line 906) and hands it to `emit`, which calls itself at line 913 (`emit`) with a piece of `v` (and at line 918) — and nowhere in `emit` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `emit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:471 — `mergeWebHierarchyBounds` is exported, takes a document from its caller (line 447) and hands it to `compatible`, which calls itself at line 471 (`compatible`) with a piece of `a` — and nowhere in `compatible` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `compatible` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:481 — `mergeWebHierarchyBounds` is exported, takes a document from its caller (line 447) and hands it to `graft`, which calls itself at line 481 (`graft`) with a piece of `a` — and nowhere in `graft` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `graft` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:179 — `inspectorModel` is exported, takes a document from its caller (line 158) and hands it to `walk`, which calls itself at line 179 (`walk`) with a piece of `raw` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:292 — `jsonToYaml` is exported, takes a document from its caller (line 275) and hands it to `append`, which calls itself at line 292 (`append`) with a piece of `element` (and at line 305, line 308) — and nowhere in `append` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `append` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:250 — `findAttachmentRefs` is exported, takes a document from its caller (line 246) and hands it to `walk`, which calls itself at line 250 (`walk`) with a piece of `v` (and at line 253) — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/AgentMemory.kt:504 — `interpolateVariablesInJson` is public and takes `element: JsonElement` from its caller, and it calls itself at line 504 with a piece of `element` (and at line 507) — the function is not `tailrec`, so every call is a real frame — and nowhere in `interpolateVariablesInJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `interpolateVariablesInJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/CredentialFieldNames.kt:32 — `withCredentialFieldsMasked` is public and takes its `JsonElement` receiver from its caller, and it calls itself at line 32 with a piece of its receiver (and at line 35) — the function is not `tailrec`, so every call is a real frame — and nowhere in `withCredentialFieldsMasked` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `withCredentialFieldsMasked` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/events/AttachmentRef.kt:125 — `AttachmentRef.findAll` is public, takes a document from its caller (line 119) and hands it to `walk`, which calls itself at line 125 with a piece of `el` (and at line 127) — the function is not `tailrec`, so every call is a real frame — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:222 — `callTool` is public and takes `arguments: Map<String, Any ?>` from its caller, and it calls itself at line 222 with a piece of `arguments` — the function is not `tailrec`, so every call is a real frame — and nowhere in `callTool` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `callTool` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-host/src/main/java/xyz/block/trailblaze/cli/KeyValueParser.kt:97 — `KeyValueParser.jsonElementToAny` is public and takes `element: JsonElement` from its caller, and it calls itself at line 97 with a piece of `element` (and at line 98) — the function is not `tailrec`, so every call is a real frame — and nowhere in `KeyValueParser.jsonElementToAny` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `KeyValueParser.jsonElementToAny` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/trailhead/TrailheadHandoffStore.kt:66 — `TrailheadMatchKey.digestArgs` is public, takes a document from its caller (line 53) and hands it to `TrailheadMatchKey.canonicalJson`, which calls itself at line 66 with a piece of `element` — the function is not `tailrec`, so every call is a real frame — and nowhere in `TrailheadMatchKey.canonicalJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `TrailheadMatchKey.canonicalJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolDecodeFailure.kt:19 — `toolDecodeFailureReason` is public, takes a document from its caller (line 15) and hands it to `collect`, which calls itself at line 19 with a piece of `value` (and at line 20) — the function is not `tailrec`, so every call is a real frame — and nowhere in `collect` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `collect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolMemoryInterpolation.kt:265 — `scrubSensitivePayload` is public and takes `payload: JsonElement` from its caller, and it calls itself at line 265 with a piece of `payload` (and at line 268) — the function is not `tailrec`, so every call is a real frame — and nowhere in `scrubSensitivePayload` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `scrubSensitivePayload` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:45 — `maestroLaunchArgumentSecrets` is public and takes `value: JsonElement` from its caller, and it calls itself at line 45 with a piece of `value` (and at line 48) — the function is not `tailrec`, so every call is a real frame — and nowhere in `maestroLaunchArgumentSecrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `maestroLaunchArgumentSecrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:60 — `maestroLaunchArgumentSecrets` is public, takes a document from its caller (line 38) and hands it to `argumentValues`, which calls itself at line 60 with a piece of `value` (and at line 61) — the function is not `tailrec`, so every call is a real frame — and nowhere in `argumentValues` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `argumentValues` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:106 — `maestroAuthoredLaunchLiterals` is public, takes a document from its caller (line 67) and hands it to `authoredLaunchArgumentPairs`, which calls itself at line 106 with a piece of `authored` (and at line 109) — the function is not `tailrec`, so every call is a real frame — and nowhere in `authoredLaunchArgumentPairs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `authoredLaunchArgumentPairs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:145 — `withKnownMaestroLaunchValuesRedacted` is public, takes a document from its caller (line 129) and hands it to `scrubKnownValues`, which calls itself at line 145 with a piece of `value` (and at line 148) — the function is not `tailrec`, so every call is a real frame — and nowhere in `scrubKnownValues` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `scrubKnownValues` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:191 — `withMaestroLaunchArgumentsRedacted` is public, takes a document from its caller (line 121) and hands it to `redactLaunches`, which calls itself at line 191 with a piece of `value` (and at line 202, line 204, line 207) — the function is not `tailrec`, so every call is a real frame — and nowhere in `redactLaunches` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `redactLaunches` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:266 — `EventStreamScanner.needlesFor` is public, takes a document from its caller (line 253) and hands it to `EventStreamScanner.collect`, which calls itself at line 266 with a piece of `element` — the function is not `tailrec`, so every call is a real frame — and nowhere in `EventStreamScanner.collect` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `EventStreamScanner.collect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap trailblaze-common/src/commonMain/kotlin/xyz/block/trailblaze/scripting/ScriptedToolSchemaRefFlattener.kt:108 — `ScriptedToolSchemaRefFlattener.flatten` is public, takes a document from its caller (line 65) and hands it to `ScriptedToolSchemaRefFlattener.resolveObject`, which calls itself at line 108 with a piece of `node` — the function is not `tailrec`, so every call is a real frame — and nowhere in `ScriptedToolSchemaRefFlattener.resolveObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `ScriptedToolSchemaRefFlattener.resolveObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
  • Recursive walk over a caller-supplied document has no depth cap sdks/typescript/src/surveys/parse.ts:77 — `redactSecrets` is exported and takes `args: Record<string, unknown>` from its caller, and it calls itself at line 77 (`redactSecrets`) with a piece of `args` (and at line 78) — and nowhere in `redactSecrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `redactSecrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:168 — `matchNode` is exported and takes `node: HierarchyNode` from its caller, and it calls itself at line 168 (`matchNode`) with a piece of `node` — and nowhere in `matchNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `matchNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:175 — `anyNode` is exported and takes `root: HierarchyNode` from its caller, and it calls itself at line 175 (`anyNode`) with a piece of `root` — and nowhere in `anyNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `anyNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • + 7 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×29
  • TooManyMethods: TrailblazeMcpBridgeImpl trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailblazeDeviceManager trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDeviceManager.kt:94 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Companion trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:153 — TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ExternalAgentSupervisor trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentSupervisor.kt:209 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AndroidHostAdbUtils REDACTED:119 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailCommand REDACTED:126 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailblazeMcpServer trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:211 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LoggingDriver trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/maestro/LoggingDriver.kt:36 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AccessibilityDeviceManager trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:45 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ToolDiscoveryToolSet trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:83 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LogsRepo trailblaze-report/src/main/java/xyz/block/trailblaze/report/utils/LogsRepo.kt:42 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UnifiedTrailAdapter trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:40 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ViewHierarchyOnlyDriver trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/ViewHierarchyOnlyDriver.kt:39 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailblazeMcpSessionContext trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpSessionContext.kt:94 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AxeCli trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeCli.kt:30 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AxeDeviceManager trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:25 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AndroidTrailblazeRule trailblaze-android/src/main/java/xyz/block/trailblaze/android/AndroidTrailblazeRule.kt:153 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: McpProxy trailblaze-host/src/main/java/xyz/block/trailblaze/cli/McpProxy.kt:99 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CheckCommand trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:103 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PlaywrightAriaSnapshot trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:31 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailmapTargetGenerator build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:243 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailblazeProjectConfigLoader trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeProjectConfigLoader.kt:46 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IosHostSimctlUtils trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:22 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DeviceLocaleConfigurator REDACTED:17 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TrailblazeNodeSelectorResolver trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:20 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 4 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×26
  • FunctionTooLong: waypoint-graph-template.html.SubwayView trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1992 — FunctionTooLong — SubwayView runs 535 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 435 over it, 5.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: run-report-shell.escapeHtml trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:196 — FunctionTooLong — escapeHtml runs 407 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 307 over it, 4.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: sessions.SessionsScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:71 — FunctionTooLong — SessionsScreen runs 340 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 240 over it, 3.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: trail-tree.TrailTree trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:76 — FunctionTooLong — TrailTree runs 300 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× 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: blaze.BlazeScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:15 — FunctionTooLong — BlazeScreen runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.74× 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: live-device-stream.openLiveDeviceStream trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:125 — FunctionTooLong — openLiveDeviceStream runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× 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: trail-detail.UnifiedStepsBoard trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:262 — FunctionTooLong — UnifiedStepsBoard runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× 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: settings.SettingsScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx:63 — FunctionTooLong — SettingsScreen 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: waypoint-graph-template.html.App trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:3195 — FunctionTooLong — App runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× 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: run-report-extract.extractTrace trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556 — FunctionTooLong — extractTrace runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.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: run-report-clip-player.adopt trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:338 — FunctionTooLong — adopt runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: daemon.createDaemonRpc trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:105 — FunctionTooLong — createDaemonRpc 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: tools.ToolsScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:399 — FunctionTooLong — ToolsScreen runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: cli-main.runSurveyCli sdks/typescript/src/surveys/cli-main.ts:56 — FunctionTooLong — runSurveyCli runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× 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: TrailblazeTrailRunner.swift.top-level code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/native/TrailblazeTrailRunner.swift:7 — FunctionTooLong — top-level code 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: demonstrate.DemonstrateFlow trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:132 — FunctionTooLong — DemonstrateFlow runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: monaco-lsp.mountLsp trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:491 — FunctionTooLong — mountLsp 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: demonstrate.DemoGeneratePhase trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:532 — FunctionTooLong — DemoGeneratePhase runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.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: stream-write.writeDerivedStreams sdks/typescript/src/surveys/stream-write.ts:116 — FunctionTooLong — writeDerivedStreams runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: waypoint-graph-template.html.MapView trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1606 — FunctionTooLong — MapView runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: trailmaps.ComponentTypeScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:90 — FunctionTooLong — ComponentTypeScreen runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× 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: trail-detail.TrailImplementationsBoard trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:802 — FunctionTooLong — TrailImplementationsBoard runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.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: run-report-trail-replay.alignReplayByStep trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:521 — FunctionTooLong — alignReplayByStep runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.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: perf-extract.nestAndAccount trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:473 — FunctionTooLong — nestAndAccount runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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: integrations.IntegrationsScreen trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/integrations.tsx:76 — FunctionTooLong — IntegrationsScreen runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× 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.
  • + 1 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×25
  • ClassTooLong: TrailCommand REDACTED:126 — ClassTooLong — 2083 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 1683 over it, 5.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailblazeMcpBridgeImpl trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126 — ClassTooLong — 1634 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods. The bar is 400 significant lines; this is 1234 over it, 4.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DesktopYamlRunner trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt:111 — ClassTooLong — 1583 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 1183 over it, 3.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailblazeMcpServer trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:211 — ClassTooLong — 1447 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 1047 over it, 3.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailblazeAccessibilityService trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:62 — ClassTooLong — 1168 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 768 over it, 2.92× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailmapTargetGenerator build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:243 — ClassTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 382 over it, 1.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CliMcpClient trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:55 — ClassTooLong — 729 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 329 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GenerateTestResultsCliCommand trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:102 — ClassTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 306 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: StepToolSet trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:65 — ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 300 over it, 1.75× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: McpProxy trailblaze-host/src/main/java/xyz/block/trailblaze/cli/McpProxy.kt:99 — ClassTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 296 over it, 1.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DeviceManagerToolSet trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:49 — ClassTooLong — 667 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 267 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WaypointMigrateTrailCommand trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointMigrateTrailCommand.kt:120 — ClassTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 265 over it, 1.66× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NextMoveDecisionLlmClient trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/decision/NextMoveDecisionLlmClient.kt:85 — ClassTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 233 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DriverNodeDetail trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/DriverNodeDetail.kt:29 — ClassTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 220 over it, 1.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailMcpTool trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:34 — ClassTooLong — 614 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 214 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SessionToolSet trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:43 — ClassTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 190 over it, 1.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LogsRepo trailblaze-report/src/main/java/xyz/block/trailblaze/report/utils/LogsRepo.kt:42 — ClassTooLong — 521 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 121 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DaemonScriptedToolBundler trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:46 — ClassTooLong — 506 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 106 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AriaSnapshotResult trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:16 — ClassTooLong — 465 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 65 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LocalLlmSamplingSource trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:61 — ClassTooLong — 453 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 53 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LoopCommand trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:84 — ClassTooLong — 450 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 50 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailFileManager trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailFileManager.kt:85 — ClassTooLong — 424 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 24 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AxeDeviceManager trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:25 — ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 21 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RunReportGenerator trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:62 — ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 10 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TrailblazeLogger trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogger.kt:62 — ClassTooLong — 403 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 3 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×23
  • Swallowed exception (caught, then discarded) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailFormatYaml.kt:361 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailFormatYaml.kt:519 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-trail-format/src/androidMain/kotlin/xyz/block/trailblaze/util/Console.android.kt:32 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-tracing/src/jvmMain/kotlin/xyz/block/trailblaze/tracing/PlatformIds.kt:10 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-tracing/src/androidMain/kotlin/xyz/block/trailblaze/tracing/PlatformIds.kt:23 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/HttpRequestUtils.kt:64 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/RpcScreenStateAdapter.kt:204 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ConfigToolSet.kt:159 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:1262 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:264 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:106 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:422 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:428 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:1098 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailFileManager.kt:639 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/android/ondevice/rpc/OnDeviceRpcWebSocketClient.kt:169 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:316 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:206 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2343 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2354 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3459 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-scripting-subprocess/src/main/kotlin/xyz/block/trailblaze/scripting/subprocess/StderrCapture.kt:32 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) trailblaze-revyl/src/main/java/xyz/block/trailblaze/revyl/RevylScreenState.kt:36 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
AC6 · Visual & motion safety · Focus outline removed inline · ×22
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:176 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:905 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:8 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:134 — <div> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:234 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:217 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:394 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:421 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:1875 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:1956 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:1964 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:2200 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:2232 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:2345 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:2383 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:2443 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline REDACTED:2481 — <input> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:392 — <div> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:241 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1018 — <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:340 — <div> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:517 — <div> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×20
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:276 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:276-280 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:296-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:440 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:440-444 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:604-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2891 — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2891-2895 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:132-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2891` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:239 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:239-243 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:245-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:602 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:602-606 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:553-557 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:608 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:608-612 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:559-563 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/MaestroDeviceScreenStream.kt:123 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/MaestroDeviceScreenStream.kt:123-127 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/OnDeviceRpcDeviceScreenStream.kt:181-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolMeta.kt:117 — trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolMeta.kt:117-121 | trailblaze-scripting-mcp-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/mcp/TrailblazeToolMeta.kt:172-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:167 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:167-171 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:417-421 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailArgConfig.kt:135 — trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailArgConfig.kt:135-139 | trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/TrailblazeDeviceDefinition.kt:234-238 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailArgConfig.kt:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:164 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:164-168 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:265-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:454 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:454-458 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:804-808 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:718 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:718-722 | trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:1389-1393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:718` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:1394` calls `warnIfTargetTypeMismatch` and `trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:723` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:135 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:135-139 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:300-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailLabelLint.kt:149 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailLabelLint.kt:149-153 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailLabelWriter.kt:122-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:308 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:308-312 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionStreamRoutes.kt:67-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:275 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:275-279 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:296-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:301` calls `escapeForIdentifier` and `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:280` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:268 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:268-272 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:288-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:440 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:440-444 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:470-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:389 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:389-393 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:470-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:468` calls `requireEqual` and `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:388` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
X3 · Exception handling · Swallowed exception (empty catch) · ×17
  • Swallowed exception (empty catch) trails/config/trailmaps/clock/tools/clock_android_launchApp.ts:65 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts: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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:198 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:970 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:402 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:427 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:543 — `.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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1163 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:30 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:834 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:915 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:1131 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings-frames.ts: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.
  • Swallowed exception (empty catch) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings-frames.ts:110 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:177 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:186 — 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) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1563 — `.then(…, () => {})` 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.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×16
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/devices/index.html:170 — `.tool-runner summary::before` moves (`transition: transform .12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:230 — `.agentic-pill .agentic-icon` moves (`animation: pulse 2.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:417 — `.matcher-entry summary::before` moves (`transition: transform 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:433 — `.waypoint-node` moves (`transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:555 — `.edge-label` moves (`transition: background 0.12s, color 0.12s, transform 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1102 — `.subway-flow .react-flow__node[class*="subway-depth-"] .waypoint-node` moves (`transition: width 0.35s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1128 — `.subway-flow .react-flow__node` moves (`transition: transform 0.6s cubic-bezier(0.34, 1.35, 0.64, 1), opacity 0.3s ease-out, filter 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1158 — `.subway-trailhead-pill` moves (`transition: transform 0.12s, box-shadow 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1223 — `.screen-card` moves (`transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:157 — <span> moves — its inline style sets `transition: transform .15s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard REDACTED:381 — <div> moves — its inline style sets `transition: max-height .28s var(--ease-out-soft), opacity .2s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard REDACTED:2232 — <textarea> moves — its inline style sets `transition: min-height .25s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard REDACTED:2236 — <div> moves — its inline style sets `transition: max-height .25s var(--ease-out-soft), opacity .2s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:338 — <div> moves — its inline style sets `transition: width .2s var(--ease-out-soft), flex-basis .2s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1105 — <div> moves — its inline style sets `transition: opacity .2s ease, transform .2s ease` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:526 — <span> moves — its inline style sets `transition: transform .15s var(--ease-out-soft)` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×16
  • Duplicated block (11 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:53 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:53-63 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:80-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:91` calls `toBoolean` and `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:64` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:350 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:350-360 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:530-540 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/SelectorDialectLint.kt:493 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/SelectorDialectLint.kt:493-503 | trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailTargets.kt:41-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/SelectorDialectLint.kt:493` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:653 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:653-663 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:702-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:653` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:185 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:185-195 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:128-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:31 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:31-41 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:2286-2296 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:52 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:52-62 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:55-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:56 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:56-66 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:78-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:56` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolMeta.kt:73 — trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolMeta.kt:73-83 | trailblaze-scripting-mcp-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/mcp/TrailblazeToolMeta.kt:83-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3140 — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3140-3150 | trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3176-3186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:213 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:213-223 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:324-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionAnalyzer.kt:432 — trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionAnalyzer.kt:432-442 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionCache.kt:526-536 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/LiveFrameConsumer.kt:255 — trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/LiveFrameConsumer.kt:255-270 | trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/WallClockMuxConsumer.kt:451-461 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/LiveFrameConsumer.kt:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionCache.kt:306 — trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionCache.kt:306-319 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionCache.kt:475-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionCache.kt:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:445 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:445-455 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:725-737 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:445` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:376 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:376-386 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:181-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×15
  • Duplicated block (10 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:151 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:151-160 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:169-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:497 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:497-506 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:278-287 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:564 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:564-573 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:357-366 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:198 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:198-207 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorSuggestCommand.kt:258-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorSuggestCommand.kt:255` calls `screenCache`, `ScreenStateCache`, `capture` and `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:195` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:495 — trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:495-504 | trailblaze-scripting-subprocess/src/main/kotlin/xyz/block/trailblaze/scripting/subprocess/McpSubprocessSpawner.kt:141-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-scripting-subprocess/src/main/kotlin/xyz/block/trailblaze/scripting/subprocess/McpSubprocessSpawner.kt:152` calls `startsWith` and `trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:505` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:49 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:49-58 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:46-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) trailblaze-models/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/llm/config/ClasspathResourceDiscovery.kt:31 — trailblaze-models/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/llm/config/ClasspathResourceDiscovery.kt:31-40 | trailblaze-models/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/llm/config/ClasspathResourceDiscovery.kt:165-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/llm/config/ClasspathResourceDiscovery.kt:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:527 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:527-536 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:549-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:527` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:257 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:257-266 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:264-273 — before extracting anything, compare `trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/AndroidDeviceLocale.kt:178 — trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/AndroidDeviceLocale.kt:178-187 | REDACTED:71-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:646 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:646-655 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:751-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:646` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1027 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1027-1036 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1467-1476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1027` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1025` calls `resolveEffectiveHttpPort` and `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1465` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:615 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:615-624 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:784-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:615` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeTrailmapManifestLoader.kt:411 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeTrailmapManifestLoader.kt:411-420 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeTrailmapManifestLoader.kt:448-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeTrailmapManifestLoader.kt:411` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:392 — REDACTED:392-401 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointValidateCommand.kt:171-180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:392` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×14
  • Duplicated block (8 lines × 2) build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:140 — build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:140-147 | build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:189-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:399 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:399-406 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/IosDriverTrailRunner.kt:318-325 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:76 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:76-83 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:759-766 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1455 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1455-1462 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1546-1553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1455` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:161 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:161-168 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:232-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:720 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:720-727 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:750-757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:720` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:273 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:273-280 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:368-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `match` to `DriverNodeMatch.AndroidMaestro` in one and `DriverNodeMatch.IosMaestro` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/config/BuiltInLlmModelRegistry.kt:278 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/config/BuiltInLlmModelRegistry.kt:278-285 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/config/LlmConfigResolver.kt:180-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/config/BuiltInLlmModelRegistry.kt:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:454 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:454-461 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:468-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/devices/RequiredDeviceClassifiers.kt:60 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/devices/RequiredDeviceClassifiers.kt:60-67 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/SensitiveArgsTrailblazeTool.kt:96-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:24 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:24-31 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:291-298 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:31 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:31-38 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:165-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:193 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:193-200 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:470-477 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:453 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:453-460 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:493-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:453` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×14
  • Duplicated block (7 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:538 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:538-544 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:325-331 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:204 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:204-210 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:294-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:448 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:448-454 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:517-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:448` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:421 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:421-427 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:441-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:638 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:638-644 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:985-991 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:640 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:640-646 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:931-937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:640` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:469 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:469-475 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:819-825 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:514 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:514-520 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:234-240 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:280 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:280-286 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:290-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:287` calls `uppercaseChar` and `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:297` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:158 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:158-164 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:165-171 — before extracting anything, compare `trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:194 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:194-200 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNode.kt:113-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `predicate` to `(AccessibilityNode` in one and `(TrailblazeNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNode.kt:109` calls `centerPoint`, `Pair` and `trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:191` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:1010 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:1010-1016 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeNodeMapper.kt:259-265 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeVerifyElementVisibleTool.kt:33 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeVerifyElementVisibleTool.kt:33-39 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeVerifyValueTool.kt:53-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeVerifyElementVisibleTool.kt:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:95 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:95-101 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:353-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:732 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:732-737 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:823-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:299 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:299-304 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:307-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:299` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogBuilder.kt:129 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogBuilder.kt:129-134 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogCache.kt:63-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogBuilder.kt:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogBuilder.kt:128` calls `add`, `getOrDefault` and `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogCache.kt:62` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:360 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:360-365 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:372-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:1581 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:1581-1586 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:1626-1631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:1581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxFormatter.kt:492 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxFormatter.kt:492-497 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxFormatter.kt:502-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxFormatter.kt:492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:220 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:220-225 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:74-79 — before extracting anything, compare `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt` and `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/console/WebConsoleCapture.kt:262 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/console/WebConsoleCapture.kt:262-267 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/network/WebNetworkCapture.kt:755-760 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:203 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:203-208 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNode.kt:122-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `predicate` to `(AccessibilityNode` in one and `(TrailblazeNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:156 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:156-161 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:186-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeHoverTool.kt:31 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeHoverTool.kt:31-36 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeTypeTool.kt:36-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeHoverTool.kt:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/ElementRefSlug.kt:111 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/ElementRefSlug.kt:111-116 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/ElementRefSlug.kt:121-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/ElementRefSlug.kt:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:626 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:626-631 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:781-786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D30 · Dependency Vulnerabilities · Medium CVE · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×11
  • Duplicated block (12 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mcp/agent/KoogStrategyGraphAgent.kt:502 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mcp/agent/KoogStrategyGraphAgent.kt:502-513 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mcp/agent/KoogStrategyGraphAgent.kt:554-565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/TapOnByElementSelector.kt:139 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/TapOnByElementSelector.kt:139-150 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/TapOnByElementSelector.kt:152-163 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:425 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:425-436 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:247-258 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:443` calls `isNotBlank` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:259` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DeviceCommand.kt:567 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DeviceCommand.kt:567-578 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DeviceCommand.kt:684-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DeviceCommand.kt:567` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:756 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:756-767 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:784-795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:756` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:333 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:333-344 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:336-347 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:48 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:48-60 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:2303-2314 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:48` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:47 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:47-58 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:69-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:75 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:75-87 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:78-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:75` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) trailblaze-report/src/main/java/xyz/block/trailblaze/report/models/SessionSummary.kt:99 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/models/SessionSummary.kt:99-110 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/models/SessionSummary.kt:253-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:221 — trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:221-232 | trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:268-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:221` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×9
  • Edited copy of a member (14 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeHoverTool.kt:30 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeHoverTool.kt:30-43 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeSelectOptionTool.kt:32-50 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/devices/PlaywrightBrowserInstaller.kt:88 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/devices/PlaywrightBrowserInstaller.kt:88-108 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightDriverManager.kt:491-504 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExtraTrailRoots.kt:65 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExtraTrailRoots.kt:65-78 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailFavorites.kt:53-66 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/FrameTimeSei.kt:91 — trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/FrameTimeSei.kt:91-104 | trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/FrameTimeSei.kt:107-120 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:53 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:53-66 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/InteractionEventBuffer.kt:75-88 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/GetScreenStateRequestHandler.kt:38 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/GetScreenStateRequestHandler.kt:38-51 | trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/GetScreenStateRequestHandler.kt:54-67 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:141 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:141-154 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:313-327 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolMeta.kt:72 — trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolMeta.kt:72-85 | trailblaze-scripting-mcp-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/mcp/TrailblazeToolMeta.kt:82-95 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/rules/TrailblazeRunnerUtil.kt:118 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/rules/TrailblazeRunnerUtil.kt:118-132 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/rules/TrailblazeRunnerUtil.kt:135-148 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D5 · Coupling · Off the main sequence · ×9
  • Off the main sequence: :trailblaze-http — :trailblaze-http: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-tracing — :trailblaze-tracing: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-inprocess-apk — :trailblaze-inprocess-apk: abstractness 0.03, instability 0.00, distance 0.97 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: :trailblaze-trail-format — :trailblaze-trail-format: abstractness 0.08, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-models — :trailblaze-models: abstractness 0.09, instability 0.07, distance 0.84 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-scripting-fetch — :trailblaze-scripting-fetch: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-agent — :trailblaze-agent: abstractness 0.00, instability 0.22, distance 0.78 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-ondevice-rpc-proto — :trailblaze-ondevice-rpc-proto: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: :trailblaze-capture — :trailblaze-capture: abstractness 0.07, instability 0.20, distance 0.73 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/SessionSecrets.kt:105 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/SessionSecrets.kt:105-121 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/SensitiveArgsTrailblazeTool.kt:214-231 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/tools/ComposeClickTool.kt:28 — trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/tools/ComposeClickTool.kt:28-44 | trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/tools/ComposeTypeTool.kt:36-60 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) trailblaze-report/src/main/java/xyz/block/trailblaze/report/trace/SessionTraceFile.kt:103 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/trace/SessionTraceFile.kt:103-119 | trailblaze-scripting-subprocess/src/main/kotlin/xyz/block/trailblaze/scripting/subprocess/McpSubprocessSpawner.kt:211-231 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:1228 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:1228-1244 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:1254-1276 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:346 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:346-363 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/AnalyzerScriptedToolEnrichment.kt:101-117 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolRegistration.kt:89 — trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolRegistration.kt:89-105 | trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/LazyYamlScriptedToolRegistration.kt:99-132 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:94 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:94-112 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:155-171 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×7
  • Edited copy of a member (12 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolNameSuggestions.kt:68 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolNameSuggestions.kt:68-83 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/VisibleStrings.kt:507-518 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:266 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:266-280 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:364-375 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/console/WebConsoleCapture.kt:247 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/console/WebConsoleCapture.kt:247-258 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/network/WebNetworkCapture.kt:738-751 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolRepo.kt:218 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolRepo.kt:218-229 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolRepo.kt:270-289 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/SetOrientationTrailblazeTool.kt:57 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/SetOrientationTrailblazeTool.kt:57-68 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/PressKeyTrailblazeTool.kt:64-79 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/BunBinaryResolver.kt:80 — trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/BunBinaryResolver.kt:80-93 | trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/LazyYamlScriptedToolRegistration.kt:311-322 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/LongPressElementWithAccessibilityTextTrailblazeTool.kt:37 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/LongPressElementWithAccessibilityTextTrailblazeTool.kt:37-48 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/LongPressOnElementWithTextTrailblazeTool.kt:33-46 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×7
  • Edited copy of a member (8 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:396 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:396-403 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:537-549 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RunToolsRoutes.kt:326 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RunToolsRoutes.kt:326-337 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogBuilder.kt:53-60 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/native/TrailblazeTrailRunner.swift:255 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/native/TrailblazeTrailRunner.swift:255-262 | trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/native/TrailblazeTrailRunner.swift:263-274 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapSurveyBundling.kt:114 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapSurveyBundling.kt:114-121 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:649-656 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:1226 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:1226-1238 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:1253-1260 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/KeyValueParser.kt:77 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/KeyValueParser.kt:77-85 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/ScriptedToolArgTypeCoercion.kt:298-305 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) trailblaze-revyl/src/main/java/xyz/block/trailblaze/revyl/RevylActionResult.kt:50 — trailblaze-revyl/src/main/java/xyz/block/trailblaze/revyl/RevylActionResult.kt:50-57 | trailblaze-revyl/src/main/java/xyz/block/trailblaze/revyl/RevylLiveStepResult.kt:49-56 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:218 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:218-226 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:382-390 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:482 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:482-490 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:562-570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:455 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:455-463 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/IosDriverTrailRunner.kt:361-369 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:455` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:126 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:126-134 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:29-37 — before extracting anything, compare `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SettingsRoutes.kt:333 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SettingsRoutes.kt:333-342 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SettingsRoutes.kt:376-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SettingsRoutes.kt:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:299 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:299-307 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:338-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:614 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:614-622 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:682-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:614` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×7
  • Duplicated block (10 lines × 2 locations) sdks/typescript/src/memory.ts:405 — sdks/typescript/src/memory.ts:405 · sdks/typescript/src/trailhead.ts:193 — 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 (10 lines × 2 locations) sdks/typescript/tools/extract-tool-defs.mjs:598 — sdks/typescript/tools/extract-tool-defs.mjs:598 · sdks/typescript/tools/extract-tool-defs.mjs:636 — 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) sdks/typescript/tools/in-process-wrapper-template.mjs:25 — sdks/typescript/tools/in-process-wrapper-template.mjs:25 · sdks/typescript/tools/in-process-wrapper-template.mjs:46 — 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) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:725 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:725 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1003 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1003 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1194 — 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) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:692 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:692 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:725 — 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) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:469 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:469 · REDACTED:1049 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×6
  • Edited copy of a member (24 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:232 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:232-261 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorMinimizer.kt:336-359 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:360 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:360-394 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/MaestroCommandToIosDriverActionConverter.kt:282-305 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:133 — build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:133-156 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:617-653 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/ios/tools/IosResetKeychainTrailblazeTool.kt:34 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/ios/tools/IosResetKeychainTrailblazeTool.kt:34-57 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/ios/tools/IosTerminateTrailblazeTool.kt:38-63 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/console/WebConsoleCapture.kt:85 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/console/WebConsoleCapture.kt:85-108 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/network/WebNetworkCapture.kt:136-164 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) trailblaze-ondevice-rpc-proto/src/commonMain/kotlin/xyz/block/trailblaze/ondevice/rpc/proto/OnDeviceRpcProtoCodec.kt:691 — trailblaze-ondevice-rpc-proto/src/commonMain/kotlin/xyz/block/trailblaze/ondevice/rpc/proto/OnDeviceRpcProtoCodec.kt:691-714 | trailblaze-ondevice-rpc-proto/src/commonMain/kotlin/xyz/block/trailblaze/ondevice/rpc/proto/OnDeviceRpcProtoCodec.kt:717-740 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×6
  • Edited copy of a member (10 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:1483 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:1483-1496 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:122-131 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/SelectorTemplating.kt:177 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/SelectorTemplating.kt:177-188 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/SelectorTemplating.kt:190-199 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DescribeCommands.kt:25 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DescribeCommands.kt:25-34 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DescribeCommands.kt:36-46 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExtraTrailRoots.kt:53 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExtraTrailRoots.kt:53-63 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailFavorites.kt:42-51 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolHelpRenderer.kt:153 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolHelpRenderer.kt:153-166 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxCommand.kt:522-531 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/host/TrailblazeDevicePlatformExt.kt:12 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/host/TrailblazeDevicePlatformExt.kt:12-22 | trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/setofmark/SetOfMarkAnnotator.kt:131-140 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×6
  • Edited copy of a member (13 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/SelectorDialectLint.kt:493 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/SelectorDialectLint.kt:493-505 | trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailTargets.kt:41-53 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/MaestroInteractionToolFactory.kt:95 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/MaestroInteractionToolFactory.kt:95-107 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/OnDeviceRpcDeviceScreenStream.kt:136-149 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:417 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:417-430 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:508-520 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:163 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:163-175 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:264-276 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/WorkspaceClientDtsGenerator.kt:191 — trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/WorkspaceClientDtsGenerator.kt:191-209 | trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/WorkspaceClientDtsGenerator.kt:303-315 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:1138 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:1138-1151 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:1204-1216 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×6
  • Edited copy of a member (11 corresponding lines) trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/InProcessIdleApkInstaller.kt:581 — trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/InProcessIdleApkInstaller.kt:581-591 | trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/PrecompiledApkInstaller.kt:122-136 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/devices/RequiredDeviceClassifiers.kt:59 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/devices/RequiredDeviceClassifiers.kt:59-69 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/SensitiveArgsTrailblazeTool.kt:95-105 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/RuntimeRebuildGate.kt:23 — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/RuntimeRebuildGate.kt:23-33 | trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/RuntimeRebuildGate.kt:35-45 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SameCenterAncestorsStrategy.kt:32 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SameCenterAncestorsStrategy.kt:32-42 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SameCenterDescendantsStrategy.kt:19-29 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/ContainsChildMultiParentStrategy.kt:12 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/ContainsChildMultiParentStrategy.kt:12-22 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/ContainsDescendantsMultiParentStrategy.kt:12-22 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:603 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:603-613 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailFileManager.kt:94-105 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×6
  • Edited copy of a member (16 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:148 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:148-163 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recording/InteractionRecorder.kt:165-181 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/OnDeviceRpcDeviceScreenStream.kt:218 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/OnDeviceRpcDeviceScreenStream.kt:218-233 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/OnDeviceRpcDeviceScreenStream.kt:239-263 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:871 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:871-895 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:905-920 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:479 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:479-494 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:222-240 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3138 — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3138-3153 | trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:3171-3189 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeRequestDetailsTool.kt:55 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeRequestDetailsTool.kt:55-74 | trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/tools/ComposeRequestDetailsTool.kt:39-54 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D6 · Cohesion (LCOM4) · Low cohesion · ×6
  • Low cohesion: AndroidDeviceCommandExecutor (LCOM4 10) trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/device/AndroidDeviceCommandExecutor.android.kt:23 — AndroidDeviceCommandExecutor's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AndroidDeviceCommandExecutor (LCOM4 8) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/device/AndroidDeviceCommandExecutor.kt:405 — AndroidDeviceCommandExecutor's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TrailblazeMcpSessionContext (LCOM4 5) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpSessionContext.kt:94 — TrailblazeMcpSessionContext's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AccessibilityServiceScreenState (LCOM4 4) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityServiceScreenState.kt:54 — AccessibilityServiceScreenState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MaestroInteractionToolFactory (LCOM4 4) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/MaestroInteractionToolFactory.kt:36 — MaestroInteractionToolFactory's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SubagentOrchestrator (LCOM4 4) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/SubagentOrchestrator.kt:40 — SubagentOrchestrator's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×5
  • Edited copy of a member (22 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:598 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:598-619 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:752-774 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/DirectMcpAgent.kt:375 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/DirectMcpAgent.kt:375-396 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/InnerLoopScreenAnalyzer.kt:411-437 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:34 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:34-55 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:75-96 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogServerClient.kt:57 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogServerClient.kt:57-78 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogServerClient.kt:95-118 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:75 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:75-96 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:75-99 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×5
  • Edited copy of a member (9 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:1162 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:1162-1170 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RunToolsRoutes.kt:107-117 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:1112 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:1112-1120 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNode.kt:321-345 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/trailhead/TrailheadHandoffStore.kt:155 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/trailhead/TrailheadHandoffStore.kt:155-163 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/android/InProcessTrailheadReset.kt:69-77 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:2385 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:2385-2393 | trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:2734-2742 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/WorkspaceRoot.kt:124 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/WorkspaceRoot.kt:124-133 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliPathUtils.kt:104-112 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:197 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolRoutes.kt:197-226 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:366-390 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:375 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:375-401 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/SimctlCli.kt:244-268 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:112 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:112-138 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:153-177 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:815 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:815-839 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionAnalyzer.kt:886-915 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/MuxToMp4Consumer.kt:209 — trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/MuxToMp4Consumer.kt:209-236 | trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/PlaywrightVideoCapture.kt:145-169 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:809 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:809-825 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1175-1191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:809` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1170` calls `error` and `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:804` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:1886 — trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:1886-1902 | trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:1913-1929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:1886` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:24 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:24-40 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:93-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:1134 — build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:1134-1150 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:261-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:1134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:408 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:408-424 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:758-774 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×5
  • Duplicated block (15 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:405 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:405-419 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:559-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:225 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:225-239 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:250-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:225` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:249` calls `put` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/executor/HttpMcpToolExecutor.kt:224` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:740 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:740-754 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:802-816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:386 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:386-400 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:736-750 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:391 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:391-405 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/WebStreamScreenshotSupport.kt:102-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/WebStreamScreenshotSupport.kt:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×5
  • Duplicated block (13 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:191 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:191-203 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:330-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:392 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:392-404 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:673-685 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:392` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuneCommand.kt:138 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuneCommand.kt:138-150 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuneCommand.kt:248-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuneCommand.kt:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:52 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:52-64 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:101-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) examples/android-sample-app/src/main/java/xyz/block/trailblaze/examples/sampleapp/ui/screens/settings/SettingsScreen.kt:60 — examples/android-sample-app/src/main/java/xyz/block/trailblaze/examples/sampleapp/ui/screens/settings/SettingsScreen.kt:60-72 | examples/android-sample-app/src/main/java/xyz/block/trailblaze/examples/sampleapp/ui/screens/settings/SettingsScreen.kt:75-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `examples/android-sample-app/src/main/java/xyz/block/trailblaze/examples/sampleapp/ui/screens/settings/SettingsScreen.kt:60` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
AC4 · Keyboard semantics · Anchor without href · ×4
  • Anchor without href trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:525 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:764 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href REDACTED:435 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href REDACTED:1562 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×4
  • Edited copy of a member (32 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:197 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:197-231 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorSuggestCommand.kt:257-288 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:48 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:48-79 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:45-85 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:170 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:170-211 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/MaestroCommandToIosDriverActionConverter.kt:130-161 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:274 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityTrailRunner.kt:274-308 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/IosDriverTrailRunner.kt:166-197 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×4
  • Edited copy of a member (20 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:401 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:401-420 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:621-643 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:719 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:719-738 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:749-769 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:717 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:717-736 | trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityDeviceManager.kt:1388-1411 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:387 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:387-406 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/WebStreamScreenshotSupport.kt:96-118 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:382 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:382-404 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:663-685 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/AndroidLiveFrameStream.kt:31 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/AndroidLiveFrameStream.kt:31-53 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/AndroidLiveFrameStream.kt:67-97 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:561 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:561-591 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:623-645 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) trailblaze-agent/src/main/java/xyz/block/trailblaze/agent/trail/TrailblazeToolYamlWrapperJsonArgs.kt:30 — trailblaze-agent/src/main/java/xyz/block/trailblaze/agent/trail/TrailblazeToolYamlWrapperJsonArgs.kt:30-58 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolPayload.kt:122-144 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×4
  • Edited copy of a member (15 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:624 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:624-638 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:669-693 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/VideoDuration.kt:31 — trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/VideoDuration.kt:31-45 | trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/VideoFrameSize.kt:33-48 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:100 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:100-120 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:13-27 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/RpcHandlerExt.kt:21 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/RpcHandlerExt.kt:21-38 | trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/rpc/RpcRouteExt.kt:35-49 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×4
  • Duplicated block (18 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidBitmapUtils.kt:79 — trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidBitmapUtils.kt:79-96 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:118-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:24 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:24-41 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:113-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:113 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:113-130 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:154-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/utils/SelectorStrategyHelpers.kt:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `selectorBuilder` to `(TrailblazeElementSelector` in one and `(TrailblazeElementSelector) -> TrailblazeElementSelector?` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:258 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:258-275 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:263-280 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×4
  • Duplicated block (22 lines × 2 locations) sdks/typescript/src/client.ts:571 — sdks/typescript/src/client.ts:571 · sdks/typescript/src/testing.ts:303 — 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.
  • Duplicated block (22 lines × 2 locations) sdks/typescript/src/client.ts:653 — sdks/typescript/src/client.ts:653 · sdks/typescript/src/testing.ts:333 — 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.
  • Duplicated block (22 lines × 2 locations) sdks/typescript/src/tool-core.ts:458 — sdks/typescript/src/tool-core.ts:458 · sdks/typescript/src/tool-core.ts:516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:477 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:477 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:458 — 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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×4
  • JavaScript dependencies are not locked examples/android-sample-app/trails/config/host-tools/package.json:7 — examples/android-sample-app/trails/config/host-tools/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked examples/android-sample-app/trails/config/trailmaps/sampleapp/tools/mcp/package.json:7 — examples/android-sample-app/trails/config/trailmaps/sampleapp/tools/mcp/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked examples/playwright-electron/sample-app/package.json:6 — examples/playwright-electron/sample-app/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/e2e/package.json:9 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/e2e/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
AC2 · Forms & labels · <Select> field component without a label · ×3
  • <Select> field component without a label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:144 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:553 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label REDACTED:417 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D17 · Explicit Debt · TodoComment · ×3
  • TodoComment trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/McpContentBuilder.kt:63 — // TODO: Use MCP's native ImageContent type when SDK supports it — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailmapRoutes.kt:328 — // TODO: implement. Compose other tools via ctx.tools.*, read ctx.target, etc. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sdks/typescript/src/client.ts:728 — // TODO(#3323-followup): post-unwrap JSON Schema validation hook lands here once the
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:338 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:338-369 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:691-719 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:293 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:293-327 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:333-360 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/IndexStrategy.kt:12 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/IndexStrategy.kt:12-55 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/IndexStrategy.kt:57-84 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:362 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:362-370 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:592-600 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:542-551 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:849-857 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1019 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1019-1074 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1104-1144 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1295-1390 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1454-1504 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:288 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:288-359 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorCompose.kt:146-164 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorIosAxe.kt:123-164 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorWeb.kt:59-87 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:174 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:174-200 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:450-477 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:40 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:40-66 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/matching/TrailblazeNodeMapperMaestro.kt:68-95 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolRepo.kt:565 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolRepo.kt:565-595 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/TrailblazeToolRepo.kt:630-656 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) trailblaze-host/src/main/resources/networkcapture/mitmproxy_netcapture.py:254 — trailblaze-host/src/main/resources/networkcapture/mitmproxy_netcapture.py:254-271 | trailblaze-host/src/main/resources/networkcapture/mitmproxy_netcapture.py:274-296 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRunnerEndpoint.kt:208 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRunnerEndpoint.kt:208-225 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRunnerEndpoint.kt:265-285 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/McpSamplingClient.kt:262 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/McpSamplingClient.kt:262-283 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/SubagentOrchestrator.kt:167-184 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×3
  • Edited copy of a member (21 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:165 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:165-185 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:76-96 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapSource.kt:130 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapSource.kt:130-150 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapSource.kt:173-193 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/PrecompiledApkInstaller.kt:28 — trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/PrecompiledApkInstaller.kt:28-48 | trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/PrecompiledApkInstaller.kt:148-170 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×3
  • Edited copy of a member (7 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailLabelWriter.kt:162 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailLabelWriter.kt:162-168 | trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/TrailLabel.kt:178-195 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/LazyYamlScriptedToolRegistration.kt:881 — trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/LazyYamlScriptedToolRegistration.kt:881-887 | trailblaze-scripting-mcp-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/mcp/McpToolDescriptors.kt:73-79 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/codegen/TrailRunnerDtoTsBindings.kt:236 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/codegen/TrailRunnerDtoTsBindings.kt:236-243 | trailblaze-models/src/jvmMain/kotlin/xyz/block/trailblaze/codegen/HostRpcDtoTsBindings.kt:90-96 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×3
  • Edited copy of a member (5 corresponding lines) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:483 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:483-487 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:833-837 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceCompileBootstrap.kt:575 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceCompileBootstrap.kt:575-579 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:906-913 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogWebSocketClient.kt:138 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogWebSocketClient.kt:138-142 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/android/ondevice/rpc/OnDeviceRpcWebSocketClient.kt:243-248 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×3
  • Edited copy of a member (6 corresponding lines) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:453 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:453-458 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:803-808 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/TrailblazeTrailmapBundler.kt:660 — trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/TrailblazeTrailmapBundler.kt:660-665 | trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/WorkspaceClientDtsGenerator.kt:553-561 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) trailblaze-report/src/main/java/xyz/block/trailblaze/report/StoryboardHtmlBuilder.kt:1030 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/StoryboardHtmlBuilder.kt:1030-1038 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/snapshot/SnapshotViewerGenerator.kt:137-142 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:134 — build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:134-155 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:618-639 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `ext` to `TrailblazeSdkBundleExtension` in one and `TrailblazeSdkDtsBundleExtension` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (22 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/endpoints/LogScreenshotPostEndpoint.kt:39 — trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/endpoints/LogScreenshotPostEndpoint.kt:39-60 | trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/endpoints/LogTracePostEndpoint.kt:26-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (22 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidAccessibilityClickTrailblazeTool.kt:50 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidAccessibilityClickTrailblazeTool.kt:50-71 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidGestureTapTrailblazeTool.kt:52-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidAccessibilityClickTrailblazeTool.kt:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:136 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:136-151 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:143-158 — before extracting anything, compare `trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1129 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1129-1144 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1374-1389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:221 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:221-236 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightNativeHostDriverDescriptor.kt:252-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) trailblaze-agent/src/main/java/xyz/block/trailblaze/agent/TrailblazeElementComparator.kt:287 — trailblaze-agent/src/main/java/xyz/block/trailblaze/agent/TrailblazeElementComparator.kt:287-300 | trailblaze-agent/src/main/java/xyz/block/trailblaze/agent/TrailblazeElementComparator.kt:366-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-agent/src/main/java/xyz/block/trailblaze/agent/TrailblazeElementComparator.kt:287` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:226 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:226-239 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:338-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:898 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:898-912 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1110-1123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:898` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D5 · Coupling · Unstable project · ×3
  • Unstable project :trailblaze-android-ondevice-mcp — :trailblaze-android-ondevice-mcp has instability 0.83 with 1 dependents.
  • Unstable project :trailblaze-host — :trailblaze-host has instability 0.88 with 2 dependents.
  • Unstable project :trailblaze-server — :trailblaze-server has instability 0.83 with 2 dependents.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×3
  • Duplicated block (13 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2933 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2933 · REDACTED:1685 — 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.
  • Duplicated block (13 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:851 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:851 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:422 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (13 lines × 2 locations) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:20 — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:20 · trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:54 — 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 (12 lines × 3 locations) · ×3
  • Duplicated block (12 lines × 3 locations) sdks/typescript/src/client.ts:480 — sdks/typescript/src/client.ts:480 · sdks/typescript/src/client.ts:645 · sdks/typescript/src/testing.ts:328 — the 3 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 (12 lines × 3 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor-sync.js:97 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor-sync.js:97 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/lsp-convert.js:48 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:437 — 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 (12 lines × 3 locations) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer-bundle.macro.ts:12 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer-bundle.macro.ts:12 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell-bundle.macro.ts:11 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer-bundle.macro.ts:18 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×3
  • Duplicated block (12 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:972 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:972 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1015 — 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) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:714 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:714 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2 locations) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2089 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2089 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2104 — 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 (11 lines × 2 locations) · ×3
  • Duplicated block (11 lines × 2 locations) sdks/typescript/src/history.ts:75 — sdks/typescript/src/history.ts:75 · sdks/typescript/src/session-events.ts:104 — 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 (11 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:586 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:586 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:445 — 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 (11 lines × 2 locations) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1588 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1588 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8932 — 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.
AC3 · Page structure · Page without a main landmark · ×2
  • Page without a main landmark trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1278 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.8 · ×2
  • Low contrast colour pair in CSS (2.8:1) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:468 — `.waypoint-no-screenshot` sets color: #8b94a6 on background-color: #f4f6fa — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (2.8:1) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1241 — `.screen-card .screen-no-thumb` sets color: #8b94a6 on background-color: #f4f6fa — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · record.RecordScreen · ×2
  • record.RecordScreen::propose (cyclomatic 29) REDACTED:962 — record.RecordScreen::propose has cyclomatic complexity 29 (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. This shape REPEATS in the file: 2 other methods here (record.RecordScreen, record.RecordScreen::runAdhocYaml) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • record.RecordScreen::runAdhocYaml (cyclomatic 21) REDACTED:1194 — record.RecordScreen::runAdhocYaml 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. This shape REPEATS in the file: 2 other methods here (record.RecordScreen, record.RecordScreen::propose) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · perf-viewer.PERF_VIEWER · ×2
  • perf-viewer.PERF_VIEWER::drawBlock (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:331 — perf-viewer.PERF_VIEWER::drawBlock 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. This shape REPEATS in the file: 2 other methods here (perf-viewer.PERF_VIEWER, perf-viewer.PERF_VIEWER::renderInspector) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • perf-viewer.PERF_VIEWER::renderInspector (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:693 — perf-viewer.PERF_VIEWER::renderInspector 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. This shape REPEATS in the file: 2 other methods here (perf-viewer.PERF_VIEWER, perf-viewer.PERF_VIEWER::drawBlock) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · trail-yaml.normalizeScratchTrailYaml · ×2
  • trail-yaml.normalizeScratchTrailYaml::legacyTrailheadToUnified (cyclomatic 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:236 — trail-yaml.normalizeScratchTrailYaml::legacyTrailheadToUnified 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. This shape REPEATS in the file: 2 other methods here (trail-yaml.normalizeScratchTrailYaml, trail-yaml.normalizeScratchTrailYaml::fragmentToStep) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • trail-yaml.normalizeScratchTrailYaml::fragmentToStep (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:352 — trail-yaml.normalizeScratchTrailYaml::fragmentToStep has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (trail-yaml.normalizeScratchTrailYaml, trail-yaml.normalizeScratchTrailYaml::legacyTrailheadToUnified) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D2 · Cognitive Complexity · perf-viewer.PERF_VIEWER · ×2
  • perf-viewer.PERF_VIEWER::drawBlock (cognitive 51) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:331 — perf-viewer.PERF_VIEWER::drawBlock has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 3 (9 pts), boolean chains 8, loops 3 (7 pts) (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. This shape REPEATS in the file: 2 other methods here (perf-viewer.PERF_VIEWER, perf-viewer.PERF_VIEWER::renderInspector) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • perf-viewer.PERF_VIEWER::renderInspector (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:693 — perf-viewer.PERF_VIEWER::renderInspector has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 7, 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. This shape REPEATS in the file: 2 other methods here (perf-viewer.PERF_VIEWER, perf-viewer.PERF_VIEWER::drawBlock) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D2 · Cognitive Complexity · record.RecordScreen · ×2
  • record.RecordScreen::propose (cognitive 30) REDACTED:962 — record.RecordScreen::propose has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (11 pts), ternaries 4 (5 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. This shape REPEATS in the file: 2 other methods here (record.RecordScreen, record.RecordScreen::runAdhocYaml) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • record.RecordScreen::runAdhocYaml (cognitive 20) REDACTED:1194 — record.RecordScreen::runAdhocYaml has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 3 (6 pts), error handling 1 (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. This shape REPEATS in the file: 2 other methods here (record.RecordScreen, record.RecordScreen::propose) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D2 · Cognitive Complexity · normalizeScratchTrailYaml · ×2
  • normalizeScratchTrailYaml::fragmentToStep (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:352 — normalizeScratchTrailYaml::fragmentToStep has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, ternaries 1 (2 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.
  • normalizeScratchTrailYaml::legacyTrailheadToUnified (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:236 — normalizeScratchTrailYaml::legacyTrailheadToUnified has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (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.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×2
  • Edited copy of a member (30 corresponding lines) trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:203 — trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:203-232 | trailblaze-tracing/src/commonMain/kotlin/xyz/block/trailblaze/tracing/TrailblazeTraceRecorder.kt:248-279 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/MaestroTrailblazeAgent.kt:316 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/MaestroTrailblazeAgent.kt:316-346 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:169-198 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:676 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:676-717 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeNodeMapper.kt:192-245 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/config/TrailblazeToolParameterConfig.kt:91 — trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/config/TrailblazeToolParameterConfig.kt:91-132 | trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailArgConfig.kt:260-308 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×2
  • Edited copy of a member (33 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:795 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:795-831 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:345-377 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:583 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:583-625 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:218-250 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:404 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:404-421 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/AssertionLogger.kt:153-172 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/MaestroCommandToIosDriverActionConverter.kt:309-324 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:507 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:507-526 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:619-634 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:645-660 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidAccessibilityClickTrailblazeTool.kt:49 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidAccessibilityClickTrailblazeTool.kt:49-79 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/tools/AndroidGestureTapTrailblazeTool.kt:51-81 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:214 — trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:214-244 | trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/rpc/ComposeRpcTrailblazeAgent.kt:270-305 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/SimctlCommand.kt:28 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/SimctlCommand.kt:28-42 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliConfigHelper.kt:441-456 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeCli.kt:562-575 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/metrics/AgentMetrics.kt:71 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/metrics/AgentMetrics.kt:71-84 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/metrics/AgentMetrics.kt:95-109 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/metrics/AgentMetrics.kt:119-132 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:136 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:136-144 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:42-50 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/SubagentOrchestrator.kt:108-116 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:142 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:142-150 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:157-165 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:171-179 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertNotVisibleWithTextTrailblazeTool.kt:92 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertNotVisibleWithTextTrailblazeTool.kt:92-106 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertVisibleWithAccessibilityTextTrailblazeTool.kt:36-48 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertVisibleWithResourceIdTrailblazeTool.kt:35-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertNotVisibleBySelectorTrailblazeTool.kt:55 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertNotVisibleBySelectorTrailblazeTool.kt:55-67 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/AssertVisibleBySelectorTrailblazeTool.kt:63-76 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/WaitUntilNotVisibleTrailblazeTool.kt:84-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) REDACTED:1164 — REDACTED:1164-1203 | REDACTED:1376-1415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (40 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:661 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:661-700 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:253-292 — before extracting anything, compare `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt` and `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:661` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:428 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:428-450 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:778-800 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:377 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:377-399 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/SimctlCli.kt:245-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:139 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:139-155 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:211-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:147 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:147-163 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:56-71 — before extracting anything, compare `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:189 — trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:189-202 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:454-465 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:381 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:381-394 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/MaestroCommandToIosDriverActionConverter.kt:294-305 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/MaestroCommandConverter.kt:381` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:178 — trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:178-190 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:454-467 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-report/src/main/java/xyz/block/trailblaze/report/PerformanceAnalysisGenerator.kt:178` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13–14 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:108 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:108-120 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:14-27 — before extracting anything, compare `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:108` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:574 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:574-584 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:753-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:574` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11–12 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:217 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:217-228 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/resources/TrailblazeMcpResources.kt:173-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SegmentListCommand.kt:58 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SegmentListCommand.kt:58-68 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuneCommand.kt:112-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SegmentListCommand.kt:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:167 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:167-176 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorSuggestCommand.kt:243-253 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorMatchCommand.kt:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidMaestro.kt:58 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidMaestro.kt:58-65 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:177-184 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorIosMaestro.kt:122-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidMaestro.kt:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:137 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:137-144 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:43-50 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/SubagentOrchestrator.kt:109-116 — before extracting anything, compare `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×2
  • Duplicated block (14 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2496 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2496 · REDACTED:548 — 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 (14 lines × 2 locations) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:593 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:593 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:636 — 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.
R11 · Import Boundaries · Boundary violation [package · ×2
  • Boundary violation [package:third-party-deep-import] sdks/typescript/src/tool.ts:12 — sdks/typescript/src/tool.ts:12 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:56 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:56 reaches into another package with a relative path (../../../../../../../../../../../sdks/typescript/src/rpc/client) — import the package by name instead.
R7 · Dead Code · Dead file (~33 LoC) · ×2
  • Dead file (~33 LoC) trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts — no import path from any entry point (216 application, 8 tooling, 86 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 (~33 LoC) trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts — no import path from any entry point (216 application, 8 tooling, 86 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
X1 · Async correctness · Blocking `Thread.sleep` inside a coroutine · ×2
  • Blocking `Thread.sleep` inside a coroutine trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:96 — This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`.
  • Blocking `Thread.sleep` inside a coroutine trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:128 — This coroutine runs on a dispatcher's thread, and `Thread.sleep` blocks that thread: for the whole delay no other coroutine scheduled on it makes progress (on `Dispatchers.Main` the UI freezes) — the Kotlin form of blocking on a task. Use `delay(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a call that cannot be made suspending, move it off the dispatcher with `withContext(Dispatchers.IO) { … }`.
X2 · Cancellation propagation · Suspend function with a blocking request · ×2
  • Suspend function with a blocking request: executeFetch trailblaze-scripting-fetch/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/scripting/fetch/OkHttpFetchExtension.kt:173 — `executeFetch` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
  • Suspend function with a blocking request: downloadToTempFile trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/MobileDeviceUtils.kt:357 — `downloadToTempFile` suspends, but makes its request with `URL(…).openStream()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
D1 · Cyclomatic Complexity · steps-board.StepsBoard (cyclomatic 299) · ×1
  • steps-board.StepsBoard (cyclomatic 299) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:440 — steps-board.StepsBoard has cyclomatic complexity 299 (threshold 15). Of this number, 44 points are the body's own statements and 255 belong to 66 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.
D1 · Cyclomatic Complexity · run-report-extract.extractTrace (cyclomatic 198) · ×1
  • run-report-extract.extractTrace (cyclomatic 198) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556 — run-report-extract.extractTrace has cyclomatic complexity 198 (threshold 15). Of this number, 181 points are the body's own statements and 17 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.
D1 · Cyclomatic Complexity · trails.TrailsScreen (cyclomatic 189) · ×1
  • trails.TrailsScreen (cyclomatic 189) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:6 — trails.TrailsScreen has cyclomatic complexity 189 (threshold 15). Of this number, 86 points are the body's own statements and 103 belong to 32 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.
D1 · Cyclomatic Complexity · record.RecordScreen (cyclomatic 177) · ×1
  • record.RecordScreen (cyclomatic 177) REDACTED:474 — record.RecordScreen has cyclomatic complexity 177 (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. This shape REPEATS in the file: 2 other methods here (record.RecordScreen::propose, record.RecordScreen::runAdhocYaml) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · waypoint-graph-template.html.SubwayView (cyclomatic 153) · ×1
  • waypoint-graph-template.html.SubwayView (cyclomatic 153) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1992 — waypoint-graph-template.html.SubwayView has cyclomatic complexity 153 (threshold 15). Most of this is not in the body itself: 13 of the 153 points are its own statements and the rest belongs to 47 function items inside it that branch (a function literal at line 2510, a function literal at line 2400, a function literal at line 2243, …). 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.
D1 · Cyclomatic Complexity · ui.Select (cyclomatic 131) · ×1
  • ui.Select (cyclomatic 131) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:130 — ui.Select has cyclomatic complexity 131 (threshold 15). Of this number, 30 points are the body's own statements and 101 belong to 26 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 · sessions.SessionsScreen (cyclomatic 124) · ×1
  • sessions.SessionsScreen (cyclomatic 124) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:71 — sessions.SessionsScreen has cyclomatic complexity 124 (threshold 15). Of this number, 71 points are the body's own statements and 53 belong to 17 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.
D1 · Cyclomatic Complexity · devices.EditTargetModal (cyclomatic 122) · ×1
  • devices.EditTargetModal (cyclomatic 122) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:330 — devices.EditTargetModal has cyclomatic complexity 122 (threshold 15). Of this number, 41 points are the body's own statements and 81 belong to 21 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.
D1 · Cyclomatic Complexity · run-report-summary-model.buildSummaryModel (cyclomatic 116) · ×1
  • run-report-summary-model.buildSummaryModel (cyclomatic 116) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1652 — run-report-summary-model.buildSummaryModel has cyclomatic complexity 116 (threshold 15). Of this number, 96 points are the body's own statements and 20 belong to 10 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.
D1 · Cyclomatic Complexity · run-report-theater-model.buildTheaterStory (cyclomatic 108) · ×1
  • run-report-theater-model.buildTheaterStory (cyclomatic 108) REDACTED:400 — run-report-theater-model.buildTheaterStory has cyclomatic complexity 108 (threshold 15). Of this number, 41 points are the body's own statements and 67 belong to 8 function literals 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.
D1 · Cyclomatic Complexity · record.ProposalCard (cyclomatic 104) · ×1
  • record.ProposalCard (cyclomatic 104) REDACTED:2244 — record.ProposalCard has cyclomatic complexity 104 (threshold 15). Of this number, 42 points are the body's own statements and 62 belong to 20 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.
D1 · Cyclomatic Complexity · runconfig.RunConfigDialog (cyclomatic 103) · ×1
  • runconfig.RunConfigDialog (cyclomatic 103) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:6 — runconfig.RunConfigDialog has cyclomatic complexity 103 (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. This shape REPEATS in the file: one other method here (runconfig.RunConfigDialog::run) 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.
D1 · Cyclomatic Complexity · run-report-shell.RUN_REPORT_SHELL (cyclomatic 103) · ×1
  • run-report-shell.RUN_REPORT_SHELL (cyclomatic 103) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:771 — run-report-shell.RUN_REPORT_SHELL has cyclomatic complexity 103 (threshold 15). Of this number, 19 points are the body's own statements and 84 belong to 33 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.
D1 · Cyclomatic Complexity · run-report-viewer.RUN_REPORT_VIEWER (cyclomatic 98) · ×1
  • run-report-viewer.RUN_REPORT_VIEWER (cyclomatic 98) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:60 — run-report-viewer.RUN_REPORT_VIEWER has cyclomatic complexity 98 (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. This shape REPEATS in the file: 43 other methods here (run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, run-report-viewer.RUN_REPORT_VIEWER::readRoute, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 44 times rather than 44 independent problems. Splitting this body alone leaves the other 43 exactly as they are. Where these are variations on one operation, the change that clears all 44 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.
D1 · Cyclomatic Complexity · tools.ToolsScreen (cyclomatic 92) · ×1
  • tools.ToolsScreen (cyclomatic 92) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:399 — tools.ToolsScreen has cyclomatic complexity 92 (threshold 15). Of this number, 36 points are the body's own statements and 56 belong to 19 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.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater (cyclomatic 92) · ×1
  • run-report-theater.mountTheater (cyclomatic 92) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:213 — run-report-theater.mountTheater has cyclomatic complexity 92 (threshold 15). Of this number, 38 points are the body's own statements and 54 belong to 11 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.
D1 · Cyclomatic Complexity · editor.TrailYamlEditor (cyclomatic 90) · ×1
  • editor.TrailYamlEditor (cyclomatic 90) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:667 — editor.TrailYamlEditor has cyclomatic complexity 90 (threshold 15). Of this number, 59 points are the body's own statements and 31 belong to 14 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 · shell.App (cyclomatic 90) · ×1
  • shell.App (cyclomatic 90) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:747 — shell.App has cyclomatic complexity 90 (threshold 15). Of this number, 27 points are the body's own statements and 63 belong to 14 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.
D1 · Cyclomatic Complexity · record.TrailheadStep (cyclomatic 80) · ×1
  • record.TrailheadStep (cyclomatic 80) REDACTED:334 — record.TrailheadStep has cyclomatic complexity 80 (threshold 15). Of this number, 67 points are the body's own statements and 13 belong to 4 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.
D1 · Cyclomatic Complexity · steps-board.ToolCallsPopover (cyclomatic 78) · ×1
  • steps-board.ToolCallsPopover (cyclomatic 78) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:249 — steps-board.ToolCallsPopover has cyclomatic complexity 78 (threshold 15). Of this number, 33 points are the body's own statements and 45 belong to 16 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.
D1 · Cyclomatic Complexity · trace-viewer.TraceViewer (cyclomatic 76) · ×1
  • trace-viewer.TraceViewer (cyclomatic 76) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:72 — trace-viewer.TraceViewer has cyclomatic complexity 76 (threshold 15). Of this number, 49 points are the body's own statements and 27 belong to 11 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.
D1 · Cyclomatic Complexity · TrailCommand.runTrail (cyclomatic 75) · ×1
  • TrailCommand.runTrail (cyclomatic 75) REDACTED:764 — TrailCommand.runTrail has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DesktopYamlRunner.runYaml (cyclomatic 75) · ×1
  • DesktopYamlRunner.runYaml (cyclomatic 75) trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt:1017 — DesktopYamlRunner.runYaml has cyclomatic complexity 75 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · demonstrate.DemonstrateFlow (cyclomatic 75) · ×1
  • demonstrate.DemonstrateFlow (cyclomatic 75) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:132 — demonstrate.DemonstrateFlow has cyclomatic complexity 75 (threshold 15). Of this number, 25 points are the body's own statements and 50 belong to 8 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.
D1 · Cyclomatic Complexity · devices.TargetDevicePicker (cyclomatic 69) · ×1
  • devices.TargetDevicePicker (cyclomatic 69) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:10 — devices.TargetDevicePicker has cyclomatic complexity 69 (threshold 15). Of this number, 34 points are the body's own statements and 35 belong to 11 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.
D1 · Cyclomatic Complexity · demonstrate.DemoGeneratePhase (cyclomatic 67) · ×1
  • demonstrate.DemoGeneratePhase (cyclomatic 67) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:532 — demonstrate.DemoGeneratePhase has cyclomatic complexity 67 (threshold 15). Of this number, 43 points are the body's own statements and 24 belong to 10 function literals 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.
D1 · Cyclomatic Complexity · device-console.DeviceConsoleCard (cyclomatic 66) · ×1
  • device-console.DeviceConsoleCard (cyclomatic 66) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:218 — device-console.DeviceConsoleCard has cyclomatic complexity 66 (threshold 15). Of this number, 38 points are the body's own statements and 28 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.
D1 · Cyclomatic Complexity · device-console.ToolComposer (cyclomatic 66) · ×1
  • device-console.ToolComposer (cyclomatic 66) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:400 — device-console.ToolComposer has cyclomatic complexity 66 (threshold 15). Of this number, 50 points are the body's own statements and 16 belong to 7 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.
D1 · Cyclomatic Complexity · monaco-lsp.mountLsp (cyclomatic 65) · ×1
  • monaco-lsp.mountLsp (cyclomatic 65) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:491 — monaco-lsp.mountLsp has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 3 of the 65 points are its own statements and the rest belongs to 20 function items inside it that branch (build, a function literal at line 579, a function literal at line 666, …). 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.
D1 · Cyclomatic Complexity · device-console.DeviceConsoleScreen (cyclomatic 65) · ×1
  • device-console.DeviceConsoleScreen (cyclomatic 65) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:18 — device-console.DeviceConsoleScreen has cyclomatic complexity 65 (threshold 15). Of this number, 18 points are the body's own statements and 47 belong to 21 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.
D1 · Cyclomatic Complexity · run-report-clip-player.adopt (cyclomatic 65) · ×1
  • run-report-clip-player.adopt (cyclomatic 65) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:338 — run-report-clip-player.adopt has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 2 of the 65 points are its own statements and the rest belongs to 20 function literals inside it that branch (lines 345, 435, 390, …). 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.
D1 · Cyclomatic Complexity · run-report-shell.analysisProblem (cyclomatic 64) · ×1
  • run-report-shell.analysisProblem (cyclomatic 64) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:405 — run-report-shell.analysisProblem has cyclomatic complexity 64 (threshold 15). Of this number, 44 points are the body's own statements and 20 belong to 3 function literals 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.
D1 · Cyclomatic Complexity · trailmaps.ComponentTypeScreen (cyclomatic 63) · ×1
  • trailmaps.ComponentTypeScreen (cyclomatic 63) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:90 — trailmaps.ComponentTypeScreen has cyclomatic complexity 63 (threshold 15). Of this number, 29 points are the body's own statements and 34 belong to 12 function literals 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.
D1 · Cyclomatic Complexity · run-report-strings.stringsTabHtml (cyclomatic 63) · ×1
  • run-report-strings.stringsTabHtml (cyclomatic 63) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings.ts:358 — run-report-strings.stringsTabHtml has cyclomatic complexity 63 (threshold 15). Of this number, 35 points are the body's own statements and 28 belong to 16 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 · MaestroYamlSerializer.toPrimitive (cyclomatic 62) · ×1
  • MaestroYamlSerializer.toPrimitive (cyclomatic 62) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroYamlSerializer.kt:198 — MaestroYamlSerializer.toPrimitive has cyclomatic complexity 62 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · waypoint-graph-template.html.App (cyclomatic 62) · ×1
  • waypoint-graph-template.html.App (cyclomatic 62) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:3195 — waypoint-graph-template.html.App has cyclomatic complexity 62 (threshold 15). Of this number, 32 points are the body's own statements and 30 belong to 14 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.
D1 · Cyclomatic Complexity · external-agents.AgentComposer (cyclomatic 61) · ×1
  • external-agents.AgentComposer (cyclomatic 61) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1019 — external-agents.AgentComposer has cyclomatic complexity 61 (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. This shape REPEATS in the file: one other method here (external-agents.AgentComposer::send) 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.
D1 · Cyclomatic Complexity · ui.SearchableText (cyclomatic 61) · ×1
  • ui.SearchableText (cyclomatic 61) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:546 — ui.SearchableText has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 11 of the 61 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 582, a function literal at line 627, a function literal at line 573, …). 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.
D1 · Cyclomatic Complexity · editor.CodeEditor (cyclomatic 60) · ×1
  • editor.CodeEditor (cyclomatic 60) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:13 — editor.CodeEditor has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 5 of the 60 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 152, 27, 43, …). 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.
D1 · Cyclomatic Complexity · IosCompactElementList.buildRecursive (cyclomatic 59) · ×1
  • IosCompactElementList.buildRecursive (cyclomatic 59) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:87 — IosCompactElementList.buildRecursive 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.
D1 · Cyclomatic Complexity · SessionSummary.fromLogs (cyclomatic 59) · ×1
  • SessionSummary.fromLogs (cyclomatic 59) trailblaze-report/src/main/java/xyz/block/trailblaze/report/models/SessionSummary.kt:65 — SessionSummary.fromLogs has cyclomatic complexity 59 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · settings.SettingsScreen (cyclomatic 59) · ×1
  • settings.SettingsScreen (cyclomatic 59) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx:63 — settings.SettingsScreen has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 12 of the 59 points are its own statements and the rest belongs to 12 function items inside it that branch (WorkspaceBody, pickDir, PortSetting, …). 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.
D1 · Cyclomatic Complexity · run-report-extract.slimTraceForShare (cyclomatic 59) · ×1
  • run-report-extract.slimTraceForShare (cyclomatic 59) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1639 — run-report-extract.slimTraceForShare has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 2 of the 59 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1640, 1681, 1650, …). 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.
D1 · Cyclomatic Complexity · run-report-extract.decisionLlmRow (cyclomatic 58) · ×1
  • run-report-extract.decisionLlmRow (cyclomatic 58) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1425 — run-report-extract.decisionLlmRow has cyclomatic complexity 58 (threshold 15). Of this number, 29 points are the body's own statements and 29 belong to 8 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.
D1 · Cyclomatic Complexity · external-agents.AgentToolCard (cyclomatic 57) · ×1
  • external-agents.AgentToolCard (cyclomatic 57) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2144 — external-agents.AgentToolCard has cyclomatic complexity 57 (threshold 15). Of this number, 56 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · zip-report-core.buildRunMeta (cyclomatic 56) · ×1
  • zip-report-core.buildRunMeta (cyclomatic 56) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:521 — zip-report-core.buildRunMeta has cyclomatic complexity 56 (threshold 15). Of this number, 54 points are the body's own statements and 2 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · TrailblazeRecordingGeneratorKt.generateRecordedTrailItems (cyclomatic 54) · ×1
  • TrailblazeRecordingGeneratorKt.generateRecordedTrailItems (cyclomatic 54) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt:272 — TrailblazeRecordingGeneratorKt.generateRecordedTrailItems has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli-main.runSurveyCli (cyclomatic 54) · ×1
  • cli-main.runSurveyCli (cyclomatic 54) sdks/typescript/src/surveys/cli-main.ts:56 — cli-main.runSurveyCli has cyclomatic complexity 54 (threshold 15). Of this number, 53 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.
D1 · Cyclomatic Complexity · shell.NavRail (cyclomatic 54) · ×1
  • shell.NavRail (cyclomatic 54) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:381 — shell.NavRail has cyclomatic complexity 54 (threshold 15). Of this number, 34 points are the body's own statements and 20 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.
D1 · Cyclomatic Complexity · run-report-strings.buildStringsModel (cyclomatic 53) · ×1
  • run-report-strings.buildStringsModel (cyclomatic 53) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings.ts:113 — run-report-strings.buildStringsModel has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 10 of the 53 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 139, a function literal at line 195, shotFor, …). 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.
D1 · Cyclomatic Complexity · StepToolSet.step (cyclomatic 52) · ×1
  • StepToolSet.step (cyclomatic 52) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:322 — StepToolSet.step has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExternalAgentRoutesKt.externalAgentRoutes (cyclomatic 51) · ×1
  • ExternalAgentRoutesKt.externalAgentRoutes (cyclomatic 51) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:60 — ExternalAgentRoutesKt.externalAgentRoutes has cyclomatic complexity 51 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · steps-board.RecordConfigDialog (cyclomatic 51) · ×1
  • steps-board.RecordConfigDialog (cyclomatic 51) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1188 — steps-board.RecordConfigDialog has cyclomatic complexity 51 (threshold 15). Of this number, 30 points are the body's own statements and 21 belong to 4 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.
D1 · Cyclomatic Complexity · run-report-clip-player.parseWebm (cyclomatic 51) · ×1
  • run-report-clip-player.parseWebm (cyclomatic 51) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:104 — run-report-clip-player.parseWebm has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 15 of the 51 points are its own statements and the rest belongs to 11 function items inside it that branch (walk, a function literal at line 116, readBlock, …). 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.
D1 · Cyclomatic Complexity · companion.CompanionScreen (cyclomatic 50) · ×1
  • companion.CompanionScreen (cyclomatic 50) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:528 — companion.CompanionScreen has cyclomatic complexity 50 (threshold 15). Of this number, 29 points are the body's own statements and 21 belong to 5 function literals 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.
D1 · Cyclomatic Complexity · record.ProposalToolRow (cyclomatic 50) · ×1
  • record.ProposalToolRow (cyclomatic 50) REDACTED:2126 — record.ProposalToolRow has cyclomatic complexity 50 (threshold 15). Of this number, 25 points are the body's own statements and 25 belong to 8 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.
D1 · Cyclomatic Complexity · perf-extract.nestAndAccount (cyclomatic 50) · ×1
  • perf-extract.nestAndAccount (cyclomatic 50) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:473 — perf-extract.nestAndAccount has cyclomatic complexity 50 (threshold 15). Of this number, 30 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.
D1 · Cyclomatic Complexity · stream-write.writeDerivedStreams (cyclomatic 48) · ×1
  • stream-write.writeDerivedStreams (cyclomatic 48) sdks/typescript/src/surveys/stream-write.ts:116 — stream-write.writeDerivedStreams has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 11 of the 48 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 145, 149, 152, …). 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.
D1 · Cyclomatic Complexity · run-report-extract.extractLlmLogs (cyclomatic 48) · ×1
  • run-report-extract.extractLlmLogs (cyclomatic 48) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1301 — run-report-extract.extractLlmLogs has cyclomatic complexity 48 (threshold 15). Of this number, 33 points are the body's own statements and 15 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.
D1 · Cyclomatic Complexity · run-report-perfetto.buildPerfettoTrace (cyclomatic 48) · ×1
  • run-report-perfetto.buildPerfettoTrace (cyclomatic 48) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-perfetto.ts:237 — run-report-perfetto.buildPerfettoTrace has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 239, 325, 296, …). 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.
D1 · Cyclomatic Complexity · AndroidVectorIconRasterizer.parseSvgPath (cyclomatic 47) · ×1
  • AndroidVectorIconRasterizer.parseSvgPath (cyclomatic 47) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:220 — AndroidVectorIconRasterizer.parseSvgPath 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.
D1 · Cyclomatic Complexity · record.StepCard (cyclomatic 47) · ×1
  • record.StepCard (cyclomatic 47) REDACTED:1921 — record.StepCard has cyclomatic complexity 47 (threshold 15). Of this number, 37 points are the body's own statements and 10 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.
D1 · Cyclomatic Complexity · trail-tree.TrailTree · ×1
  • trail-tree.TrailTree::onTreeKeyDown (cyclomatic 47) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:182 — trail-tree.TrailTree::onTreeKeyDown 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. This shape REPEATS in the file: one other method here (trail-tree.TrailTree) 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.
D1 · Cyclomatic Complexity · AndroidCompactElementList.buildRecursive (cyclomatic 46) · ×1
  • AndroidCompactElementList.buildRecursive (cyclomatic 46) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:274 — AndroidCompactElementList.buildRecursive has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shell.WorkspaceChip (cyclomatic 46) · ×1
  • shell.WorkspaceChip (cyclomatic 46) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:158 — shell.WorkspaceChip has cyclomatic complexity 46 (threshold 15). Of this number, 34 points are the body's own statements and 12 belong to 5 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.
D1 · Cyclomatic Complexity · runconfig.RunConfigDialog · ×1
  • runconfig.RunConfigDialog::run (cyclomatic 45) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:301 — runconfig.RunConfigDialog::run 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. This shape REPEATS in the file: one other method here (runconfig.RunConfigDialog) 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.
D1 · Cyclomatic Complexity · trail-tree.TrailTree (cyclomatic 44) · ×1
  • trail-tree.TrailTree (cyclomatic 44) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:76 — trail-tree.TrailTree has cyclomatic complexity 44 (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. This shape REPEATS in the file: one other method here (trail-tree.TrailTree::onTreeKeyDown) 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.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary (cyclomatic 44) · ×1
  • run-report-summary.mountSummary (cyclomatic 44) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:325 — run-report-summary.mountSummary has cyclomatic complexity 44 (threshold 15). Of this number, 34 points are the body's own statements and 10 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.
D1 · Cyclomatic Complexity · external-agents.AgentTranscriptItem (cyclomatic 43) · ×1
  • external-agents.AgentTranscriptItem (cyclomatic 43) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1993 — external-agents.AgentTranscriptItem has cyclomatic complexity 43 (threshold 15). Of this number, 40 points are the body's own statements and 3 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · record.selectorMeta (cyclomatic 42) · ×1
  • record.selectorMeta (cyclomatic 42) REDACTED:43 — record.selectorMeta has cyclomatic complexity 42 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DeviceManagerToolSet.device (cyclomatic 41) · ×1
  • DeviceManagerToolSet.device (cyclomatic 41) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:187 — DeviceManagerToolSet.device has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runconfig-steps.RunStepsPane (cyclomatic 41) · ×1
  • runconfig-steps.RunStepsPane (cyclomatic 41) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:223 — runconfig-steps.RunStepsPane has cyclomatic complexity 41 (threshold 15). Of this number, 34 points are the body's own statements and 7 belong to 4 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.
D1 · Cyclomatic Complexity · companion.CompanionGuidance (cyclomatic 41) · ×1
  • companion.CompanionGuidance (cyclomatic 41) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:87 — companion.CompanionGuidance has cyclomatic complexity 41 (threshold 15). Of this number, 33 points are the body's own statements and 8 belong to 3 function literals 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.
D1 · Cyclomatic Complexity · trail-yaml.normalizeScratchTrailYaml (cyclomatic 41) · ×1
  • trail-yaml.normalizeScratchTrailYaml (cyclomatic 41) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:210 — trail-yaml.normalizeScratchTrailYaml has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (trail-yaml.normalizeScratchTrailYaml::legacyTrailheadToUnified, trail-yaml.normalizeScratchTrailYaml::fragmentToStep) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · run-report-trail-replay.buildReplayMemorySeries (cyclomatic 41) · ×1
  • run-report-trail-replay.buildReplayMemorySeries (cyclomatic 41) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:878 — run-report-trail-replay.buildReplayMemorySeries has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElementRef.resolveInTree (cyclomatic 40) · ×1
  • ElementRef.resolveInTree (cyclomatic 40) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/ElementRefSlug.kt:52 — ElementRef.resolveInTree has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · blaze.BlazeScreen (cyclomatic 40) · ×1
  • blaze.BlazeScreen (cyclomatic 40) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:15 — blaze.BlazeScreen has cyclomatic complexity 40 (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. This shape REPEATS in the file: one other method here (blaze.BlazeScreen::blaze) 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.
D1 · Cyclomatic Complexity · trail-detail.UnifiedStepsBoard · ×1
  • trail-detail.UnifiedStepsBoard::renderRow (cyclomatic 40) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:400 — trail-detail.UnifiedStepsBoard::renderRow has cyclomatic complexity 40 (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. This shape REPEATS in the file: one other method here (trail-detail.UnifiedStepsBoard) 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.
D1 · Cyclomatic Complexity · perf-extract.buildRawSpans (cyclomatic 40) · ×1
  • perf-extract.buildRawSpans (cyclomatic 40) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:194 — perf-extract.buildRawSpans has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to one function literal inside it that branches (line 201). 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.
D1 · Cyclomatic Complexity · home.ReadinessPanel (cyclomatic 39) · ×1
  • home.ReadinessPanel (cyclomatic 39) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx:130 — home.ReadinessPanel has cyclomatic complexity 39 (threshold 15). Of this number, 33 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · trail-detail.StepsMode (cyclomatic 39) · ×1
  • trail-detail.StepsMode (cyclomatic 39) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:694 — trail-detail.StepsMode has cyclomatic complexity 39 (threshold 15). Of this number, 23 points are the body's own statements and 16 belong to 7 function literals 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.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorGeneratorHelpersKt.withTextOf (cyclomatic 38) · ×1
  • TrailblazeNodeSelectorGeneratorHelpersKt.withTextOf (cyclomatic 38) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:90 — TrailblazeNodeSelectorGeneratorHelpersKt.withTextOf has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-extract.toolChildren (cyclomatic 38) · ×1
  • run-report-extract.toolChildren (cyclomatic 38) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:990 — run-report-extract.toolChildren has cyclomatic complexity 38 (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. This shape REPEATS in the file: one other method here (run-report-extract.toolChildren::spanCapture) 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.
D1 · Cyclomatic Complexity · AxeDeviceManager.dispatch (cyclomatic 37) · ×1
  • AxeDeviceManager.dispatch (cyclomatic 37) trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:390 — AxeDeviceManager.dispatch has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · phase.findSplit (cyclomatic 37) · ×1
  • phase.findSplit (cyclomatic 37) sdks/typescript/src/surveys/phase.ts:143 — phase.findSplit has cyclomatic complexity 37 (threshold 15). Of this number, 29 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · editor.MonacoTrailEditor (cyclomatic 37) · ×1
  • editor.MonacoTrailEditor (cyclomatic 37) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:461 — editor.MonacoTrailEditor has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 526, 540, 507, …). 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.
D1 · Cyclomatic Complexity · run-payload.runMeta (cyclomatic 37) · ×1
  • run-payload.runMeta (cyclomatic 37) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:150 — run-payload.runMeta has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · trailmaps.ComponentRunTab (cyclomatic 37) · ×1
  • trailmaps.ComponentRunTab (cyclomatic 37) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:343 — trailmaps.ComponentRunTab has cyclomatic complexity 37 (threshold 15). 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, 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 · shell.TargetPicker (cyclomatic 37) · ×1
  • shell.TargetPicker (cyclomatic 37) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:76 — shell.TargetPicker has cyclomatic complexity 37 (threshold 15). Of this number, 29 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · run-report-extract.toSessionPayloads (cyclomatic 37) · ×1
  • run-report-extract.toSessionPayloads (cyclomatic 37) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1873 — run-report-extract.toSessionPayloads has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 2 of the 37 points are its own statements and the rest belongs to one function literal inside it that branches (line 1874). 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.
D1 · Cyclomatic Complexity · run-report-trace-model.buildReportTraceModel (cyclomatic 37) · ×1
  • run-report-trace-model.buildReportTraceModel (cyclomatic 37) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trace-model.ts:140 — run-report-trace-model.buildReportTraceModel has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 11 of the 37 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 150, 226). 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.
D1 · Cyclomatic Complexity · ReportCommandKt.generateSessionReport (cyclomatic 36) · ×1
  • ReportCommandKt.generateSessionReport (cyclomatic 36) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt:776 — ReportCommandKt.generateSessionReport has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeAccessibilityService.awaitTreeStable (cyclomatic 35) · ×1
  • TrailblazeAccessibilityService.awaitTreeStable (cyclomatic 35) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:936 — TrailblazeAccessibilityService.awaitTreeStable 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.
D1 · Cyclomatic Complexity · TrailblazeRecordingGeneratorKt.selectDirectToolLogs (cyclomatic 35) · ×1
  • TrailblazeRecordingGeneratorKt.selectDirectToolLogs (cyclomatic 35) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt:794 — TrailblazeRecordingGeneratorKt.selectDirectToolLogs has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · UnifiedTrailAdapter.mergeRecordedClassifier (cyclomatic 35) · ×1
  • UnifiedTrailAdapter.mergeRecordedClassifier (cyclomatic 35) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:978 — UnifiedTrailAdapter.mergeRecordedClassifier 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.
D1 · Cyclomatic Complexity · runner.runSurveys (cyclomatic 35) · ×1
  • runner.runSurveys (cyclomatic 35) sdks/typescript/src/surveys/runner.ts:131 — runner.runSurveys has cyclomatic complexity 35 (threshold 15). Of this number, 31 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.
D1 · Cyclomatic Complexity · devices.TargetCard (cyclomatic 35) · ×1
  • devices.TargetCard (cyclomatic 35) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:221 — devices.TargetCard has cyclomatic complexity 35 (threshold 15). Of this number, 33 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.
D1 · Cyclomatic Complexity · external-agents.ExternalAgentChat (cyclomatic 35) · ×1
  • external-agents.ExternalAgentChat (cyclomatic 35) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:257 — external-agents.ExternalAgentChat 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. This shape REPEATS in the file: one other method here (external-agents.ExternalAgentChat::proposeAtPoint) 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.
D1 · Cyclomatic Complexity · tools.ToolSourceEditor (cyclomatic 35) · ×1
  • tools.ToolSourceEditor (cyclomatic 35) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:171 — tools.ToolSourceEditor has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 14 of the 35 points are its own statements and the rest belongs to 3 function items inside it that branch (rebuildAndRestart, save, a function literal at line 240). 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.
D1 · Cyclomatic Complexity · zip-report-core.resolveRenderer (cyclomatic 35) · ×1
  • zip-report-core.resolveRenderer (cyclomatic 35) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:916 — zip-report-core.resolveRenderer has cyclomatic complexity 35 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BlazeRoutesKt.blazeRoutes (cyclomatic 34) · ×1
  • BlazeRoutesKt.blazeRoutes (cyclomatic 34) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/BlazeRoutes.kt:31 — BlazeRoutesKt.blazeRoutes has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RecordRoutesKt.recordRoutes (cyclomatic 34) · ×1
  • RecordRoutesKt.recordRoutes (cyclomatic 34) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:99 — RecordRoutesKt.recordRoutes has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.androidAccessibilityStrategies (cyclomatic 34) · ×1
  • TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.androidAccessibilityStrategies (cyclomatic 34) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:10 — TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.androidAccessibilityStrategies has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstCompose (cyclomatic 34) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstCompose (cyclomatic 34) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:524 — TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstCompose has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeMcpBridgeImpl.selectDevice (cyclomatic 33) · ×1
  • TrailblazeMcpBridgeImpl.selectDevice (cyclomatic 33) trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:372 — TrailblazeMcpBridgeImpl.selectDevice has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionRoutesKt.sessionRoutes (cyclomatic 33) · ×1
  • SessionRoutesKt.sessionRoutes (cyclomatic 33) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:291 — SessionRoutesKt.sessionRoutes has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · data-core.applyTrailRunnerUiCommand (cyclomatic 33) · ×1
  • data-core.applyTrailRunnerUiCommand (cyclomatic 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1285 — data-core.applyTrailRunnerUiCommand has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 belong to one function item 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.
D1 · Cyclomatic Complexity · run-payload.resolve (cyclomatic 33) · ×1
  • run-payload.resolve (cyclomatic 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:19 — run-payload.resolve has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · external-agents.ExternalAgentsScreen (cyclomatic 33) · ×1
  • external-agents.ExternalAgentsScreen (cyclomatic 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:163 — external-agents.ExternalAgentsScreen has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (stop, a function literal at line 177, a function literal at line 195, …). 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.
D1 · Cyclomatic Complexity · external-agents.buildAgentTranscript (cyclomatic 33) · ×1
  • external-agents.buildAgentTranscript (cyclomatic 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1784 — external-agents.buildAgentTranscript has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1787, 1852, 1851). 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.
D1 · Cyclomatic Complexity · tools.ToolUsedBy (cyclomatic 33) · ×1
  • tools.ToolUsedBy (cyclomatic 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:280 — tools.ToolUsedBy has cyclomatic complexity 33 (threshold 15). Of this number, 16 points are the body's own statements and 17 belong to 6 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.
D1 · Cyclomatic Complexity · run-report-extract.mergeWebHierarchyBounds (cyclomatic 33) · ×1
  • run-report-extract.mergeWebHierarchyBounds (cyclomatic 33) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:447 — run-report-extract.mergeWebHierarchyBounds has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 10 of the 33 points are its own statements and the rest belongs to 5 function items inside it that branch (compatible, legacyRect, graft, …). 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.
D1 · Cyclomatic Complexity · run-report-summary-model.buildDiagnosis (cyclomatic 33) · ×1
  • run-report-summary-model.buildDiagnosis (cyclomatic 33) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1575 — run-report-summary-model.buildDiagnosis has cyclomatic complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 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.
D1 · Cyclomatic Complexity · SessionEventsHostFunctions.query (cyclomatic 32) · ×1
  • SessionEventsHostFunctions.query (cyclomatic 32) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/SessionEventsHostFunctions.kt:102 — SessionEventsHostFunctions.query has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorGeneratorEnumerationKt.matchTier (cyclomatic 32) · ×1
  • TrailblazeNodeSelectorGeneratorEnumerationKt.matchTier (cyclomatic 32) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorEnumeration.kt:200 — TrailblazeNodeSelectorGeneratorEnumerationKt.matchTier has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorGeneratorHelpersKt.buildTargetMatch (cyclomatic 32) · ×1
  • TrailblazeNodeSelectorGeneratorHelpersKt.buildTargetMatch (cyclomatic 32) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:263 — TrailblazeNodeSelectorGeneratorHelpersKt.buildTargetMatch has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cyclomatic 32) · ×1
  • IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cyclomatic 32) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/IosViewHierarchyFilter.kt:42 — IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · demonstrate.useTrailheadPicker (cyclomatic 32) · ×1
  • demonstrate.useTrailheadPicker (cyclomatic 32) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:18 — demonstrate.useTrailheadPicker has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 53, 39, 58, …). 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.
D1 · Cyclomatic Complexity · external-agents.useAgentDeviceMirror (cyclomatic 32) · ×1
  • external-agents.useAgentDeviceMirror (cyclomatic 32) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2389 — external-agents.useAgentDeviceMirror 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 11 function literals inside it that branch (lines 2503, 2553, 2512, …). 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.
D1 · Cyclomatic Complexity · shell.CommandPalette (cyclomatic 32) · ×1
  • shell.CommandPalette (cyclomatic 32) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:511 — shell.CommandPalette has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (section, a function literal at line 566, onKeyDown, …). 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.
D1 · Cyclomatic Complexity · run-report-summary-model.screenTexts (cyclomatic 32) · ×1
  • run-report-summary-model.screenTexts (cyclomatic 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1318 — run-report-summary-model.screenTexts has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 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.
D1 · Cyclomatic Complexity · NextMoveDecisionLlmClient.treePath (cyclomatic 31) · ×1
  • NextMoveDecisionLlmClient.treePath (cyclomatic 31) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/decision/NextMoveDecisionLlmClient.kt:573 — NextMoveDecisionLlmClient.treePath has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · device-activity-model.fold (cyclomatic 31) · ×1
  • device-activity-model.fold (cyclomatic 31) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-activity-model.js:101 — device-activity-model.fold has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 107). 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.
D1 · Cyclomatic Complexity · perf-extract.extractPerfSession (cyclomatic 31) · ×1
  • perf-extract.extractPerfSession (cyclomatic 31) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:752 — perf-extract.extractPerfSession has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 belong to 3 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.
D1 · Cyclomatic Complexity · IosSetPermissionsTrailblazeTool.execute (cyclomatic 30) · ×1
  • IosSetPermissionsTrailblazeTool.execute (cyclomatic 30) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/ios/tools/IosSetPermissionsTrailblazeTool.kt:84 — IosSetPermissionsTrailblazeTool.execute has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionStartCommand.startSession (cyclomatic 30) · ×1
  • SessionStartCommand.startSession (cyclomatic 30) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:182 — SessionStartCommand.startSession has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool.registerPendingTools (cyclomatic 30) · ×1
  • tool.registerPendingTools (cyclomatic 30) sdks/typescript/src/tool.ts:465 — tool.registerPendingTools has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 525). 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.
D1 · Cyclomatic Complexity · phase.phaseOf (cyclomatic 30) · ×1
  • phase.phaseOf (cyclomatic 30) sdks/typescript/src/surveys/phase.ts:265 — phase.phaseOf has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data-extract.buildTrailTree (cyclomatic 30) · ×1
  • data-extract.buildTrailTree (cyclomatic 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-extract.tsx:172 — data-extract.buildTrailTree has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 8 function items inside it that branch (trailRow, ensureNode, renderEntry, …). 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.
D1 · Cyclomatic Complexity · companion.CompanionReplies (cyclomatic 30) · ×1
  • companion.CompanionReplies (cyclomatic 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:284 — companion.CompanionReplies has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (post, a function literal at line 328, flash, …). 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.
D1 · Cyclomatic Complexity · external-agents.AgentSkillsPanel (cyclomatic 30) · ×1
  • external-agents.AgentSkillsPanel (cyclomatic 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1466 — external-agents.AgentSkillsPanel has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 1473, 1484, 1532, …). 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.
D1 · Cyclomatic Complexity · external-agents.AgentEventLogRow (cyclomatic 30) · ×1
  • external-agents.AgentEventLogRow (cyclomatic 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2706 — external-agents.AgentEventLogRow has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · home.ExternalAgentPromptPanel (cyclomatic 30) · ×1
  • home.ExternalAgentPromptPanel (cyclomatic 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx:45 — home.ExternalAgentPromptPanel has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · record.ElementsPanel (cyclomatic 30) · ×1
  • record.ElementsPanel (cyclomatic 30) REDACTED:2474 — record.ElementsPanel has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2494, 2504, 2503). 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.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.place (cyclomatic 30) · ×1
  • run-report-theater.mountTheater.place (cyclomatic 30) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:610 — run-report-theater.mountTheater.place has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc (cyclomatic 29) · ×1
  • TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc (cyclomatic 29) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:458 — TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · data-extract.buildTrailBundleRows (cyclomatic 29) · ×1
  • data-extract.buildTrailBundleRows (cyclomatic 29) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-extract.tsx:249 — data-extract.buildTrailBundleRows has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 belong to 5 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.
D1 · Cyclomatic Complexity · trail-yaml.runnableSteps (cyclomatic 29) · ×1
  • trail-yaml.runnableSteps (cyclomatic 29) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:117 — trail-yaml.runnableSteps has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 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 · CrashEventArtifactWriter.detect (cyclomatic 28) · ×1
  • CrashEventArtifactWriter.detect (cyclomatic 28) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/logcat/CrashEventArtifactWriter.kt:95 — CrashEventArtifactWriter.detect 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.
D1 · Cyclomatic Complexity · resolver.matchesAndroidAccessibility (cyclomatic 28) · ×1
  • resolver.matchesAndroidAccessibility (cyclomatic 28) REDACTED:335 — resolver.matchesAndroidAccessibility 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.
D1 · Cyclomatic Complexity · waypoint-graph-template.html.MapView (cyclomatic 28) · ×1
  • waypoint-graph-template.html.MapView (cyclomatic 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1606 — waypoint-graph-template.html.MapView has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 1712, 1628, 1644, …). 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.
D1 · Cyclomatic Complexity · external-agents.AgentTrailRail (cyclomatic 28) · ×1
  • external-agents.AgentTrailRail (cyclomatic 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1391 — external-agents.AgentTrailRail has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · external-agents.groupPlumbingRuns (cyclomatic 28) · ×1
  • external-agents.groupPlumbingRuns (cyclomatic 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1907 — external-agents.groupPlumbingRuns has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 6 function items inside it that branch (failSig, a function literal at line 1932, pinned, …). 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.
D1 · Cyclomatic Complexity · trail-detail.parseTrailSteps (cyclomatic 28) · ×1
  • trail-detail.parseTrailSteps (cyclomatic 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:57 — trail-detail.parseTrailSteps has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 81, mapTools). 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.
D1 · Cyclomatic Complexity · trail-model.withSourceLabels (cyclomatic 28) · ×1
  • trail-model.withSourceLabels (cyclomatic 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:419 — trail-model.withSourceLabels has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 433, 424, 429). 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.
D1 · Cyclomatic Complexity · trail-yaml.applyRecordingEdit (cyclomatic 28) · ×1
  • trail-yaml.applyRecordingEdit (cyclomatic 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:561 — trail-yaml.applyRecordingEdit has cyclomatic complexity 28 (threshold 15). Of this number, 27 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.
D1 · Cyclomatic Complexity · run-report-payload.normalizeEventPayload (cyclomatic 28) · ×1
  • run-report-payload.normalizeEventPayload (cyclomatic 28) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:45 — run-report-payload.normalizeEventPayload has cyclomatic complexity 28 (threshold 15). Of this number, 20 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.
D1 · Cyclomatic Complexity · run-report-visible-strings.extractVisibleStrings (cyclomatic 28) · ×1
  • run-report-visible-strings.extractVisibleStrings (cyclomatic 28) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-visible-strings.ts:77 — run-report-visible-strings.extractVisibleStrings has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.updateRail (cyclomatic 28) · ×1
  • run-report-theater.mountTheater.updateRail (cyclomatic 28) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:728 — run-report-theater.mountTheater.updateRail has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 742, 763, 753, …). 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.
D1 · Cyclomatic Complexity · ReportCommand.call (cyclomatic 27) · ×1
  • ReportCommand.call (cyclomatic 27) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt:349 — ReportCommand.call has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · McpProgressNotifier.mapLogToNotification (cyclomatic 27) · ×1
  • McpProgressNotifier.mapLogToNotification (cyclomatic 27) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/utils/McpProgressNotifier.kt:101 — McpProgressNotifier.mapLogToNotification has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · editor.insertToolIntoTrailYaml (cyclomatic 27) · ×1
  • editor.insertToolIntoTrailYaml (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:260 — editor.insertToolIntoTrailYaml has cyclomatic complexity 27 (threshold 15). Of this number, 22 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.
D1 · Cyclomatic Complexity · runcommand.buildRunCommand (cyclomatic 27) · ×1
  • runcommand.buildRunCommand (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runcommand.tsx:24 — runcommand.buildRunCommand has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · demonstrate.DemoLiveTrailRail (cyclomatic 27) · ×1
  • demonstrate.DemoLiveTrailRail (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:684 — demonstrate.DemoLiveTrailRail has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 693, 717, 690, …). 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.
D1 · Cyclomatic Complexity · demonstrate.DemoVerifiedPanel (cyclomatic 27) · ×1
  • demonstrate.DemoVerifiedPanel (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:771 — demonstrate.DemoVerifiedPanel has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · external-agents.Collapsible (cyclomatic 27) · ×1
  • external-agents.Collapsible (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:77 — external-agents.Collapsible 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · external-agents.AgentConversationColumn (cyclomatic 27) · ×1
  • external-agents.AgentConversationColumn (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:623 — external-agents.AgentConversationColumn has cyclomatic complexity 27 (threshold 15). Of this number, 16 points are the body's own statements and 11 belong to 5 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.
D1 · Cyclomatic Complexity · external-agents.AgentYamlPanel (cyclomatic 27) · ×1
  • external-agents.AgentYamlPanel (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1641 — external-agents.AgentYamlPanel has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 belong to 4 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.
D1 · Cyclomatic Complexity · trail-detail.LegacyStepsRunList (cyclomatic 27) · ×1
  • trail-detail.LegacyStepsRunList (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:642 — trail-detail.LegacyStepsRunList has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 671, a function literal at line 645, run, …). 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.
D1 · Cyclomatic Complexity · zip-report.ZipReportScreen (cyclomatic 27) · ×1
  • zip-report.ZipReportScreen (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/zip-report.tsx:14 — zip-report.ZipReportScreen has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (load, revokeObjectUrls, a function literal at line 30, …). 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.
D1 · Cyclomatic Complexity · trail-yaml.mergeBlazeYaml (cyclomatic 27) · ×1
  • trail-yaml.mergeBlazeYaml (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:471 — trail-yaml.mergeBlazeYaml has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 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.
D1 · Cyclomatic Complexity · run-report-extract.assignTraceDevices (cyclomatic 27) · ×1
  • run-report-extract.assignTraceDevices (cyclomatic 27) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:892 — run-report-extract.assignTraceDevices has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · run-report-extract.toolChildren · ×1
  • run-report-extract.toolChildren::spanCapture (cyclomatic 27) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1004 — run-report-extract.toolChildren::spanCapture 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. This shape REPEATS in the file: one other method here (run-report-extract.toolChildren) 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.
D1 · Cyclomatic Complexity · perf-extract.buildTraceSpans (cyclomatic 27) · ×1
  • perf-extract.buildTraceSpans (cyclomatic 27) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:363 — perf-extract.buildTraceSpans has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 372, 388). 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.
D1 · Cyclomatic Complexity · unifiedDocToMatrix (cyclomatic 27) · ×1
  • unifiedDocToMatrix (cyclomatic 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:57 — unifiedDocToMatrix has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 belong to 6 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.
D1 · Cyclomatic Complexity · UnifiedRecordingWriter.mergeIntoUnified (cyclomatic 26) · ×1
  • UnifiedRecordingWriter.mergeIntoUnified (cyclomatic 26) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:473 — UnifiedRecordingWriter.mergeIntoUnified has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailCommand.delegateToDaemon (cyclomatic 26) · ×1
  • TrailCommand.delegateToDaemon (cyclomatic 26) REDACTED:1365 — TrailCommand.delegateToDaemon has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorResolver.matchesAndroidAccessibility (cyclomatic 26) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidAccessibility (cyclomatic 26) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:369 — TrailblazeNodeSelectorResolver.matchesAndroidAccessibility has cyclomatic complexity 26 (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. This shape REPEATS in the file: one other method here (TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView) 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.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView (cyclomatic 26) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView (cyclomatic 26) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:433 — TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView has cyclomatic complexity 26 (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. This shape REPEATS in the file: one other method here (TrailblazeNodeSelectorResolver.matchesAndroidAccessibility) 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.
D1 · Cyclomatic Complexity · driver-node-detail.isInteractive (cyclomatic 26) · ×1
  • driver-node-detail.isInteractive (cyclomatic 26) sdks/typescript/src/matcher/driver-node-detail.ts:439 — driver-node-detail.isInteractive has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: driver-node-detail.hasIdentifiableProperties (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · external-agents.ExternalAgentChat · ×1
  • external-agents.ExternalAgentChat::proposeAtPoint (cyclomatic 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:345 — external-agents.ExternalAgentChat::proposeAtPoint 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. This shape REPEATS in the file: one other method here (external-agents.ExternalAgentChat) 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.
D1 · Cyclomatic Complexity · external-agents.AgentTapeCard (cyclomatic 26) · ×1
  • external-agents.AgentTapeCard (cyclomatic 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2269 — external-agents.AgentTapeCard has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · share-export.ShareRunModal (cyclomatic 26) · ×1
  • share-export.ShareRunModal (cyclomatic 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/share-export.tsx:42 — share-export.ShareRunModal has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 53, fmtSize, a function literal at line 68, …). 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.
D1 · Cyclomatic Complexity · run-report-events.buildEventStream (cyclomatic 26) · ×1
  • run-report-events.buildEventStream (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:438 — run-report-events.buildEventStream has cyclomatic complexity 26 (threshold 15). Of this number, 25 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.
D1 · Cyclomatic Complexity · run-report-trace-spans.slimTracerSpans (cyclomatic 26) · ×1
  • run-report-trace-spans.slimTracerSpans (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-trace-spans.ts:20 — run-report-trace-spans.slimTracerSpans has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-extract.slimLlmForShare (cyclomatic 26) · ×1
  • run-report-extract.slimLlmForShare (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1761 — run-report-extract.slimLlmForShare has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1762, 1786). 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.
D1 · Cyclomatic Complexity · run-report-html.buildMultiReportHtml (cyclomatic 26) · ×1
  • run-report-html.buildMultiReportHtml (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-html.ts:42 — run-report-html.buildMultiReportHtml has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 5 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.
D1 · Cyclomatic Complexity · run-report-inspector.nodeBounds (cyclomatic 26) · ×1
  • run-report-inspector.nodeBounds (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:63 — run-report-inspector.nodeBounds has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary.cardHtml (cyclomatic 26) · ×1
  • run-report-summary.mountSummary.cardHtml (cyclomatic 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:931 — run-report-summary.mountSummary.cardHtml has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · DaemonClient.runAsync (cyclomatic 25) · ×1
  • DaemonClient.runAsync (cyclomatic 25) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DaemonClient.kt:291 — DaemonClient.runAsync has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WaypointMigrateTrailCommand.call (cyclomatic 25) · ×1
  • WaypointMigrateTrailCommand.call (cyclomatic 25) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointMigrateTrailCommand.kt:183 — WaypointMigrateTrailCommand.call has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeDesktopApp.handleCliRunRequest (cyclomatic 25) · ×1
  • TrailblazeDesktopApp.handleCliRunRequest (cyclomatic 25) trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDesktopApp.kt:203 — TrailblazeDesktopApp.handleCliRunRequest has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlaywrightTrailblazeAgent.executePlaywrightToolOnThread (cyclomatic 25) · ×1
  • PlaywrightTrailblazeAgent.executePlaywrightToolOnThread (cyclomatic 25) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:255 — PlaywrightTrailblazeAgent.executePlaywrightToolOnThread has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolver.matchesSelector (cyclomatic 25) · ×1
  • resolver.matchesSelector (cyclomatic 25) REDACTED:162 — resolver.matchesSelector has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · live.runLiveSurvey (cyclomatic 25) · ×1
  • live.runLiveSurvey (cyclomatic 25) sdks/typescript/src/surveys/live.ts:565 — live.runLiveSurvey has cyclomatic complexity 25 (threshold 15). Of this number, 24 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.
D1 · Cyclomatic Complexity · companion.deriveCompanionDirectives (cyclomatic 25) · ×1
  • companion.deriveCompanionDirectives (cyclomatic 25) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:27 — companion.deriveCompanionDirectives has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (entry, str, items, …). 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.
D1 · Cyclomatic Complexity · companion.CompanionReviewAsk (cyclomatic 25) · ×1
  • companion.CompanionReviewAsk (cyclomatic 25) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:167 — companion.CompanionReviewAsk has cyclomatic complexity 25 (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. This shape REPEATS in the file: one other method here (companion.CompanionReviewAsk::send) 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.
D1 · Cyclomatic Complexity · integrations.IntegrationCard (cyclomatic 25) · ×1
  • integrations.IntegrationCard (cyclomatic 25) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/integrations.tsx:11 — integrations.IntegrationCard has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · sessions.SessionRow (cyclomatic 25) · ×1
  • sessions.SessionRow (cyclomatic 25) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:716 — sessions.SessionRow has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · run-report-extract.estimateLlmComp (cyclomatic 25) · ×1
  • run-report-extract.estimateLlmComp (cyclomatic 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1201 — run-report-extract.estimateLlmComp has cyclomatic complexity 25 (threshold 15). Of this number, 21 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.
D1 · Cyclomatic Complexity · run-report-trail-model.cellFromGroups (cyclomatic 25) · ×1
  • run-report-trail-model.cellFromGroups (cyclomatic 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-model.ts:249 — run-report-trail-model.cellFromGroups has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · run-report-theater-model.buildTheaterStory.chapters (cyclomatic 25) · ×1
  • run-report-theater-model.buildTheaterStory.chapters (cyclomatic 25) REDACTED:627 — run-report-theater-model.buildTheaterStory.chapters has cyclomatic complexity 25 (threshold 15). Of this number, 22 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.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary.openMenu (cyclomatic 25) · ×1
  • run-report-summary.mountSummary.openMenu (cyclomatic 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1378 — run-report-summary.mountSummary.openMenu has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 1448, a function literal at line 1430, outside, …). 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.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary.onWindowKeyDown (cyclomatic 25) · ×1
  • run-report-summary.mountSummary.onWindowKeyDown (cyclomatic 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1723 — run-report-summary.mountSummary.onWindowKeyDown has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeProjectConfigLoader.resolveTrailmapArtifacts (cyclomatic 24) · ×1
  • TrailblazeProjectConfigLoader.resolveTrailmapArtifacts (cyclomatic 24) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeProjectConfigLoader.kt:377 — TrailblazeProjectConfigLoader.resolveTrailmapArtifacts has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SerialDescriptorTsCodegen.renderType (cyclomatic 24) · ×1
  • SerialDescriptorTsCodegen.renderType (cyclomatic 24) trailblaze-models/src/jvmMain/kotlin/xyz/block/trailblaze/codegen/SerialDescriptorTsCodegen.kt:304 — SerialDescriptorTsCodegen.renderType has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · runconfig-steps.TargetSection (cyclomatic 24) · ×1
  • runconfig-steps.TargetSection (cyclomatic 24) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:99 — runconfig-steps.TargetSection has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · external-agents.agentToolMeta (cyclomatic 24) · ×1
  • external-agents.agentToolMeta (cyclomatic 24) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2226 — external-agents.agentToolMeta has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · external-agents.AgentRecordStage (cyclomatic 24) · ×1
  • external-agents.AgentRecordStage (cyclomatic 24) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2770 — external-agents.AgentRecordStage 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. This shape REPEATS in the file: one other method here (external-agents.AgentRecordStage::onStagePointerUp) 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.
D1 · Cyclomatic Complexity · record.buildProposalToolYaml · ×1
  • record.buildProposalToolYaml::valueFor (cyclomatic 24) REDACTED:109 — record.buildProposalToolYaml::valueFor has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · trail-detail.StepRow (cyclomatic 24) · ×1
  • trail-detail.StepRow (cyclomatic 24) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:557 — trail-detail.StepRow has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 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.
D1 · Cyclomatic Complexity · trail-detail.TrailDetailView (cyclomatic 24) · ×1
  • trail-detail.TrailDetailView (cyclomatic 24) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:956 — trail-detail.TrailDetailView has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · run-report-events.clampRow (cyclomatic 24) · ×1
  • run-report-events.clampRow (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:332 — run-report-events.clampRow has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · perf-viewer.PERF_VIEWER (cyclomatic 24) · ×1
  • perf-viewer.PERF_VIEWER (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:126 — perf-viewer.PERF_VIEWER 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. This shape REPEATS in the file: 2 other methods here (perf-viewer.PERF_VIEWER::drawBlock, perf-viewer.PERF_VIEWER::renderInspector) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · run-report-summary-model.llmNote (cyclomatic 24) · ×1
  • run-report-summary-model.llmNote (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:431 — run-report-summary-model.llmNote has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.applySnapshot (cyclomatic 24) · ×1
  • run-report-theater.mountTheater.applySnapshot (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:949 — run-report-theater.mountTheater.applySnapshot has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · zip-report-core.videoArtifactsFrom (cyclomatic 24) · ×1
  • zip-report-core.videoArtifactsFrom (cyclomatic 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:206 — zip-report-core.videoArtifactsFrom has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive (cyclomatic 23) · ×1
  • HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive (cyclomatic 23) trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/HostAndroidDeviceConnectUtils.kt:433 — HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CompileCommand.call (cyclomatic 23) · ×1
  • CompileCommand.call (cyclomatic 23) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CompileCommand.kt:106 — CompileCommand.call has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PlaywrightScreenState.buildPageContextHeader (cyclomatic 23) · ×1
  • PlaywrightScreenState.buildPageContextHeader (cyclomatic 23) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:259 — PlaywrightScreenState.buildPageContextHeader has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeMcpServer.registerToolsLocked (cyclomatic 23) · ×1
  • TrailblazeMcpServer.registerToolsLocked (cyclomatic 23) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2587 — TrailblazeMcpServer.registerToolsLocked has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · context.fromMeta (cyclomatic 23) · ×1
  • context.fromMeta (cyclomatic 23) sdks/typescript/src/context.ts:333 — context.fromMeta has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · companion.CompanionDemoFiles (cyclomatic 23) · ×1
  • companion.CompanionDemoFiles (cyclomatic 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:389 — companion.CompanionDemoFiles has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 395, a function literal at line 413, openFile, …). 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.
D1 · Cyclomatic Complexity · device-activity-model.slimLog (cyclomatic 23) · ×1
  • device-activity-model.slimLog (cyclomatic 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-activity-model.js:55 — device-activity-model.slimLog has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · external-agents.AgentComposer · ×1
  • external-agents.AgentComposer::send (cyclomatic 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1154 — external-agents.AgentComposer::send 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. This shape REPEATS in the file: one other method here (external-agents.AgentComposer) 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.
D1 · Cyclomatic Complexity · steps-board.scaffoldArgs (cyclomatic 23) · ×1
  • steps-board.scaffoldArgs (cyclomatic 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:177 — steps-board.scaffoldArgs has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to one function item 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.
D1 · Cyclomatic Complexity · trail-yaml.normalizeTrailDoc (cyclomatic 23) · ×1
  • trail-yaml.normalizeTrailDoc (cyclomatic 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:525 — trail-yaml.normalizeTrailDoc has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · run-report-compare-model.contentDiffOf (cyclomatic 23) · ×1
  • run-report-compare-model.contentDiffOf (cyclomatic 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1159 — run-report-compare-model.contentDiffOf has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1225, flushEdits, a function literal at line 1191, …). 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.
D1 · Cyclomatic Complexity · run-report-inspector.inspectorModel (cyclomatic 23) · ×1
  • run-report-inspector.inspectorModel (cyclomatic 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:158 — run-report-inspector.inspectorModel has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.syncVideos (cyclomatic 23) · ×1
  • run-report-theater.mountTheater.syncVideos (cyclomatic 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:1022 — run-report-theater.mountTheater.syncVideos has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
D1 · Cyclomatic Complexity · RunYamlRequestHandler.handle (cyclomatic 22) · ×1
  • RunYamlRequestHandler.handle (cyclomatic 22) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/RunYamlRequestHandler.kt:192 — RunYamlRequestHandler.handle has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CliInfrastructureKt.cliTryStartDaemon (cyclomatic 22) · ×1
  • CliInfrastructureKt.cliTryStartDaemon (cyclomatic 22) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:2561 — CliInfrastructureKt.cliTryStartDaemon has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CliMcpClient.connectToDevice (cyclomatic 22) · ×1
  • CliMcpClient.connectToDevice (cyclomatic 22) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:769 — CliMcpClient.connectToDevice has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CliMcpClient.connectReusable (cyclomatic 22) · ×1
  • CliMcpClient.connectReusable (cyclomatic 22) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:1453 — CliMcpClient.connectReusable has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CliOutputFormattersKt.formatBlazeResultAgent (cyclomatic 22) · ×1
  • CliOutputFormattersKt.formatBlazeResultAgent (cyclomatic 22) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliOutputFormatters.kt:25 — CliOutputFormattersKt.formatBlazeResultAgent has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorGeneratorHelpersKt.buildStructuralMatch (cyclomatic 22) · ×1
  • TrailblazeNodeSelectorGeneratorHelpersKt.buildStructuralMatch (cyclomatic 22) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:384 — TrailblazeNodeSelectorGeneratorHelpersKt.buildStructuralMatch has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CaptureVideoFrames.fill (cyclomatic 22) · ×1
  • CaptureVideoFrames.fill (cyclomatic 22) trailblaze-report/src/main/java/xyz/block/trailblaze/report/strings/CaptureVideoFrames.kt:86 — CaptureVideoFrames.fill has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · context.parseTarget (cyclomatic 22) · ×1
  • context.parseTarget (cyclomatic 22) sdks/typescript/src/context.ts:443 — context.parseTarget has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 2 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.
D1 · Cyclomatic Complexity · discover.loadSurveyModules (cyclomatic 22) · ×1
  • discover.loadSurveyModules (cyclomatic 22) sdks/typescript/src/surveys/discover.ts:284 — discover.loadSurveyModules has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 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 · editor.TrailEditor (cyclomatic 22) · ×1
  • editor.TrailEditor (cyclomatic 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:189 — editor.TrailEditor has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · companion.CompanionFolderRail (cyclomatic 22) · ×1
  • companion.CompanionFolderRail (cyclomatic 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:470 — companion.CompanionFolderRail has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 3 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.
D1 · Cyclomatic Complexity · integrations.IntegrationsScreen (cyclomatic 22) · ×1
  • integrations.IntegrationsScreen (cyclomatic 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/integrations.tsx:76 — integrations.IntegrationsScreen has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ui.HoverTip (cyclomatic 22) · ×1
  • ui.HoverTip (cyclomatic 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:884 — ui.HoverTip has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 892, show). 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.
D1 · Cyclomatic Complexity · run-report-cli.main (cyclomatic 22) · ×1
  • run-report-cli.main (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:928 — run-report-cli.main has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 971, 961, 946, …). 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.
D1 · Cyclomatic Complexity · run-report-extract.yamlScalarAt (cyclomatic 22) · ×1
  • run-report-extract.yamlScalarAt (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:326 — run-report-extract.yamlScalarAt has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-extract.summarizeToolArgs (cyclomatic 22) · ×1
  • run-report-extract.summarizeToolArgs (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1541 — run-report-extract.summarizeToolArgs has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · run-report-compare-model.timedEventObjectsOf (cyclomatic 22) · ×1
  • run-report-compare-model.timedEventObjectsOf (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:694 — run-report-compare-model.timedEventObjectsOf has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 711, a function literal at line 698, a function literal at line 704, …). 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.
D1 · Cyclomatic Complexity · run-report-summary-model.toolReading (cyclomatic 22) · ×1
  • run-report-summary-model.toolReading (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1065 — run-report-summary-model.toolReading has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-summary-model.memoryLane (cyclomatic 22) · ×1
  • run-report-summary-model.memoryLane (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1120 — run-report-summary-model.memoryLane has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.tick (cyclomatic 22) · ×1
  • run-report-theater.mountTheater.tick (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:1257 — run-report-theater.mountTheater.tick has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · zip-report-core.sessionDisplayName (cyclomatic 22) · ×1
  • zip-report-core.sessionDisplayName (cyclomatic 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:435 — zip-report-core.sessionDisplayName has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KotlinSourceParser.findPrecedingKdoc (cyclomatic 21) · ×1
  • KotlinSourceParser.findPrecedingKdoc (cyclomatic 21) build-logic/src/main/kotlin/SelectorTsCodegen.kt:431 — KotlinSourceParser.findPrecedingKdoc has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · McpProxy.forwardRequest (cyclomatic 21) · ×1
  • McpProxy.forwardRequest (cyclomatic 21) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/McpProxy.kt:700 — McpProxy.forwardRequest has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionInfoCommand.call (cyclomatic 21) · ×1
  • SessionInfoCommand.call (cyclomatic 21) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1545 — SessionInfoCommand.call has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RevylHostDriverDescriptor.runRevylYaml (cyclomatic 21) · ×1
  • RevylHostDriverDescriptor.runRevylYaml (cyclomatic 21) trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:149 — RevylHostDriverDescriptor.runRevylYaml has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RunRoutesKt.maybeMergeIntoUnifiedTrail (cyclomatic 21) · ×1
  • RunRoutesKt.maybeMergeIntoUnifiedTrail (cyclomatic 21) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RunRoutes.kt:573 — RunRoutesKt.maybeMergeIntoUnifiedTrail has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionImporter.importSessionFromZip (cyclomatic 21) · ×1
  • SessionImporter.importSessionFromZip (cyclomatic 21) trailblaze-host/src/main/java/xyz/block/trailblaze/ui/tabs/sessions/SessionImporter.kt:43 — SessionImporter.importSessionFromZip has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorResolver.matchesCompose (cyclomatic 21) · ×1
  • TrailblazeNodeSelectorResolver.matchesCompose (cyclomatic 21) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:749 — TrailblazeNodeSelectorResolver.matchesCompose has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StoryboardHtmlBuilder.labelFor (cyclomatic 21) · ×1
  • StoryboardHtmlBuilder.labelFor (cyclomatic 21) trailblaze-report/src/main/java/xyz/block/trailblaze/report/StoryboardHtmlBuilder.kt:536 — StoryboardHtmlBuilder.labelFor has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · GenerateReportEndpoint.register (cyclomatic 21) · ×1
  • GenerateReportEndpoint.register (cyclomatic 21) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/endpoints/GenerateReportEndpoint.kt:117 — GenerateReportEndpoint.register has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BridgeUiActionExecutor.describeScreen (cyclomatic 21) · ×1
  • BridgeUiActionExecutor.describeScreen (cyclomatic 21) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:321 — BridgeUiActionExecutor.describeScreen has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · memory.createMemory (cyclomatic 21) · ×1
  • memory.createMemory (cyclomatic 21) sdks/typescript/src/memory.ts:171 — memory.createMemory has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 10 function items inside it that branch (lookupToken, a function literal at line 268, a function literal at line 314, …). 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.
D1 · Cyclomatic Complexity · resolver.matchesCompose (cyclomatic 21) · ×1
  • resolver.matchesCompose (cyclomatic 21) REDACTED:461 — resolver.matchesCompose has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · discover.discoverSessions · ×1
  • discover.discoverSessions::walk (cyclomatic 21) sdks/typescript/src/surveys/discover.ts:99 — discover.discoverSessions::walk has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data-core.switchWorkspace (cyclomatic 21) · ×1
  • data-core.switchWorkspace (cyclomatic 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:484 — data-core.switchWorkspace 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.
D1 · Cyclomatic Complexity · editor.ToolDocPopover (cyclomatic 21) · ×1
  • editor.ToolDocPopover (cyclomatic 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:350 — editor.ToolDocPopover has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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.
D1 · Cyclomatic Complexity · run-fanout.dispatchRuns (cyclomatic 21) · ×1
  • run-fanout.dispatchRuns (cyclomatic 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-fanout.js:237 — run-fanout.dispatchRuns has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 249, 245). 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.
D1 · Cyclomatic Complexity · run-payload.fetchReportEvents (cyclomatic 21) · ×1
  • run-payload.fetchReportEvents (cyclomatic 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:465 — run-payload.fetchReportEvents has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 3 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.
D1 · Cyclomatic Complexity · trail-detail.UnifiedStepsBoard (cyclomatic 21) · ×1
  • trail-detail.UnifiedStepsBoard (cyclomatic 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:262 — trail-detail.UnifiedStepsBoard has cyclomatic complexity 21 (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. This shape REPEATS in the file: one other method here (trail-detail.UnifiedStepsBoard::renderRow) 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.
D1 · Cyclomatic Complexity · run-report-events.derivedStreamStatus (cyclomatic 21) · ×1
  • run-report-events.derivedStreamStatus (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:564 — run-report-events.derivedStreamStatus has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-compare-model.highlightSpans (cyclomatic 21) · ×1
  • run-report-compare-model.highlightSpans (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:178 — run-report-compare-model.highlightSpans has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 3 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.
D1 · Cyclomatic Complexity · run-report-compare-model.pickGroupPath (cyclomatic 21) · ×1
  • run-report-compare-model.pickGroupPath (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:565 — run-report-compare-model.pickGroupPath has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 589, 575). 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.
D1 · Cyclomatic Complexity · run-report-compare-model.eventSummary (cyclomatic 21) · ×1
  • run-report-compare-model.eventSummary (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:974 — run-report-compare-model.eventSummary has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (walk, a function literal at line 1001, crop, …). 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.
D1 · Cyclomatic Complexity · run-report-compare-model.compareEventStreamsByStep (cyclomatic 21) · ×1
  • run-report-compare-model.compareEventStreamsByStep (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1366 — run-report-compare-model.compareEventStreamsByStep has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 1392, a function literal at line 1423, a function literal at line 1378, …). 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.
D1 · Cyclomatic Complexity · run-report-device-frames.frameKindFor (cyclomatic 21) · ×1
  • run-report-device-frames.frameKindFor (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-device-frames.ts:21 — run-report-device-frames.frameKindFor 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.
D1 · Cyclomatic Complexity · run-report-selectors.selectorSuggestionsHtml · ×1
  • run-report-selectors.selectorSuggestionsHtml::card (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-selectors.ts:130 — run-report-selectors.selectorSuggestionsHtml::card has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-playback.buildPlaybackSchedule (cyclomatic 21) · ×1
  • run-report-playback.buildPlaybackSchedule (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-playback.ts:79 — run-report-playback.buildPlaybackSchedule has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · run-report-theater-model.buildTheaterStory.addAction (cyclomatic 21) · ×1
  • run-report-theater-model.buildTheaterStory.addAction (cyclomatic 21) REDACTED:476 — run-report-theater-model.buildTheaterStory.addAction 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary.paintPreview (cyclomatic 21) · ×1
  • run-report-summary.mountSummary.paintPreview (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:758 — run-report-summary.mountSummary.paintPreview has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary.onClick (cyclomatic 21) · ×1
  • run-report-summary.mountSummary.onClick (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1534 — run-report-summary.mountSummary.onClick has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionEventStreams (cyclomatic 21) · ×1
  • sessionEventStreams (cyclomatic 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:685 — sessionEventStreams has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 17 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.
D1 · Cyclomatic Complexity · buildTargetGroups (cyclomatic 21) · ×1
  • buildTargetGroups (cyclomatic 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/target-picker-model.js:12 — buildTargetGroups has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 36, 58, 22, …). 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.
D1 · Cyclomatic Complexity · CaptureSession.fromOptions (cyclomatic 20) · ×1
  • CaptureSession.fromOptions (cyclomatic 20) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/CaptureSession.kt:266 — CaptureSession.fromOptions has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeviceTimedFlvMuxer.write (cyclomatic 20) · ×1
  • DeviceTimedFlvMuxer.write (cyclomatic 20) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/DeviceTimedFlvMuxer.kt:126 — DeviceTimedFlvMuxer.write has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph (cyclomatic 20) · ×1
  • KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph (cyclomatic 20) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mcp/agent/KoogStrategyGraphHostRunner.kt:70 — KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SurveySourceText.callArgumentsAt (cyclomatic 20) · ×1
  • SurveySourceText.callArgumentsAt (cyclomatic 20) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/surveys/SurveySourceText.kt:26 — SurveySourceText.callArgumentsAt has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · TapTrailblazeTool.toExecutableTrailblazeTools (cyclomatic 20) · ×1
  • TapTrailblazeTool.toExecutableTrailblazeTools (cyclomatic 20) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/TapTrailblazeTool.kt:44 — TapTrailblazeTool.toExecutableTrailblazeTools has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ToolboxCommand.formatIndexResult (cyclomatic 20) · ×1
  • ToolboxCommand.formatIndexResult (cyclomatic 20) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxCommand.kt:333 — ToolboxCommand.formatIndexResult has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailCommand.executeTrailAndCollectResults (cyclomatic 20) · ×1
  • TrailCommand.executeTrailAndCollectResults (cyclomatic 20) REDACTED:2117 — TrailCommand.executeTrailAndCollectResults has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailTscValidator.attributeRecordedCalls (cyclomatic 20) · ×1
  • TrailTscValidator.attributeRecordedCalls (cyclomatic 20) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailTscValidator.kt:779 — TrailTscValidator.attributeRecordedCalls has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorResolver.matchesDriverDetail (cyclomatic 20) · ×1
  • TrailblazeNodeSelectorResolver.matchesDriverDetail (cyclomatic 20) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:327 — TrailblazeNodeSelectorResolver.matchesDriverDetail has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · resolver.matchesIosMaestroAgainstAxe (cyclomatic 20) · ×1
  • resolver.matchesIosMaestroAgainstAxe (cyclomatic 20) REDACTED:653 — resolver.matchesIosMaestroAgainstAxe has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.main (cyclomatic 20) · ×1
  • cli.main (cyclomatic 20) sdks/typescript/src/surveys/snapshot/cli.ts:48 — cli.main has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item 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.
D1 · Cyclomatic Complexity · extract-tool-defs.literalValueOf (cyclomatic 20) · ×1
  • extract-tool-defs.literalValueOf (cyclomatic 20) sdks/typescript/tools/extract-tool-defs.mjs:1006 — extract-tool-defs.literalValueOf has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data-hooks.useSessions (cyclomatic 20) · ×1
  • data-hooks.useSessions (cyclomatic 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-hooks.tsx:191 — data-hooks.useSessions has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 204, 192). 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.
D1 · Cyclomatic Complexity · device-console.useDeviceActivity (cyclomatic 20) · ×1
  • device-console.useDeviceActivity (cyclomatic 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:632 — device-console.useDeviceActivity has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 700, 654, 670, …). 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.
D1 · Cyclomatic Complexity · external-agents.AgentNewConversationBody (cyclomatic 20) · ×1
  • external-agents.AgentNewConversationBody (cyclomatic 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:812 — external-agents.AgentNewConversationBody has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 821, 828, 835, …). 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.
D1 · Cyclomatic Complexity · external-agents.AgentPermissionBar (cyclomatic 20) · ×1
  • external-agents.AgentPermissionBar (cyclomatic 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:959 — external-agents.AgentPermissionBar has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · record.selectorRegexInfo (cyclomatic 20) · ×1
  • record.selectorRegexInfo (cyclomatic 20) REDACTED:2058 — record.selectorRegexInfo has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 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.
D1 · Cyclomatic Complexity · trailmaps.ComponentDetail (cyclomatic 20) · ×1
  • trailmaps.ComponentDetail (cyclomatic 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:269 — trailmaps.ComponentDetail has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 4 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.
D1 · Cyclomatic Complexity · run-report-payload.jsonToYaml (cyclomatic 20) · ×1
  • run-report-payload.jsonToYaml (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:275 — run-report-payload.jsonToYaml has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 299, append, scalar, …). 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.
D1 · Cyclomatic Complexity · run-report-payload.transcriptToolCallYaml (cyclomatic 20) · ×1
  • run-report-payload.transcriptToolCallYaml (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:323 — run-report-payload.transcriptToolCallYaml has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · run-report-extract.actionMark (cyclomatic 20) · ×1
  • run-report-extract.actionMark (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1112 — run-report-extract.actionMark has cyclomatic complexity 20 (threshold 15). Of this number, 18 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.
D1 · Cyclomatic Complexity · perf-extract.buildSteps (cyclomatic 20) · ×1
  • perf-extract.buildSteps (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:630 — perf-extract.buildSteps has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-compare-model.pickGroupPathMany (cyclomatic 20) · ×1
  • run-report-compare-model.pickGroupPathMany (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:612 — run-report-compare-model.pickGroupPathMany has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 631, 619). 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.
D1 · Cyclomatic Complexity · run-report-trail-replay.buildReplayTimeline (cyclomatic 20) · ×1
  • run-report-trail-replay.buildReplayTimeline (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:104 — run-report-trail-replay.buildReplayTimeline has cyclomatic complexity 20 (threshold 15). Of this number, 18 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.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.paintMirror (cyclomatic 20) · ×1
  • run-report-theater.mountTheater.paintMirror (cyclomatic 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:398 — run-report-theater.mountTheater.paintMirror has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · extractToolSpec (cyclomatic 20) · ×1
  • extractToolSpec (cyclomatic 20) sdks/typescript/tools/extract-tool-defs.mjs:782 — extractToolSpec has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventStreamScanner.forward (cyclomatic 19) · ×1
  • EventStreamScanner.forward (cyclomatic 19) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:56 — EventStreamScanner.forward has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SurveySourceText.scan (cyclomatic 19) · ×1
  • SurveySourceText.scan (cyclomatic 19) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/surveys/SurveySourceText.kt:109 — SurveySourceText.scan has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckCommand.runTrailLintPhase (cyclomatic 19) · ×1
  • CheckCommand.runTrailLintPhase (cyclomatic 19) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:1009 — CheckCommand.runTrailLintPhase has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScriptedToolSourceSnapshotScanner.snapshot (cyclomatic 19) · ×1
  • ScriptedToolSourceSnapshotScanner.snapshot (cyclomatic 19) trailblaze-host/src/main/java/xyz/block/trailblaze/usages/ScriptedToolSourceSnapshotScanner.kt:55 — ScriptedToolSourceSnapshotScanner.snapshot has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IosCompactElementList.isSystemUi (cyclomatic 19) · ×1
  • IosCompactElementList.isSystemUi (cyclomatic 19) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:391 — IosCompactElementList.isSystemUi has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GenerateTestResultsCliCommand.generateToolUsageReport (cyclomatic 19) · ×1
  • GenerateTestResultsCliCommand.generateToolUsageReport (cyclomatic 19) trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:838 — GenerateTestResultsCliCommand.generateToolUsageReport has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · memory.attachMemoryDeltaToResult (cyclomatic 19) · ×1
  • memory.attachMemoryDeltaToResult (cyclomatic 19) sdks/typescript/src/memory.ts:393 — memory.attachMemoryDeltaToResult has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data-core.resolveRunDevice (cyclomatic 19) · ×1
  • data-core.resolveRunDevice (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:209 — data-core.resolveRunDevice has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 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.
D1 · Cyclomatic Complexity · run-payload.normalizeSummary (cyclomatic 19) · ×1
  • run-payload.normalizeSummary (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:124 — run-payload.normalizeSummary 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.
D1 · Cyclomatic Complexity · run-payload.collectAttachments (cyclomatic 19) · ×1
  • run-payload.collectAttachments (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:320 — run-payload.collectAttachments has cyclomatic complexity 19 (threshold 15). Of this number, 17 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.
D1 · Cyclomatic Complexity · external-agents.tapSelectorMeta (cyclomatic 19) · ×1
  • external-agents.tapSelectorMeta (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2358 — external-agents.tapSelectorMeta 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.
D1 · Cyclomatic Complexity · external-agents.AgentDeviceEventLog (cyclomatic 19) · ×1
  • external-agents.AgentDeviceEventLog (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2636 — external-agents.AgentDeviceEventLog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 2645, 2637, 2643, …). 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.
D1 · Cyclomatic Complexity · follow-run-model.decide (cyclomatic 19) · ×1
  • follow-run-model.decide (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/follow-run-model.js:24 — follow-run-model.decide 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.
D1 · Cyclomatic Complexity · record.SelectorRegexEditor (cyclomatic 19) · ×1
  • record.SelectorRegexEditor (cyclomatic 19) REDACTED:2082 — record.SelectorRegexEditor has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 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.
D1 · Cyclomatic Complexity · trace-viewer.SaveAsTrailModal (cyclomatic 19) · ×1
  • trace-viewer.SaveAsTrailModal (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:369 — trace-viewer.SaveAsTrailModal has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 2 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.
D1 · Cyclomatic Complexity · ui.HelpButton (cyclomatic 19) · ×1
  • ui.HelpButton (cyclomatic 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:728 — ui.HelpButton has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 7 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.
D1 · Cyclomatic Complexity · run-report-compare-model.diffStream (cyclomatic 19) · ×1
  • run-report-compare-model.diffStream (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1270 — run-report-compare-model.diffStream has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · run-report-playback.buildExportSchedule (cyclomatic 19) · ×1
  • run-report-playback.buildExportSchedule (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-playback.ts:119 — run-report-playback.buildExportSchedule has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · run-report-strings-frames.grabClipFrames (cyclomatic 19) · ×1
  • run-report-strings-frames.grabClipFrames (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings-frames.ts:44 — run-report-strings-frames.grabClipFrames has cyclomatic complexity 19 (threshold 15). Of this number, 18 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.
D1 · Cyclomatic Complexity · run-report-summary-model.networkCallNote (cyclomatic 19) · ×1
  • run-report-summary-model.networkCallNote (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:959 — run-report-summary-model.networkCallNote has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-summary.mountSummary.entryRows (cyclomatic 19) · ×1
  • run-report-summary.mountSummary.entryRows (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:891 — run-report-summary.mountSummary.entryRows has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · sessionAttachments (cyclomatic 19) · ×1
  • sessionAttachments (cyclomatic 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:812 — sessionAttachments has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 6 function literals 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.
D1 · Cyclomatic Complexity · GenerateAndroidTrailJUnitShellsTask.generate (cyclomatic 18) · ×1
  • GenerateAndroidTrailJUnitShellsTask.generate (cyclomatic 18) trailblaze-android-gradle/src/main/kotlin/TrailblazeAndroidGradlePlugin.kt:825 — GenerateAndroidTrailJUnitShellsTask.generate has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeAccessibilityService.waitForSettled (cyclomatic 18) · ×1
  • TrailblazeAccessibilityService.waitForSettled (cyclomatic 18) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:324 — TrailblazeAccessibilityService.waitForSettled has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · H264Tee.runReaderLoop (cyclomatic 18) · ×1
  • H264Tee.runReaderLoop (cyclomatic 18) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/H264Tee.kt:257 — H264Tee.runReaderLoop has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseTrailblazeAgent.dispatchTools (cyclomatic 18) · ×1
  • BaseTrailblazeAgent.dispatchTools (cyclomatic 18) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/BaseTrailblazeAgent.kt:230 — BaseTrailblazeAgent.dispatchTools has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComposeSemanticTreeMapper.appendCompactNode (cyclomatic 18) · ×1
  • ComposeSemanticTreeMapper.appendCompactNode (cyclomatic 18) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeSemanticTreeMapper.kt:291 — ComposeSemanticTreeMapper.appendCompactNode has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfigCommand.showAllConfig (cyclomatic 18) · ×1
  • ConfigCommand.showAllConfig (cyclomatic 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ConfigCommand.kt:103 — ConfigCommand.showAllConfig has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionSaveCommand.call (cyclomatic 18) · ×1
  • SessionSaveCommand.call (cyclomatic 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1295 — SessionSaveCommand.call has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HostOnDeviceRpcTrailblazeAgent.executeToolViaRpcUntraced (cyclomatic 18) · ×1
  • HostOnDeviceRpcTrailblazeAgent.executeToolViaRpcUntraced (cyclomatic 18) trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:869 — HostOnDeviceRpcTrailblazeAgent.executeToolViaRpcUntraced has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeviceManagerToolSet.bindNamedDevice (cyclomatic 18) · ×1
  • DeviceManagerToolSet.bindNamedDevice (cyclomatic 18) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:468 — DeviceManagerToolSet.bindNamedDevice has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · trailblaze-node.hitTest (cyclomatic 18) · ×1
  • trailblaze-node.hitTest (cyclomatic 18) sdks/typescript/src/matcher/trailblaze-node.ts:218 — trailblaze-node.hitTest has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (visit). 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.
D1 · Cyclomatic Complexity · survey.survey (cyclomatic 18) · ×1
  • survey.survey (cyclomatic 18) sdks/typescript/src/surveys/survey.ts:342 — survey.survey has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · stream.eventStream (cyclomatic 18) · ×1
  • stream.eventStream (cyclomatic 18) sdks/typescript/src/surveys/stream.ts:351 — stream.eventStream has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · android_ensureAppCompiled.android_ensureAppCompiled (cyclomatic 18) · ×1
  • android_ensureAppCompiled.android_ensureAppCompiled (cyclomatic 18) trailblaze-common/src/commonMain/resources/trails/config/trailmaps/android/tools/android_ensureAppCompiled.ts:215 — android_ensureAppCompiled.android_ensureAppCompiled has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · record.seedPrompt (cyclomatic 18) · ×1
  • record.seedPrompt (cyclomatic 18) REDACTED:148 — record.seedPrompt 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.
D1 · Cyclomatic Complexity · trail-model.logicalLegs (cyclomatic 18) · ×1
  • trail-model.logicalLegs (cyclomatic 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:243 — trail-model.logicalLegs has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 3 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.
D1 · Cyclomatic Complexity · trailmaps.ComponentOverview (cyclomatic 18) · ×1
  • trailmaps.ComponentOverview (cyclomatic 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:409 — trailmaps.ComponentOverview has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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 · shell.ExtensionWorkspaceScreen (cyclomatic 18) · ×1
  • shell.ExtensionWorkspaceScreen (cyclomatic 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:668 — shell.ExtensionWorkspaceScreen has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 683, 670, 678, …). 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.
D1 · Cyclomatic Complexity · run-report-events.derivedLanes (cyclomatic 18) · ×1
  • run-report-events.derivedLanes (cyclomatic 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:532 — run-report-events.derivedLanes has cyclomatic complexity 18 (threshold 15). 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, 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 · run-report-extract.driverActionsAfterTheirTool (cyclomatic 18) · ×1
  • run-report-extract.driverActionsAfterTheirTool (cyclomatic 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:261 — run-report-extract.driverActionsAfterTheirTool has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item 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.
D1 · Cyclomatic Complexity · run-report-compare-model.toDisplayPair (cyclomatic 18) · ×1
  • run-report-compare-model.toDisplayPair (cyclomatic 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1012 — run-report-compare-model.toDisplayPair has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · run-report-summary-model.visibleStringsLane.notes (cyclomatic 18) · ×1
  • run-report-summary-model.visibleStringsLane.notes (cyclomatic 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1417 — run-report-summary-model.visibleStringsLane.notes has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · run-report-theater-model.yamlSegments (cyclomatic 18) · ×1
  • run-report-theater-model.yamlSegments (cyclomatic 18) REDACTED:1019 — run-report-theater-model.yamlSegments has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (scalar, push). 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.
D1 · Cyclomatic Complexity · run-report-theater.cleanMark (cyclomatic 18) · ×1
  • run-report-theater.cleanMark (cyclomatic 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:143 — run-report-theater.cleanMark 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.
D1 · Cyclomatic Complexity · buildSessionInputsFromZipBytes (cyclomatic 18) · ×1
  • buildSessionInputsFromZipBytes (cyclomatic 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:967 — buildSessionInputsFromZipBytes has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 999, 1027, 996, …). 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.
D1 · Cyclomatic Complexity · TrailDiscovery.runDiscoveryWalk (cyclomatic 17) · ×1
  • TrailDiscovery.runDiscoveryWalk (cyclomatic 17) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailDiscovery.kt:221 — TrailDiscovery.runDiscoveryWalk has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeLogger.extractProgressEventData (cyclomatic 17) · ×1
  • TrailblazeLogger.extractProgressEventData (cyclomatic 17) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/logs/client/TrailblazeLogger.kt:562 — TrailblazeLogger.extractProgressEventData has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LoopCommand.call (cyclomatic 17) · ×1
  • LoopCommand.call (cyclomatic 17) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:607 — LoopCommand.call has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ResolvedTargetReportEmitter.renderAvailabilityMatrix (cyclomatic 17) · ×1
  • ResolvedTargetReportEmitter.renderAvailabilityMatrix (cyclomatic 17) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:537 — ResolvedTargetReportEmitter.renderAvailabilityMatrix has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeviceApiEndpointKt.launchLegacyPollingSubscription (cyclomatic 17) · ×1
  • DeviceApiEndpointKt.launchLegacyPollingSubscription (cyclomatic 17) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:441 — DeviceApiEndpointKt.launchLegacyPollingSubscription has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompanionRoutesKt.companionRoutes (cyclomatic 17) · ×1
  • CompanionRoutesKt.companionRoutes (cyclomatic 17) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/CompanionRoutes.kt:31 — CompanionRoutesKt.companionRoutes has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailRunnerRecordingService.gesture (cyclomatic 17) · ×1
  • TrailRunnerRecordingService.gesture (cyclomatic 17) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:890 — TrailRunnerRecordingService.gesture has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorResolver.matchesAndroidView (cyclomatic 17) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidView (cyclomatic 17) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:595 — TrailblazeNodeSelectorResolver.matchesAndroidView has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LlmTokenBreakdownEstimator.estimateBreakdown (cyclomatic 17) · ×1
  • LlmTokenBreakdownEstimator.estimateBreakdown (cyclomatic 17) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/LlmTokenBreakdownEstimator.kt:32 — LlmTokenBreakdownEstimator.estimateBreakdown has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Walk.collect (cyclomatic 17) · ×1
  • Walk.collect (cyclomatic 17) trailblaze-models/src/jvmMain/kotlin/xyz/block/trailblaze/codegen/SerialDescriptorTsCodegen.kt:123 — Walk.collect has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlaywrightScreenState.handleHiddenElements (cyclomatic 17) · ×1
  • PlaywrightScreenState.handleHiddenElements (cyclomatic 17) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:471 — PlaywrightScreenState.handleHiddenElements has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlaywrightTrailblazeAgent.mapToolToAgentDriverAction (cyclomatic 17) · ×1
  • PlaywrightTrailblazeAgent.mapToolToAgentDriverAction (cyclomatic 17) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:551 — PlaywrightTrailblazeAgent.mapToolToAgentDriverAction has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry (cyclomatic 17) · ×1
  • TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry (cyclomatic 17) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:1776 — TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeviceManagerToolSet.connectAndReplaceSessionDevice (cyclomatic 17) · ×1
  • DeviceManagerToolSet.connectAndReplaceSessionDevice (cyclomatic 17) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:897 — DeviceManagerToolSet.connectAndReplaceSessionDevice has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · resolver.matchesAndroidView (cyclomatic 17) · ×1
  • resolver.matchesAndroidView (cyclomatic 17) REDACTED:397 — resolver.matchesAndroidView has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · stream.deriveRows (cyclomatic 17) · ×1
  • stream.deriveRows (cyclomatic 17) sdks/typescript/src/surveys/stream.ts:183 — stream.deriveRows 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 literals inside it that branch (lines 198, 188, 197). 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.
D1 · Cyclomatic Complexity · stored.sessionInputs (cyclomatic 17) · ×1
  • stored.sessionInputs (cyclomatic 17) sdks/typescript/src/surveys/stored.ts:165 — stored.sessionInputs has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (walk). 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.
D1 · Cyclomatic Complexity · data-hooks.useExternalAgentEvents (cyclomatic 17) · ×1
  • data-hooks.useExternalAgentEvents (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-hooks.tsx:513 — data-hooks.useExternalAgentEvents has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 531, 556, 540, …). 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.
D1 · Cyclomatic Complexity · live-device-stream.openLiveDeviceStream.startFallback (cyclomatic 17) · ×1
  • live-device-stream.openLiveDeviceStream.startFallback (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:372 — live-device-stream.openLiveDeviceStream.startFallback has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-payload.fetchDerivedStreams (cyclomatic 17) · ×1
  • run-payload.fetchDerivedStreams (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:427 — run-payload.fetchDerivedStreams 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.
D1 · Cyclomatic Complexity · blaze.BlazeScreen · ×1
  • blaze.BlazeScreen::blaze (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:89 — blaze.BlazeScreen::blaze has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (blaze.BlazeScreen) 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.
D1 · Cyclomatic Complexity · record.relevantTools (cyclomatic 17) · ×1
  • record.relevantTools (cyclomatic 17) REDACTED:86 — record.relevantTools has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 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.
D1 · Cyclomatic Complexity · trail-detail.UnifiedStepsTable (cyclomatic 17) · ×1
  • trail-detail.UnifiedStepsTable (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:180 — trail-detail.UnifiedStepsTable has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 206, 220, 196). 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.
D1 · Cyclomatic Complexity · trail-detail.TrailImplementationsBoard · ×1
  • trail-detail.TrailImplementationsBoard::saveSteps (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:861 — trail-detail.TrailImplementationsBoard::saveSteps 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. This shape REPEATS in the file: one other method here (trail-detail.TrailImplementationsBoard) 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.
D1 · Cyclomatic Complexity · run-report-events.resolveFormatterModule (cyclomatic 17) · ×1
  • run-report-events.resolveFormatterModule (cyclomatic 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:112 — run-report-events.resolveFormatterModule has cyclomatic complexity 17 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · run-report-summary-model.eventDetail (cyclomatic 17) · ×1
  • run-report-summary-model.eventDetail (cyclomatic 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:853 — run-report-summary-model.eventDetail has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-summary-model.rowNote (cyclomatic 17) · ×1
  • run-report-summary-model.rowNote (cyclomatic 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:882 — run-report-summary-model.rowNote has cyclomatic complexity 17 (threshold 15). Of this number, 9 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.
D1 · Cyclomatic Complexity · run-report-theater-model.actionLabel (cyclomatic 17) · ×1
  • run-report-theater-model.actionLabel (cyclomatic 17) REDACTED:280 — run-report-theater-model.actionLabel has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-theater.mountTheater.paintScreens (cyclomatic 17) · ×1
  • run-report-theater.mountTheater.paintScreens (cyclomatic 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:997 — run-report-theater.mountTheater.paintScreens has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openLiveDeviceStream.startFallback (cyclomatic 17) · ×1
  • openLiveDeviceStream.startFallback (cyclomatic 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:372 — openLiveDeviceStream.startFallback has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · get (cyclomatic 17) · ×1
  • get (cyclomatic 17) sdks/typescript/tools/in-process-wrapper-template.mjs:51 — get has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KotlinSourceParser.stripAnnotationsAndWhitespace (cyclomatic 16) · ×1
  • KotlinSourceParser.stripAnnotationsAndWhitespace (cyclomatic 16) build-logic/src/main/kotlin/SelectorTsCodegen.kt:626 — KotlinSourceParser.stripAnnotationsAndWhitespace has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: SelectorTsCodegen.mapKotlinTypeToTs (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AndroidTrailblazeRule.runSuspend (cyclomatic 16) · ×1
  • AndroidTrailblazeRule.runSuspend (cyclomatic 16) trailblaze-android/src/main/java/xyz/block/trailblaze/android/AndroidTrailblazeRule.kt:778 — AndroidTrailblazeRule.runSuspend has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MaestroUiAutomatorXmlParser.mapXmlHierarchyToMaestroTreeNode (cyclomatic 16) · ×1
  • MaestroUiAutomatorXmlParser.mapXmlHierarchyToMaestroTreeNode (cyclomatic 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/MaestroUiAutomatorXmlParser.kt:44 — MaestroUiAutomatorXmlParser.mapXmlHierarchyToMaestroTreeNode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventStreamScanner.backward (cyclomatic 16) · ×1
  • EventStreamScanner.backward (cyclomatic 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:130 — EventStreamScanner.backward has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SurveyBundles.exportsPlainValue (cyclomatic 16) · ×1
  • SurveyBundles.exportsPlainValue (cyclomatic 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/surveys/SurveyBundles.kt:153 — SurveyBundles.exportsPlainValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScrollUntilTextIsVisibleTrailblazeTool.scrollUntilVisibleWithStartPosition (cyclomatic 16) · ×1
  • ScrollUntilTextIsVisibleTrailblazeTool.scrollUntilVisibleWithStartPosition (cyclomatic 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/ScrollUntilTextIsVisibleTrailblazeTool.kt:151 — ScrollUntilTextIsVisibleTrailblazeTool.scrollUntilVisibleWithStartPosition 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. This is NOT this file's highest cyclomatic complexity: ScrollUntilTextIsVisibleTrailblazeTool.relativeScrollStartPoints (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · CheckCommand.runTypecheckPhase (cyclomatic 16) · ×1
  • CheckCommand.runTypecheckPhase (cyclomatic 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:1388 — CheckCommand.runTypecheckPhase has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SurveyCommand.call (cyclomatic 16) · ×1
  • SurveyCommand.call (cyclomatic 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SurveyCommand.kt:98 — SurveyCommand.call has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ToolboxCommand.call (cyclomatic 16) · ×1
  • ToolboxCommand.call (cyclomatic 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxCommand.kt:124 — ToolboxCommand.call has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailmapUnitTestRunner.run (cyclomatic 16) · ×1
  • TrailmapUnitTestRunner.run (cyclomatic 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/TrailmapUnitTestRunner.kt:62 — TrailmapUnitTestRunner.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TrailblazeHostYamlRunner.executeTrailSession (cyclomatic 16) · ×1
  • TrailblazeHostYamlRunner.executeTrailSession (cyclomatic 16) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:256 — TrailblazeHostYamlRunner.executeTrailSession has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DaemonScriptedToolBundler.bundleOneInternal (cyclomatic 16) · ×1
  • DaemonScriptedToolBundler.bundleOneInternal (cyclomatic 16) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:428 — DaemonScriptedToolBundler.bundleOneInternal has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeElementSelectorKt.isBlank (cyclomatic 16) · ×1
  • TrailblazeElementSelectorKt.isBlank (cyclomatic 16) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeElementSelector.kt:209 — TrailblazeElementSelectorKt.isBlank has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrailblazeNodeSelectorGeneratorAndroidViewKt.androidViewStrategies (cyclomatic 16) · ×1
  • TrailblazeNodeSelectorGeneratorAndroidViewKt.androidViewStrategies (cyclomatic 16) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:21 — TrailblazeNodeSelectorGeneratorAndroidViewKt.androidViewStrategies has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AndroidViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cyclomatic 16) · ×1
  • AndroidViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cyclomatic 16) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/AndroidViewHierarchyFilter.kt:34 — AndroidViewHierarchyFilter.findVisibleViewHierarchyTreeNodes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlaywrightDeviceScreenStream.resolveClickTargetAt (cyclomatic 16) · ×1
  • PlaywrightDeviceScreenStream.resolveClickTargetAt (cyclomatic 16) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:381 — PlaywrightDeviceScreenStream.resolveClickTargetAt has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · QuickJsToolHost.connect (cyclomatic 16) · ×1
  • QuickJsToolHost.connect (cyclomatic 16) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolHost.kt:627 — QuickJsToolHost.connect has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · GenerateTestResultsCliCommand.run (cyclomatic 16) · ×1
  • GenerateTestResultsCliCommand.run (cyclomatic 16) trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:192 — GenerateTestResultsCliCommand.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfigToolSet.handleSet (cyclomatic 16) · ×1
  • ConfigToolSet.handleSet (cyclomatic 16) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ConfigToolSet.kt:101 — ConfigToolSet.handleSet has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · resolver.matchesDriverDetail (cyclomatic 16) · ×1
  • resolver.matchesDriverDetail (cyclomatic 16) REDACTED:300 — resolver.matchesDriverDetail has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · LiveSessionReader.drainFiltered (cyclomatic 16) · ×1
  • LiveSessionReader.drainFiltered (cyclomatic 16) sdks/typescript/src/surveys/live.ts:305 — LiveSessionReader.drainFiltered has cyclomatic complexity 16 (threshold 15). Of this number, 15 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.
D1 · Cyclomatic Complexity · waypoints.screensOf (cyclomatic 16) · ×1
  • waypoints.screensOf (cyclomatic 16) REDACTED:250 — waypoints.screensOf has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · index.html.selectTool (cyclomatic 16) · ×1
  • index.html.selectTool (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/devices/index.html:434 — index.html.selectTool has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · waypoint-graph-template.html.getNodeBox (cyclomatic 16) · ×1
  • waypoint-graph-template.html.getNodeBox (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1522 — waypoint-graph-template.html.getNodeBox has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · editor.FileChangedOnDiskDialog (cyclomatic 16) · ×1
  • editor.FileChangedOnDiskDialog (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:587 — editor.FileChangedOnDiskDialog has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 604, 594, 592). 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.
D1 · Cyclomatic Complexity · companion.CompanionReviewAsk · ×1
  • companion.CompanionReviewAsk::send (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:197 — companion.CompanionReviewAsk::send 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. This shape REPEATS in the file: one other method here (companion.CompanionReviewAsk) 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.
D1 · Cyclomatic Complexity · demonstrate.DemoDescribeDialog (cyclomatic 16) · ×1
  • demonstrate.DemoDescribeDialog (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:493 — demonstrate.DemoDescribeDialog has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 508, 519, 498). 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.
D1 · Cyclomatic Complexity · devices.DeviceToggleRow (cyclomatic 16) · ×1
  • devices.DeviceToggleRow (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:287 — devices.DeviceToggleRow has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · external-agents.AgentTrailOutputCard (cyclomatic 16) · ×1
  • external-agents.AgentTrailOutputCard (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2318 — external-agents.AgentTrailOutputCard has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · external-agents.AgentRecordStage · ×1
  • external-agents.AgentRecordStage::onStagePointerUp (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2828 — external-agents.AgentRecordStage::onStagePointerUp 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. This shape REPEATS in the file: one other method here (external-agents.AgentRecordStage) 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.
D1 · Cyclomatic Complexity · trail-detail.TrailImplementationsBoard (cyclomatic 16) · ×1
  • trail-detail.TrailImplementationsBoard (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:802 — trail-detail.TrailImplementationsBoard has cyclomatic complexity 16 (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. This shape REPEATS in the file: one other method here (trail-detail.TrailImplementationsBoard::saveSteps) 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.
D1 · Cyclomatic Complexity · trail-model.removeLogicalLeg (cyclomatic 16) · ×1
  • trail-model.removeLogicalLeg (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:277 — trail-model.removeLogicalLeg has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · trail-model.labelScalar (cyclomatic 16) · ×1
  • trail-model.labelScalar (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:321 — trail-model.labelScalar has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ui.listNavKeyDown (cyclomatic 16) · ×1
  • ui.listNavKeyDown (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:6 — ui.listNavKeyDown has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ui.OptionRow (cyclomatic 16) · ×1
  • ui.OptionRow (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:337 — ui.OptionRow has cyclomatic complexity 16 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · report-live.html.tail (cyclomatic 16) · ×1
  • report-live.html.tail (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/report-live.html:131 — report-live.html.tail has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 159, flush, a function literal at line 202, …). 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.
D1 · Cyclomatic Complexity · run-report-cli.readAttachments (cyclomatic 16) · ×1
  • run-report-cli.readAttachments (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:586 — run-report-cli.readAttachments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-payload.transcriptToolResultDisplay (cyclomatic 16) · ×1
  • run-report-payload.transcriptToolResultDisplay (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:350 — run-report-payload.transcriptToolResultDisplay has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-extract.captureEndTs (cyclomatic 16) · ×1
  • run-report-extract.captureEndTs (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:538 — run-report-extract.captureEndTs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-inspector.nodeLabel (cyclomatic 16) · ×1
  • run-report-inspector.nodeLabel (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:144 — run-report-inspector.nodeLabel 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · run-report-summary-model.firstBranch (cyclomatic 16) · ×1
  • run-report-summary-model.firstBranch (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:280 — run-report-summary-model.firstBranch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-report-summary-model.readArgsYaml (cyclomatic 16) · ×1
  • run-report-summary-model.readArgsYaml (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:514 — run-report-summary-model.readArgsYaml has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (block). 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.
D1 · Cyclomatic Complexity · run-report-theater-model.insetAt (cyclomatic 16) · ×1
  • run-report-theater-model.insetAt (cyclomatic 16) REDACTED:912 — run-report-theater-model.insetAt 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 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 · run-report-summary.mountSummary.showCard (cyclomatic 16) · ×1
  • run-report-summary.mountSummary.showCard (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1009 — run-report-summary.mountSummary.showCard has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · run-report-shell.analysisSubject (cyclomatic 16) · ×1
  • run-report-shell.analysisSubject (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:372 — run-report-shell.analysisSubject has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run-report-shell.focusedProblemHtml (cyclomatic 16) · ×1
  • run-report-shell.focusedProblemHtml (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:626 — run-report-shell.focusedProblemHtml has cyclomatic complexity 16 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · zip-report-core.sessionObjectUrls (cyclomatic 16) · ×1
  • zip-report-core.sessionObjectUrls (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:888 — zip-report-core.sessionObjectUrls has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 898, add, a function literal at line 902). 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. This is NOT this file's highest cyclomatic complexity: zip-report-core.buildSessionInputsFromZipBytes (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · sessionVideoClips (cyclomatic 16) · ×1
  • sessionVideoClips (cyclomatic 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:263 — sessionVideoClips has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 10 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.
D1 · Cyclomatic Complexity · mountLsp · ×1
  • mountLsp::build (cyclomatic 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:520 — mountLsp::build 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.
D10 · Test Quality · No assertions · ×1
  • No assertions: every line identical to the JVM-produced golden trailblaze-selector-engine-js/parity/engine-parity.test.ts:159 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D10 · Test Quality · Fixed-sleep synchronisation · ×1
  • Fixed-sleep synchronisation: waits for another run writing the same session, so neither saves over the other sdks/typescript/src/surveys/stream.test.ts:590 — This test starts work it did not wait for (`holder`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(5)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D2 · Cognitive Complexity · run-report-extract.extractTrace (cognitive 309) · ×1
  • run-report-extract.extractTrace (cognitive 309) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556 — run-report-extract.extractTrace has cognitive complexity 309 (threshold 15). Drivers by points: if/else 52 (149 pts), boolean chains 88, ternaries 28 (67 pts), loops 3 (5 pts) (nesting depth added 138). Of this number, 289 points are the body's own statements and 20 belong to 7 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.
D2 · Cognitive Complexity · steps-board.StepsBoard (cognitive 300) · ×1
  • steps-board.StepsBoard (cognitive 300) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:440 — steps-board.StepsBoard has cognitive complexity 300 (threshold 15). Drivers by points: boolean chains 129, ternaries 78 (117 pts), if/else 42 (50 pts), loops 2 (3 pts), error handling 1 (nesting depth added 48). Of this number, 36 points are the body's own statements and 264 belong to 66 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.
D2 · Cognitive Complexity · record.RecordScreen (cognitive 241) · ×1
  • record.RecordScreen (cognitive 241) REDACTED:474 — record.RecordScreen has cognitive complexity 241 (threshold 15). Drivers by points: ternaries 121 (264 pts), boolean chains 238, if/else 135 (151 pts), error handling 4 (5 pts), loops 1 (nesting depth added 160). To reduce it, split the body into named stages: move each independent 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: 2 other methods here (record.RecordScreen::propose, record.RecordScreen::runAdhocYaml) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D2 · Cognitive Complexity · run-report-summary-model.buildSummaryModel (cognitive 176) · ×1
  • run-report-summary-model.buildSummaryModel (cognitive 176) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1652 — run-report-summary-model.buildSummaryModel has cognitive complexity 176 (threshold 15). Drivers by points: ternaries 31 (78 pts), if/else 31 (61 pts), boolean chains 22, loops 11 (15 pts) (nesting depth added 81). Of this number, 157 points are the body's own statements and 19 belong to 10 function literals 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.
D2 · Cognitive Complexity · waypoint-graph-template.html.SubwayView (cognitive 167) · ×1
  • waypoint-graph-template.html.SubwayView (cognitive 167) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1992 — waypoint-graph-template.html.SubwayView has cognitive complexity 167 (threshold 15). Drivers by points: if/else 79 (90 pts), boolean chains 45, ternaries 21 (28 pts), loops 3, error handling 1 (nesting depth added 18). Most of this is not in the body itself: 13 of the 167 points are its own statements and the rest belongs to 47 function items inside it that branch (a function literal at line 2510, a function literal at line 2400, a function literal at line 2243, …). 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.
D2 · Cognitive Complexity · trails.TrailsScreen (cognitive 147) · ×1
  • trails.TrailsScreen (cognitive 147) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:6 — trails.TrailsScreen has cognitive complexity 147 (threshold 15). Drivers by points: boolean chains 90, if/else 29 (37 pts), ternaries 15, loops 2 (4 pts), error handling 1 (nesting depth added 10). Of this number, 54 points are the body's own statements and 93 belong to 32 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.
D2 · Cognitive Complexity · AndroidVectorIconRasterizer.parseSvgPath (cognitive 125) · ×1
  • AndroidVectorIconRasterizer.parseSvgPath (cognitive 125) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/AndroidVectorIconRasterizer.kt:220 — AndroidVectorIconRasterizer.parseSvgPath has cognitive complexity 125 (threshold 15). Drivers by points: if/else 61 (119 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeRecordingGeneratorKt.generateRecordedTrailItems (cognitive 121) · ×1
  • TrailblazeRecordingGeneratorKt.generateRecordedTrailItems (cognitive 121) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt:272 — TrailblazeRecordingGeneratorKt.generateRecordedTrailItems has cognitive complexity 121 (threshold 15). Drivers by points: if/else 29 (75 pts), boolean chains 23, match/switch 5 (19 pts), loops 2 (4 pts) (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TrailCommand.runTrail (cognitive 117) · ×1
  • TrailCommand.runTrail (cognitive 117) REDACTED:764 — TrailCommand.runTrail has cognitive complexity 117 (threshold 15). Drivers by points: if/else 48 (77 pts), boolean chains 15, loops 4 (11 pts), error handling 7 (9 pts), match/switch 4 (5 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ui.Select (cognitive 115) · ×1
  • ui.Select (cognitive 115) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:130 — ui.Select has cognitive complexity 115 (threshold 15). Drivers by points: ternaries 32 (59 pts), boolean chains 33, if/else 20 (23 pts) (nesting depth added 30). Of this number, 28 points are the body's own statements and 87 belong to 26 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.
D2 · Cognitive Complexity · sessions.SessionsScreen (cognitive 113) · ×1
  • sessions.SessionsScreen (cognitive 113) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:71 — sessions.SessionsScreen has cognitive complexity 113 (threshold 15). Drivers by points: boolean chains 52, ternaries 20 (31 pts), if/else 25 (30 pts) (nesting depth added 16). Of this number, 53 points are the body's own statements and 60 belong to 17 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.
D2 · Cognitive Complexity · StepToolSet.step (cognitive 101) · ×1
  • StepToolSet.step (cognitive 101) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:322 — StepToolSet.step has cognitive complexity 101 (threshold 15). Drivers by points: if/else 57 (79 pts), boolean chains 9, error handling 4 (9 pts), match/switch 2 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IosCompactElementList.buildRecursive (cognitive 98) · ×1
  • IosCompactElementList.buildRecursive (cognitive 98) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:87 — IosCompactElementList.buildRecursive has cognitive complexity 98 (threshold 15). Drivers by points: if/else 35 (59 pts), boolean chains 24, loops 6 (15 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-theater-model.buildTheaterStory (cognitive 97) · ×1
  • run-report-theater-model.buildTheaterStory (cognitive 97) REDACTED:400 — run-report-theater-model.buildTheaterStory has cognitive complexity 97 (threshold 15). Drivers by points: boolean chains 45, ternaries 17 (25 pts), if/else 14 (20 pts), loops 6 (7 pts) (nesting depth added 15). Of this number, 45 points are the body's own statements and 52 belong to 8 function literals 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.
D2 · Cognitive Complexity · record.TrailheadStep (cognitive 95) · ×1
  • record.TrailheadStep (cognitive 95) REDACTED:334 — record.TrailheadStep has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 27 (55 pts), boolean chains 39, if/else 1 (nesting depth added 28). Of this number, 84 points are the body's own statements and 11 belong to 4 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.
D2 · Cognitive Complexity · devices.EditTargetModal (cognitive 93) · ×1
  • devices.EditTargetModal (cognitive 93) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:330 — devices.EditTargetModal has cognitive complexity 93 (threshold 15). Drivers by points: boolean chains 52, ternaries 14 (20 pts), if/else 17 (19 pts), error handling 1 (2 pts) (nesting depth added 9). Of this number, 30 points are the body's own statements and 63 belong to 21 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.
D2 · Cognitive Complexity · shell.App (cognitive 92) · ×1
  • shell.App (cognitive 92) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:747 — shell.App has cognitive complexity 92 (threshold 15). Drivers by points: boolean chains 48, if/else 19 (22 pts), ternaries 14 (22 pts) (nesting depth added 11). Of this number, 31 points are the body's own statements and 61 belong to 14 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.
D2 · Cognitive Complexity · DesktopYamlRunner.runYaml (cognitive 90) · ×1
  • DesktopYamlRunner.runYaml (cognitive 90) trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt:1017 — DesktopYamlRunner.runYaml has cognitive complexity 90 (threshold 15). Drivers by points: if/else 45 (55 pts), boolean chains 21, error handling 7 (9 pts), match/switch 4 (5 pts) (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · record.ProposalCard (cognitive 88) · ×1
  • record.ProposalCard (cognitive 88) REDACTED:2244 — record.ProposalCard has cognitive complexity 88 (threshold 15). Drivers by points: boolean chains 44, ternaries 23 (31 pts), if/else 12 (13 pts) (nesting depth added 9). Of this number, 38 points are the body's own statements and 50 belong to 20 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.
D2 · Cognitive Complexity · AndroidCompactElementList.buildRecursive (cognitive 85) · ×1
  • AndroidCompactElementList.buildRecursive (cognitive 85) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:274 — AndroidCompactElementList.buildRecursive has cognitive complexity 85 (threshold 15). Drivers by points: if/else 35 (55 pts), loops 6 (14 pts), boolean chains 12, match/switch 2 (4 pts) (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.
D2 · Cognitive Complexity · tools.ToolsScreen (cognitive 83) · ×1
  • tools.ToolsScreen (cognitive 83) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:399 — tools.ToolsScreen has cognitive complexity 83 (threshold 15). Drivers by points: boolean chains 55, ternaries 14 (17 pts), if/else 11 (nesting depth added 3). Of this number, 33 points are the body's own statements and 50 belong to 19 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.
D2 · Cognitive Complexity · run-report-strings.stringsTabHtml (cognitive 83) · ×1
  • run-report-strings.stringsTabHtml (cognitive 83) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings.ts:358 — run-report-strings.stringsTabHtml has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 34 (51 pts), boolean chains 19, if/else 8 (13 pts) (nesting depth added 22). Of this number, 53 points are the body's own statements and 30 belong to 16 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.
D2 · Cognitive Complexity · editor.TrailYamlEditor (cognitive 81) · ×1
  • editor.TrailYamlEditor (cognitive 81) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:667 — editor.TrailYamlEditor has cognitive complexity 81 (threshold 15). Drivers by points: boolean chains 32, ternaries 17 (29 pts), if/else 16 (20 pts) (nesting depth added 16). Of this number, 47 points are the body's own statements and 34 belong to 14 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater (cognitive 81) · ×1
  • run-report-theater.mountTheater (cognitive 81) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:213 — run-report-theater.mountTheater has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (41 pts), boolean chains 20, ternaries 13 (17 pts), loops 2, error handling 1 (nesting depth added 11). Of this number, 27 points are the body's own statements and 54 belong to 11 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.
D2 · Cognitive Complexity · runconfig.RunConfigDialog (cognitive 80) · ×1
  • runconfig.RunConfigDialog (cognitive 80) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:6 — runconfig.RunConfigDialog has cognitive complexity 80 (threshold 15). Drivers by points: boolean chains 93, if/else 44 (54 pts), ternaries 35 (44 pts), error handling 2 (nesting depth added 19). 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. This shape REPEATS in the file: one other method here (runconfig.RunConfigDialog::run) 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.
D2 · Cognitive Complexity · TrailblazeMcpBridgeImpl.selectDevice (cognitive 74) · ×1
  • TrailblazeMcpBridgeImpl.selectDevice (cognitive 74) trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:372 — TrailblazeMcpBridgeImpl.selectDevice has cognitive complexity 74 (threshold 15). Drivers by points: if/else 23 (51 pts), error handling 2 (10 pts), boolean chains 8, match/switch 1 (5 pts) (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · demonstrate.DemonstrateFlow (cognitive 74) · ×1
  • demonstrate.DemonstrateFlow (cognitive 74) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:132 — demonstrate.DemonstrateFlow has cognitive complexity 74 (threshold 15). Drivers by points: boolean chains 44, if/else 20, ternaries 6 (10 pts) (nesting depth added 4). Of this number, 25 points are the body's own statements and 49 belong to 8 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.
D2 · Cognitive Complexity · run-report-extract.slimTraceForShare (cognitive 74) · ×1
  • run-report-extract.slimTraceForShare (cognitive 74) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1639 — run-report-extract.slimTraceForShare has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 33 (49 pts), boolean chains 25 (nesting depth added 16). Most of this is not in the body itself: 1 of the 74 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 1640, 1681, 1650, …). 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.
D2 · Cognitive Complexity · run-report-perfetto.buildPerfettoTrace (cognitive 74) · ×1
  • run-report-perfetto.buildPerfettoTrace (cognitive 74) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-perfetto.ts:237 — run-report-perfetto.buildPerfettoTrace has cognitive complexity 74 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 8 (20 pts), boolean chains 16, loops 8 (15 pts) (nesting depth added 31). None of this is in the body itself: all 74 points belong to 6 function literals inside it that branch (lines 239, 325, 296, …). 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.
D2 · Cognitive Complexity · perf-extract.nestAndAccount (cognitive 70) · ×1
  • perf-extract.nestAndAccount (cognitive 70) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:473 — perf-extract.nestAndAccount has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 16 (21 pts), boolean chains 13, ternaries 2 (3 pts) (nesting depth added 21). Of this number, 49 points are the body's own statements and 21 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.
D2 · Cognitive Complexity · monaco-lsp.mountLsp (cognitive 68) · ×1
  • monaco-lsp.mountLsp (cognitive 68) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:491 — monaco-lsp.mountLsp has cognitive complexity 68 (threshold 15). Drivers by points: boolean chains 26, if/else 19 (23 pts), ternaries 15 (19 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 68 points are its own statements and the rest belongs to 20 function items inside it that branch (build, a function literal at line 666, a function literal at line 505, …). 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.
D2 · Cognitive Complexity · ui.SearchableText (cognitive 68) · ×1
  • ui.SearchableText (cognitive 68) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:546 — ui.SearchableText has cognitive complexity 68 (threshold 15). Drivers by points: if/else 29 (35 pts), boolean chains 16, ternaries 6 (11 pts), error handling 3, loops 3 (nesting depth added 11). Most of this is not in the body itself: 9 of the 68 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 627, a function literal at line 582, a function literal at line 573, …). 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.
D2 · Cognitive Complexity · tool.registerPendingTools (cognitive 67) · ×1
  • tool.registerPendingTools (cognitive 67) sdks/typescript/src/tool.ts:465 — tool.registerPendingTools has cognitive complexity 67 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 5 (17 pts), error handling 5 (16 pts), boolean chains 6, loops 1 (nesting depth added 41). Most of this is not in the body itself: 10 of the 67 points are its own statements and the rest belongs to one function literal inside it that branches (line 525). 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.
D2 · Cognitive Complexity · trail-detail.TrailImplementationsBoard (cognitive 67) · ×1
  • trail-detail.TrailImplementationsBoard (cognitive 67) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:802 — trail-detail.TrailImplementationsBoard has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 41, if/else 17 (18 pts), ternaries 6 (7 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 13 of the 67 points are its own statements and the rest belongs to 19 function items inside it that branch (saveSteps, a function literal at line 840, dispatchPlay, …). 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.
D2 · Cognitive Complexity · run-report-trail-replay.buildReplayMemorySeries (cognitive 67) · ×1
  • run-report-trail-replay.buildReplayMemorySeries (cognitive 67) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:878 — run-report-trail-replay.buildReplayMemorySeries has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (34 pts), ternaries 10 (19 pts), boolean chains 9, loops 4 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeAccessibilityService.awaitTreeStable (cognitive 66) · ×1
  • TrailblazeAccessibilityService.awaitTreeStable (cognitive 66) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:936 — TrailblazeAccessibilityService.awaitTreeStable has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (55 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runner.runSurveys (cognitive 66) · ×1
  • runner.runSurveys (cognitive 66) sdks/typescript/src/surveys/runner.ts:131 — runner.runSurveys has cognitive complexity 66 (threshold 15). Drivers by points: if/else 13 (33 pts), ternaries 8 (15 pts), loops 5 (8 pts), boolean chains 5, error handling 2 (5 pts) (nesting depth added 33). Of this number, 62 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · stream-write.writeDerivedStreams (cognitive 66) · ×1
  • stream-write.writeDerivedStreams (cognitive 66) sdks/typescript/src/surveys/stream-write.ts:116 — stream-write.writeDerivedStreams has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (39 pts), error handling 6 (13 pts), boolean chains 6, ternaries 3 (6 pts), loops 2 (nesting depth added 28). Most of this is not in the body itself: 11 of the 66 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 145, 149, 152, …). 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.
D2 · Cognitive Complexity · ExternalAgentRoutesKt.externalAgentRoutes (cognitive 65) · ×1
  • ExternalAgentRoutesKt.externalAgentRoutes (cognitive 65) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:60 — ExternalAgentRoutesKt.externalAgentRoutes has cognitive complexity 65 (threshold 15). Drivers by points: if/else 51 (53 pts), boolean chains 8, match/switch 2, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DeviceManagerToolSet.device (cognitive 65) · ×1
  • DeviceManagerToolSet.device (cognitive 65) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:187 — DeviceManagerToolSet.device has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (37 pts), error handling 4 (13 pts), match/switch 6 (12 pts), boolean chains 3 (nesting depth added 34). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · run-report-clip-player.adopt (cognitive 65) · ×1
  • run-report-clip-player.adopt (cognitive 65) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:338 — run-report-clip-player.adopt has cognitive complexity 65 (threshold 15). Drivers by points: if/else 26 (32 pts), boolean chains 18, ternaries 8 (9 pts), error handling 3 (5 pts), loops 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 65 points is its own statement and the rest belongs to 20 function literals inside it that branch (lines 345, 435, 390, …). 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.
D2 · Cognitive Complexity · cli-main.runSurveyCli (cognitive 64) · ×1
  • cli-main.runSurveyCli (cognitive 64) sdks/typescript/src/surveys/cli-main.ts:56 — cli-main.runSurveyCli has cognitive complexity 64 (threshold 15). Drivers by points: if/else 24 (33 pts), loops 7 (12 pts), ternaries 7 (10 pts), boolean chains 7, error handling 1, match/switch 1 (nesting depth added 17). Of this number, 63 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · demonstrate.DemoGeneratePhase (cognitive 64) · ×1
  • demonstrate.DemoGeneratePhase (cognitive 64) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:532 — demonstrate.DemoGeneratePhase has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 39, ternaries 14 (19 pts), if/else 6 (nesting depth added 5). Of this number, 42 points are the body's own statements and 22 belong to 10 function literals 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.
D2 · Cognitive Complexity · trace-viewer.TraceViewer (cognitive 64) · ×1
  • trace-viewer.TraceViewer (cognitive 64) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:72 — trace-viewer.TraceViewer has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 39, if/else 14 (15 pts), ternaries 10 (nesting depth added 1). Of this number, 40 points are the body's own statements and 24 belong to 11 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.
D2 · Cognitive Complexity · run-report-viewer.RUN_REPORT_VIEWER (cognitive 64) · ×1
  • run-report-viewer.RUN_REPORT_VIEWER (cognitive 64) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:60 — run-report-viewer.RUN_REPORT_VIEWER has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 1173 (2098 pts), boolean chains 1615, if/else 1155 (1522 pts), loops 60 (75 pts), error handling 34 (46 pts) (nesting depth added 1319). To reduce it, split the body into named stages: move each independent 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: 41 other methods here (run-report-viewer.RUN_REPORT_VIEWER::shotClipMark, run-report-viewer.RUN_REPORT_VIEWER::seedSessionDetail, run-report-viewer.RUN_REPORT_VIEWER::readRoute, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 42 times rather than 42 independent problems. Splitting this body alone leaves the other 41 exactly as they are. Where these are variations on one operation, the change that clears all 42 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.
D2 · Cognitive Complexity · UnifiedTrailAdapter.mergeRecordedClassifier (cognitive 62) · ×1
  • UnifiedTrailAdapter.mergeRecordedClassifier (cognitive 62) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:978 — UnifiedTrailAdapter.mergeRecordedClassifier has cognitive complexity 62 (threshold 15). Drivers by points: if/else 33 (50 pts), boolean chains 11, match/switch 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.
D2 · Cognitive Complexity · external-agents.AgentComposer (cognitive 62) · ×1
  • external-agents.AgentComposer (cognitive 62) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1019 — external-agents.AgentComposer has cognitive complexity 62 (threshold 15). Drivers by points: boolean chains 63, ternaries 21 (41 pts), if/else 26 (30 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent 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 (external-agents.AgentComposer::send) 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.
D2 · Cognitive Complexity · waypoint-graph-template.html.App (cognitive 61) · ×1
  • waypoint-graph-template.html.App (cognitive 61) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:3195 — waypoint-graph-template.html.App has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 21 (33 pts), boolean chains 19, if/else 8 (9 pts) (nesting depth added 13). Of this number, 30 points are the body's own statements and 31 belong to 14 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.
D2 · Cognitive Complexity · trail-tree.TrailTree · ×1
  • trail-tree.TrailTree::onTreeKeyDown (cognitive 61) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:182 — trail-tree.TrailTree::onTreeKeyDown has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 12, ternaries 3 (7 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent 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 (trail-tree.TrailTree) 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.
D2 · Cognitive Complexity · editor.CodeEditor (cognitive 60) · ×1
  • editor.CodeEditor (cognitive 60) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:13 — editor.CodeEditor has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 23, ternaries 6 (7 pts), error handling 1 (3 pts), loops 2 (nesting depth added 7). Most of this is not in the body itself: 5 of the 60 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 27, 152, 43, …). 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.
D2 · Cognitive Complexity · device-console.DeviceConsoleScreen (cognitive 60) · ×1
  • device-console.DeviceConsoleScreen (cognitive 60) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:18 — device-console.DeviceConsoleScreen has cognitive complexity 60 (threshold 15). Drivers by points: boolean chains 32, if/else 17 (18 pts), ternaries 6 (7 pts), error handling 3 (nesting depth added 2). Of this number, 16 points are the body's own statements and 44 belong to 21 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.
D2 · Cognitive Complexity · SessionEventsHostFunctions.query (cognitive 58) · ×1
  • SessionEventsHostFunctions.query (cognitive 58) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/SessionEventsHostFunctions.kt:102 — SessionEventsHostFunctions.query has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 9, loops 2 (5 pts), match/switch 2 (4 pts), error handling 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.
D2 · Cognitive Complexity · device-console.DeviceConsoleCard (cognitive 58) · ×1
  • device-console.DeviceConsoleCard (cognitive 58) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:218 — device-console.DeviceConsoleCard has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 23, ternaries 16 (19 pts), if/else 15, error handling 1 (nesting depth added 3). Of this number, 36 points are the body's own statements and 22 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.
D2 · Cognitive Complexity · run-report-extract.extractLlmLogs (cognitive 58) · ×1
  • run-report-extract.extractLlmLogs (cognitive 58) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1301 — run-report-extract.extractLlmLogs has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 24, if/else 9 (16 pts), ternaries 6 (16 pts), loops 2 (nesting depth added 17). Of this number, 43 points are the body's own statements and 15 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.
D2 · Cognitive Complexity · settings.SettingsScreen (cognitive 57) · ×1
  • settings.SettingsScreen (cognitive 57) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx:63 — settings.SettingsScreen has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 24, if/else 13 (17 pts), ternaries 14 (15 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 10 of the 57 points are its own statements and the rest belongs to 12 function items inside it that branch (pickDir, WorkspaceBody, PortSetting, …). 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.
D2 · Cognitive Complexity · zip-report-core.buildRunMeta (cognitive 57) · ×1
  • zip-report-core.buildRunMeta (cognitive 57) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:521 — zip-report-core.buildRunMeta has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 27, if/else 20 (23 pts), ternaries 4 (7 pts) (nesting depth added 6). Of this number, 55 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · normalizeScratchTrailYaml (cognitive 57) · ×1
  • normalizeScratchTrailYaml (cognitive 57) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:210 — normalizeScratchTrailYaml has cognitive complexity 57 (threshold 15). Drivers by points: if/else 47 (84 pts), boolean chains 46, ternaries 13 (32 pts), error handling 2 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReportCommandKt.generateSessionReport (cognitive 56) · ×1
  • ReportCommandKt.generateSessionReport (cognitive 56) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt:776 — ReportCommandKt.generateSessionReport has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29 (35 pts), error handling 7 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailTscValidator.attributeRecordedCalls (cognitive 56) · ×1
  • TrailTscValidator.attributeRecordedCalls (cognitive 56) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailTscValidator.kt:779 — TrailTscValidator.attributeRecordedCalls has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (38 pts), match/switch 3 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runconfig.RunConfigDialog · ×1
  • runconfig.RunConfigDialog::run (cognitive 56) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:301 — runconfig.RunConfigDialog::run has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 12, ternaries 7 (11 pts), error handling 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. This shape REPEATS in the file: one other method here (runconfig.RunConfigDialog) 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.
D2 · Cognitive Complexity · external-agents.AgentToolCard (cognitive 56) · ×1
  • external-agents.AgentToolCard (cognitive 56) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2144 — external-agents.AgentToolCard has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 17 (32 pts), boolean chains 24 (nesting depth added 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-extract.decisionLlmRow (cognitive 55) · ×1
  • run-report-extract.decisionLlmRow (cognitive 55) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1425 — run-report-extract.decisionLlmRow has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 22 (24 pts), boolean chains 23, if/else 8 (nesting depth added 2). Of this number, 26 points are the body's own statements and 29 belong to 8 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.
D2 · Cognitive Complexity · TrailCommand.delegateToDaemon (cognitive 54) · ×1
  • TrailCommand.delegateToDaemon (cognitive 54) REDACTED:1365 — TrailCommand.delegateToDaemon has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (43 pts), loops 2 (4 pts), boolean chains 3, match/switch 2 (3 pts), error handling 1 (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.
D2 · Cognitive Complexity · run-report-strings.buildStringsModel (cognitive 54) · ×1
  • run-report-strings.buildStringsModel (cognitive 54) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings.ts:113 — run-report-strings.buildStringsModel has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 26, if/else 11 (21 pts), loops 4, ternaries 3 (nesting depth added 10). Most of this is not in the body itself: 8 of the 54 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 139, a function literal at line 195, shotFor, …). 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.
D2 · Cognitive Complexity · DaemonClient.runAsync (cognitive 53) · ×1
  • DaemonClient.runAsync (cognitive 53) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DaemonClient.kt:291 — DaemonClient.runAsync has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (35 pts), error handling 4 (12 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.androidAccessibilityStrategies (cognitive 53) · ×1
  • TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.androidAccessibilityStrategies (cognitive 53) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:10 — TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.androidAccessibilityStrategies has cognitive complexity 53 (threshold 15). Drivers by points: if/else 38 (39 pts), boolean chains 14 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · run-report-summary.mountSummary (cognitive 53) · ×1
  • run-report-summary.mountSummary (cognitive 53) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:325 — run-report-summary.mountSummary has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 13 (20 pts), boolean chains 7 (nesting depth added 14). Of this number, 37 points are the body's own statements and 16 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.
D2 · Cognitive Complexity · home.ReadinessPanel (cognitive 52) · ×1
  • home.ReadinessPanel (cognitive 52) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx:130 — home.ReadinessPanel has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 24 (38 pts), boolean chains 13, if/else 1 (nesting depth added 14). Of this number, 44 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · record.StepCard (cognitive 52) · ×1
  • record.StepCard (cognitive 52) REDACTED:1921 — record.StepCard has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 16 (31 pts), boolean chains 17, if/else 3, error handling 1 (nesting depth added 15). Of this number, 36 points are the body's own statements and 16 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.
D2 · Cognitive Complexity · trailmaps.ComponentRunTab (cognitive 52) · ×1
  • trailmaps.ComponentRunTab (cognitive 52) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:343 — trailmaps.ComponentRunTab has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 17 (36 pts), boolean chains 13, if/else 3 (nesting depth added 19). Of this number, 44 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · McpProxy.forwardRequest (cognitive 51) · ×1
  • McpProxy.forwardRequest (cognitive 51) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/McpProxy.kt:700 — McpProxy.forwardRequest has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (45 pts), error handling 3 (5 pts), loops 1 (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.
D2 · Cognitive Complexity · devices.TargetDevicePicker (cognitive 51) · ×1
  • devices.TargetDevicePicker (cognitive 51) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:10 — devices.TargetDevicePicker has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 36, if/else 7 (8 pts), ternaries 7 (nesting depth added 1). Of this number, 24 points are the body's own statements and 27 belong to 11 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.
D2 · Cognitive Complexity · CliMcpClient.connectReusable (cognitive 50) · ×1
  • CliMcpClient.connectReusable (cognitive 50) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:1453 — CliMcpClient.connectReusable has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (33 pts), error handling 6 (12 pts), boolean chains 5 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · runnableSteps (cognitive 50) · ×1
  • runnableSteps (cognitive 50) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:117 — runnableSteps has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (26 pts), ternaries 7 (16 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 25). Of this number, 41 points are the body's own statements and 9 belong to 3 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.
D2 · Cognitive Complexity · trailmaps.ComponentTypeScreen (cognitive 49) · ×1
  • trailmaps.ComponentTypeScreen (cognitive 49) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:90 — trailmaps.ComponentTypeScreen has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 39, if/else 5, ternaries 5. Of this number, 24 points are the body's own statements and 25 belong to 12 function literals 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.
D2 · Cognitive Complexity · shell.TargetPicker (cognitive 49) · ×1
  • shell.TargetPicker (cognitive 49) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:76 — shell.TargetPicker has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 18 (32 pts), boolean chains 13, if/else 3 (4 pts) (nesting depth added 15). Of this number, 37 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · run-report-summary-model.screenTexts (cognitive 49) · ×1
  • run-report-summary-model.screenTexts (cognitive 49) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1318 — run-report-summary-model.screenTexts has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 8 (18 pts), if/else 7 (16 pts), boolean chains 10, loops 4 (5 pts) (nesting depth added 20). Of this number, 37 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · companion.CompanionScreen (cognitive 48) · ×1
  • companion.CompanionScreen (cognitive 48) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:528 — companion.CompanionScreen has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 24, if/else 11 (14 pts), ternaries 4 (5 pts), error handling 2 (4 pts), loops 1 (nesting depth added 6). Of this number, 27 points are the body's own statements and 21 belong to 5 function literals 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.
D2 · Cognitive Complexity · device-console.ToolComposer (cognitive 48) · ×1
  • device-console.ToolComposer (cognitive 48) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:400 — device-console.ToolComposer has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 27, ternaries 11 (15 pts), if/else 6 (nesting depth added 4). Of this number, 30 points are the body's own statements and 18 belong to 7 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.
D2 · Cognitive Complexity · external-agents.ExternalAgentChat (cognitive 48) · ×1
  • external-agents.ExternalAgentChat (cognitive 48) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:257 — external-agents.ExternalAgentChat has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 60, ternaries 32 (54 pts), if/else 28 (32 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (external-agents.ExternalAgentChat::proposeAtPoint) 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.
D2 · Cognitive Complexity · CrashEventArtifactWriter.detect (cognitive 47) · ×1
  • CrashEventArtifactWriter.detect (cognitive 47) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/logcat/CrashEventArtifactWriter.kt:95 — CrashEventArtifactWriter.detect has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (40 pts), boolean chains 6, loops 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.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorHelpersKt.buildTargetMatch (cognitive 47) · ×1
  • TrailblazeNodeSelectorGeneratorHelpersKt.buildTargetMatch (cognitive 47) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:263 — TrailblazeNodeSelectorGeneratorHelpersKt.buildTargetMatch has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 14, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · devices.TargetCard (cognitive 46) · ×1
  • devices.TargetCard (cognitive 46) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:221 — devices.TargetCard has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 25 (41 pts), boolean chains 5 (nesting depth added 16). Of this number, 43 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.
D2 · Cognitive Complexity · fold (cognitive 46) · ×1
  • fold (cognitive 46) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-activity-model.js:101 — fold has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (32 pts), ternaries 3 (8 pts), boolean chains 6 (nesting depth added 15). Most of this is not in the body itself: 10 of the 46 points are its own statements and the rest belongs to one function literal inside it that branches (line 107). 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.
D2 · Cognitive Complexity · EventStreamScanner.forward (cognitive 45) · ×1
  • EventStreamScanner.forward (cognitive 45) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:56 — EventStreamScanner.forward has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 5, loops 2 (3 pts) (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.
D2 · Cognitive Complexity · SessionStartCommand.startSession (cognitive 44) · ×1
  • SessionStartCommand.startSession (cognitive 44) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:182 — SessionStartCommand.startSession has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (33 pts), match/switch 3 (5 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trail-yaml.applyRecordingEdit (cognitive 44) · ×1
  • trail-yaml.applyRecordingEdit (cognitive 44) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:561 — trail-yaml.applyRecordingEdit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 11, ternaries 1 (nesting depth added 14). Of this number, 43 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.
D2 · Cognitive Complexity · IosSetPermissionsTrailblazeTool.execute (cognitive 43) · ×1
  • IosSetPermissionsTrailblazeTool.execute (cognitive 43) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/ios/tools/IosSetPermissionsTrailblazeTool.kt:84 — IosSetPermissionsTrailblazeTool.execute has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 7, match/switch 2 (5 pts), loops 2 (3 pts), error handling 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorHelpersKt.withTextOf (cognitive 43) · ×1
  • TrailblazeNodeSelectorGeneratorHelpersKt.withTextOf (cognitive 43) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:90 — TrailblazeNodeSelectorGeneratorHelpersKt.withTextOf has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 17, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaywrightTrailblazeAgent.executePlaywrightToolOnThread (cognitive 43) · ×1
  • PlaywrightTrailblazeAgent.executePlaywrightToolOnThread (cognitive 43) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:255 — PlaywrightTrailblazeAgent.executePlaywrightToolOnThread has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 8, error handling 3 (8 pts), match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BridgeUiActionExecutor.describeScreen (cognitive 43) · ×1
  • BridgeUiActionExecutor.describeScreen (cognitive 43) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:321 — BridgeUiActionExecutor.describeScreen has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (36 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps-board.RecordConfigDialog (cognitive 43) · ×1
  • steps-board.RecordConfigDialog (cognitive 43) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1188 — steps-board.RecordConfigDialog has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 28, ternaries 10 (11 pts), if/else 4 (nesting depth added 1). Of this number, 23 points are the body's own statements and 20 belong to 4 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.
D2 · Cognitive Complexity · run-report-extract.toolChildren (cognitive 43) · ×1
  • run-report-extract.toolChildren (cognitive 43) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:990 — run-report-extract.toolChildren has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 48, if/else 13 (29 pts), ternaries 16 (24 pts), loops 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent 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 (run-report-extract.toolChildren::spanCapture) 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.
D2 · Cognitive Complexity · run-report-visible-strings.extractVisibleStrings (cognitive 43) · ×1
  • run-report-visible-strings.extractVisibleStrings (cognitive 43) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-visible-strings.ts:77 — run-report-visible-strings.extractVisibleStrings has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 7 (15 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 18). Of this number, 40 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.
D2 · Cognitive Complexity · RecordRoutesKt.recordRoutes (cognitive 42) · ×1
  • RecordRoutesKt.recordRoutes (cognitive 42) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:99 — RecordRoutesKt.recordRoutes has cognitive complexity 42 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 8, loops 1 (3 pts), error handling 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ElementRef.resolveInTree (cognitive 42) · ×1
  • ElementRef.resolveInTree (cognitive 42) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/ElementRefSlug.kt:52 — ElementRef.resolveInTree has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 12, match/switch 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeRecordingGeneratorKt.selectDirectToolLogs (cognitive 42) · ×1
  • TrailblazeRecordingGeneratorKt.selectDirectToolLogs (cognitive 42) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailblazeRecordingGenerator.kt:794 — TrailblazeRecordingGeneratorKt.selectDirectToolLogs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 16, match/switch 2 (4 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScriptedToolSourceSnapshotScanner.snapshot (cognitive 41) · ×1
  • ScriptedToolSourceSnapshotScanner.snapshot (cognitive 41) trailblaze-host/src/main/java/xyz/block/trailblaze/usages/ScriptedToolSourceSnapshotScanner.kt:55 — ScriptedToolSourceSnapshotScanner.snapshot has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 5 (11 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · phase.findSplit (cognitive 41) · ×1
  • phase.findSplit (cognitive 41) sdks/typescript/src/surveys/phase.ts:143 — phase.findSplit has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 12, ternaries 9 (10 pts), loops 1 (2 pts) (nesting depth added 10). Of this number, 33 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · editor.insertToolIntoTrailYaml (cognitive 41) · ×1
  • editor.insertToolIntoTrailYaml (cognitive 41) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:260 — editor.insertToolIntoTrailYaml has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 6, loops 5 (6 pts), ternaries 2 (3 pts) (nesting depth added 14). Of this number, 34 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.
D2 · Cognitive Complexity · external-agents.AgentTranscriptItem (cognitive 41) · ×1
  • external-agents.AgentTranscriptItem (cognitive 41) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1993 — external-agents.AgentTranscriptItem has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 8 (18 pts), boolean chains 16, if/else 3 (6 pts), match/switch 1 (nesting depth added 13). Of this number, 37 points are the body's own statements and 4 belong to 2 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · trail-detail.StepsMode (cognitive 41) · ×1
  • trail-detail.StepsMode (cognitive 41) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:694 — trail-detail.StepsMode has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 20, ternaries 8 (14 pts), if/else 5 (7 pts) (nesting depth added 8). Of this number, 26 points are the body's own statements and 15 belong to 7 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.
D2 · Cognitive Complexity · TrailFileManager.normalizeToEditableSteps (cognitive 40) · ×1
  • TrailFileManager.normalizeToEditableSteps (cognitive 40) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailFileManager.kt:758 — TrailFileManager.normalizeToEditableSteps has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (15 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · live.runLiveSurvey (cognitive 40) · ×1
  • live.runLiveSurvey (cognitive 40) sdks/typescript/src/surveys/live.ts:565 — live.runLiveSurvey has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 5 (8 pts), boolean chains 6, loops 1 (nesting depth added 17). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trail-tree.TrailTree (cognitive 40) · ×1
  • trail-tree.TrailTree (cognitive 40) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:76 — trail-tree.TrailTree has cognitive complexity 40 (threshold 15). Drivers by points: if/else 44 (74 pts), boolean chains 72, ternaries 17 (26 pts), loops 3 (4 pts) (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. This shape REPEATS in the file: one other method here (trail-tree.TrailTree::onTreeKeyDown) 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater.syncVideos (cognitive 40) · ×1
  • run-report-theater.mountTheater.syncVideos (cognitive 40) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:1022 — run-report-theater.mountTheater.syncVideos has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 20). Of this number, 35 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · DirectMcpAgent.run (cognitive 39) · ×1
  • DirectMcpAgent.run (cognitive 39) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/DirectMcpAgent.kt:141 — DirectMcpAgent.run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 3 (10 pts), loops 1 (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.
D2 · Cognitive Complexity · HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive (cognitive 39) · ×1
  • HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive (cognitive 39) trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/HostAndroidDeviceConnectUtils.kt:433 — HostAndroidDeviceConnectUtils.connectToInstrumentationExclusive has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27 (33 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cognitive 39) · ×1
  • IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cognitive 39) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/IosViewHierarchyFilter.kt:42 — IosViewHierarchyFilter.findVisibleViewHierarchyTreeNodes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 11, loops 7 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CaptureVideoFrames.fill (cognitive 39) · ×1
  • CaptureVideoFrames.fill (cognitive 39) trailblaze-report/src/main/java/xyz/block/trailblaze/report/strings/CaptureVideoFrames.kt:86 — CaptureVideoFrames.fill has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 6 (10 pts), match/switch 3 (7 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.
D2 · Cognitive Complexity · resolver.matchesSelector (cognitive 39) · ×1
  • resolver.matchesSelector (cognitive 39) REDACTED:162 — resolver.matchesSelector has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (39 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc (cognitive 38) · ×1
  • TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc (cognitive 38) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:458 — TrailblazeHostYamlRunner.runHostAgentWithOnDeviceRpc has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (27 pts), match/switch 3 (5 pts), loops 2 (3 pts), error handling 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailRunnerRecordingService.gesture (cognitive 38) · ×1
  • TrailRunnerRecordingService.gesture (cognitive 38) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:890 — TrailRunnerRecordingService.gesture has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · discover.loadSurveyModules (cognitive 38) · ×1
  • discover.loadSurveyModules (cognitive 38) sdks/typescript/src/surveys/discover.ts:284 — discover.loadSurveyModules has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 17). Of this number, 26 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · shell.NavRail (cognitive 38) · ×1
  • shell.NavRail (cognitive 38) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:381 — shell.NavRail has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 25, ternaries 7, if/else 5 (6 pts) (nesting depth added 1). Of this number, 26 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · perf-extract.buildRawSpans (cognitive 38) · ×1
  • perf-extract.buildRawSpans (cognitive 38) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:194 — perf-extract.buildRawSpans has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 14, ternaries 3 (nesting depth added 6). None of this is in the body itself: all 38 points belong to one function literal inside it that branches (line 201). 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.
D2 · Cognitive Complexity · BaseTrailblazeAgent.dispatchTools (cognitive 37) · ×1
  • BaseTrailblazeAgent.dispatchTools (cognitive 37) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/BaseTrailblazeAgent.kt:230 — BaseTrailblazeAgent.dispatchTools has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 4 (11 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · PlaywrightScreenState.buildPageContextHeader (cognitive 37) · ×1
  • PlaywrightScreenState.buildPageContextHeader (cognitive 37) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:259 — PlaywrightScreenState.buildPageContextHeader has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), error handling 5, boolean chains 3, loops 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.
D2 · Cognitive Complexity · phase.phaseOf (cognitive 37) · ×1
  • phase.phaseOf (cognitive 37) sdks/typescript/src/surveys/phase.ts:265 — phase.phaseOf has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 6, ternaries 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · blaze.BlazeScreen (cognitive 37) · ×1
  • blaze.BlazeScreen (cognitive 37) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:15 — blaze.BlazeScreen has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 51, ternaries 17 (24 pts), if/else 16 (17 pts) (nesting depth added 8). 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. This shape REPEATS in the file: one other method here (blaze.BlazeScreen::blaze) 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.
D2 · Cognitive Complexity · trail-yaml.mergeBlazeYaml (cognitive 37) · ×1
  • trail-yaml.mergeBlazeYaml (cognitive 37) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:471 — trail-yaml.mergeBlazeYaml has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 7, ternaries 3, error handling 2, loops 1 (2 pts) (nesting depth added 7). Of this number, 33 points are the body's own statements and 4 belong to 2 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.
D2 · Cognitive Complexity · RunYamlRequestHandler.handle (cognitive 36) · ×1
  • RunYamlRequestHandler.handle (cognitive 36) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/RunYamlRequestHandler.kt:192 — RunYamlRequestHandler.handle has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (28 pts), error handling 5 (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.
D2 · Cognitive Complexity · run-report-extract.yamlScalarAt (cognitive 36) · ×1
  • run-report-extract.yamlScalarAt (cognitive 36) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:326 — run-report-extract.yamlScalarAt has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-extract.toSessionPayloads (cognitive 36) · ×1
  • run-report-extract.toSessionPayloads (cognitive 36) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1873 — run-report-extract.toSessionPayloads has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 29, ternaries 6 (7 pts) (nesting depth added 1). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to one function literal inside it that branches (line 1874). 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.
D2 · Cognitive Complexity · run-report-summary-model.memoryLane (cognitive 36) · ×1
  • run-report-summary-model.memoryLane (cognitive 36) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1120 — run-report-summary-model.memoryLane has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 2 (4 pts), boolean chains 3, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-theater.mountTheater.place (cognitive 36) · ×1
  • run-report-theater.mountTheater.place (cognitive 36) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:610 — run-report-theater.mountTheater.place has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (21 pts), boolean chains 8, if/else 4 (6 pts), loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · H264Tee.runReaderLoop (cognitive 35) · ×1
  • H264Tee.runReaderLoop (cognitive 35) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/H264Tee.kt:257 — H264Tee.runReaderLoop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 4 (9 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedRecordingWriter.mergeIntoUnified (cognitive 35) · ×1
  • UnifiedRecordingWriter.mergeIntoUnified (cognitive 35) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:473 — UnifiedRecordingWriter.mergeIntoUnified has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 9 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WaypointMigrateTrailCommand.call (cognitive 35) · ×1
  • WaypointMigrateTrailCommand.call (cognitive 35) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointMigrateTrailCommand.kt:183 — WaypointMigrateTrailCommand.call has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 4, match/switch 4, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AndroidViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cognitive 35) · ×1
  • AndroidViewHierarchyFilter.findVisibleViewHierarchyTreeNodes (cognitive 35) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/AndroidViewHierarchyFilter.kt:34 — AndroidViewHierarchyFilter.findVisibleViewHierarchyTreeNodes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shell.WorkspaceChip (cognitive 35) · ×1
  • shell.WorkspaceChip (cognitive 35) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:158 — shell.WorkspaceChip has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 18, ternaries 7 (9 pts), if/else 7, error handling 1 (nesting depth added 2). Of this number, 24 points are the body's own statements and 11 belong to 5 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.
D2 · Cognitive Complexity · run-report-events.buildEventStream (cognitive 35) · ×1
  • run-report-events.buildEventStream (cognitive 35) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:438 — run-report-events.buildEventStream has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 7 (9 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (nesting depth added 10). Of this number, 34 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.
D2 · Cognitive Complexity · run-report-compare-model.contentDiffOf (cognitive 35) · ×1
  • run-report-compare-model.contentDiffOf (cognitive 35) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1159 — run-report-compare-model.contentDiffOf has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 6, loops 2 (nesting depth added 12). Most of this is not in the body itself: 10 of the 35 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1225, a function literal at line 1191, flushEdits, …). 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.
D2 · Cognitive Complexity · videoArtifactsFrom (cognitive 35) · ×1
  • videoArtifactsFrom (cognitive 35) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:206 — videoArtifactsFrom has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 8, ternaries 3 (5 pts), error handling 1, loops 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.
D2 · Cognitive Complexity · TrailblazeAccessibilityService.waitForSettled (cognitive 34) · ×1
  • TrailblazeAccessibilityService.waitForSettled (cognitive 34) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/TrailblazeAccessibilityService.kt:324 — TrailblazeAccessibilityService.waitForSettled has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelectorDialectLint.lintConfigurationLegs (cognitive 34) · ×1
  • SelectorDialectLint.lintConfigurationLegs (cognitive 34) trailblaze-host/src/main/java/xyz/block/trailblaze/host/SelectorDialectLint.kt:296 — SelectorDialectLint.lintConfigurationLegs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · SessionImporter.importSessionFromZip (cognitive 34) · ×1
  • SessionImporter.importSessionFromZip (cognitive 34) trailblaze-host/src/main/java/xyz/block/trailblaze/ui/tabs/sessions/SessionImporter.kt:43 — SessionImporter.importSessionFromZip has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 5 (7 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstCompose (cognitive 34) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstCompose (cognitive 34) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:524 — TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstCompose has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, boolean chains 5, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailblazeMcpServer.registerToolsLocked (cognitive 34) · ×1
  • TrailblazeMcpServer.registerToolsLocked (cognitive 34) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:2587 — TrailblazeMcpServer.registerToolsLocked has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 5, error handling 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · data-extract.buildTrailBundleRows (cognitive 34) · ×1
  • data-extract.buildTrailBundleRows (cognitive 34) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-extract.tsx:249 — data-extract.buildTrailBundleRows has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 18, if/else 5 (7 pts), loops 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 6). Of this number, 25 points are the body's own statements and 9 belong to 5 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.
D2 · Cognitive Complexity · external-agents.buildAgentTranscript (cognitive 34) · ×1
  • external-agents.buildAgentTranscript (cognitive 34) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1784 — external-agents.buildAgentTranscript has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 8, loops 2 (3 pts), match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1787, 1852, 1851). 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.
D2 · Cognitive Complexity · run-report-trace-spans.slimTracerSpans (cognitive 34) · ×1
  • run-report-trace-spans.slimTracerSpans (cognitive 34) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-trace-spans.ts:20 — run-report-trace-spans.slimTracerSpans has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 9, ternaries 3 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · perf-extract.extractPerfSession (cognitive 34) · ×1
  • perf-extract.extractPerfSession (cognitive 34) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:752 — perf-extract.extractPerfSession has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 8, ternaries 4 (5 pts), loops 3 (nesting depth added 9). Of this number, 27 points are the body's own statements and 7 belong to 3 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.
D2 · Cognitive Complexity · run-report-compare-model.timedEventObjectsOf (cognitive 34) · ×1
  • run-report-compare-model.timedEventObjectsOf (cognitive 34) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:694 — run-report-compare-model.timedEventObjectsOf has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (19 pts), boolean chains 11, error handling 1 (3 pts), if/else 1 (nesting depth added 14). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 711, a function literal at line 698, a function literal at line 704, …). 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater.tick (cognitive 34) · ×1
  • run-report-theater.mountTheater.tick (cognitive 34) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:1257 — run-report-theater.mountTheater.tick has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (6 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · zip-report-core.resolveRenderer (cognitive 34) · ×1
  • zip-report-core.resolveRenderer (cognitive 34) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:916 — zip-report-core.resolveRenderer has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 33, 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.
D2 · Cognitive Complexity · runMeta (cognitive 34) · ×1
  • runMeta (cognitive 34) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:150 — runMeta has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 25, ternaries 9. 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TrailblazeProjectConfigLoader.resolveTrailmapArtifacts (cognitive 33) · ×1
  • TrailblazeProjectConfigLoader.resolveTrailmapArtifacts (cognitive 33) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailblazeProjectConfigLoader.kt:377 — TrailblazeProjectConfigLoader.resolveTrailmapArtifacts has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (23 pts), error handling 4 (7 pts), match/switch 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.
D2 · Cognitive Complexity · SessionRoutesKt.sessionRoutes (cognitive 33) · ×1
  • SessionRoutesKt.sessionRoutes (cognitive 33) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:291 — SessionRoutesKt.sessionRoutes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · editor.MonacoTrailEditor (cognitive 33) · ×1
  • editor.MonacoTrailEditor (cognitive 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:461 — editor.MonacoTrailEditor has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15, boolean chains 13, ternaries 3, error handling 1 (2 pts) (nesting depth added 1). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 526, 516, 540, …). 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.
D2 · Cognitive Complexity · tools.ToolSourceEditor (cognitive 33) · ×1
  • tools.ToolSourceEditor (cognitive 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:171 — tools.ToolSourceEditor has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 18, if/else 8 (10 pts), ternaries 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 3 function items inside it that branch (rebuildAndRestart, save, a function literal at line 240). 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.
D2 · Cognitive Complexity · EventStreamScanner.backward (cognitive 32) · ×1
  • EventStreamScanner.backward (cognitive 32) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:130 — EventStreamScanner.backward has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolboxCommand.formatIndexResult (cognitive 32) · ×1
  • ToolboxCommand.formatIndexResult (cognitive 32) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxCommand.kt:333 — ToolboxCommand.formatIndexResult has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorEnumerationKt.matchTier (cognitive 32) · ×1
  • TrailblazeNodeSelectorGeneratorEnumerationKt.matchTier (cognitive 32) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorEnumeration.kt:200 — TrailblazeNodeSelectorGeneratorEnumerationKt.matchTier has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 8 (15 pts), boolean chains 10, if/else 7 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · integrations.IntegrationCard (cognitive 32) · ×1
  • integrations.IntegrationCard (cognitive 32) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/integrations.tsx:11 — integrations.IntegrationCard has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 8, if/else 4 (6 pts), error handling 1 (2 pts) (nesting depth added 9). Of this number, 18 points are the body's own statements and 14 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.
D2 · Cognitive Complexity · record.ProposalToolRow (cognitive 32) · ×1
  • record.ProposalToolRow (cognitive 32) REDACTED:2126 — record.ProposalToolRow has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 23, if/else 5, ternaries 4. Of this number, 21 points are the body's own statements and 11 belong to 8 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.
D2 · Cognitive Complexity · run-report-payload.normalizeEventPayload (cognitive 32) · ×1
  • run-report-payload.normalizeEventPayload (cognitive 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:45 — run-report-payload.normalizeEventPayload has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 6 (10 pts), boolean chains 9, loops 1 (nesting depth added 7). Of this number, 23 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.
D2 · Cognitive Complexity · run-report-extract.assignTraceDevices (cognitive 32) · ×1
  • run-report-extract.assignTraceDevices (cognitive 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:892 — run-report-extract.assignTraceDevices has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 10, loops 4 (nesting depth added 9). Of this number, 25 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.
D2 · Cognitive Complexity · run-report-extract.toolChildren · ×1
  • run-report-extract.toolChildren::spanCapture (cognitive 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1004 — run-report-extract.toolChildren::spanCapture has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (10 pts), ternaries 5 (8 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (run-report-extract.toolChildren) 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.
D2 · Cognitive Complexity · run-report-extract.estimateLlmComp (cognitive 32) · ×1
  • run-report-extract.estimateLlmComp (cognitive 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1201 — run-report-extract.estimateLlmComp has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 11, ternaries 4 (5 pts), loops 1 (nesting depth added 9). Of this number, 28 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · run-report-inspector.inspectorModel (cognitive 32) · ×1
  • run-report-inspector.inspectorModel (cognitive 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:158 — run-report-inspector.inspectorModel has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, loops 3 (6 pts), ternaries 2 (3 pts) (nesting depth added 11). Of this number, 24 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater.paintScreens (cognitive 32) · ×1
  • run-report-theater.mountTheater.paintScreens (cognitive 32) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:997 — run-report-theater.mountTheater.paintScreens has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 4 (10 pts), boolean chains 4, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve (cognitive 32) · ×1
  • resolve (cognitive 32) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:19 — resolve has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 30, 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.
D2 · Cognitive Complexity · KotlinSourceParser.findPrecedingKdoc (cognitive 31) · ×1
  • KotlinSourceParser.findPrecedingKdoc (cognitive 31) build-logic/src/main/kotlin/SelectorTsCodegen.kt:431 — KotlinSourceParser.findPrecedingKdoc has cognitive complexity 31 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (8 pts), boolean chains 7, match/switch 2 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · external-agents.useAgentDeviceMirror (cognitive 31) · ×1
  • external-agents.useAgentDeviceMirror (cognitive 31) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2389 — external-agents.useAgentDeviceMirror has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 15, ternaries 1. Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 2503, 2553, 2512, …). 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.
D2 · Cognitive Complexity · run-report-trace-model.buildReportTraceModel (cognitive 31) · ×1
  • run-report-trace-model.buildReportTraceModel (cognitive 31) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trace-model.ts:140 — run-report-trace-model.buildReportTraceModel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 12, loops 3 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 150, 226). 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.
D2 · Cognitive Complexity · run-report-trail-replay.buildReplayTimeline (cognitive 31) · ×1
  • run-report-trail-replay.buildReplayTimeline (cognitive 31) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:104 — run-report-trail-replay.buildReplayTimeline has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (9 pts), boolean chains 6, ternaries 3 (nesting depth added 14). Of this number, 29 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · run-report-theater-model.buildTheaterStory.chapters (cognitive 31) · ×1
  • run-report-theater-model.buildTheaterStory.chapters (cognitive 31) REDACTED:627 — run-report-theater-model.buildTheaterStory.chapters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 8 (12 pts), boolean chains 6, loops 1 (nesting depth added 10). Of this number, 30 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.
D2 · Cognitive Complexity · extractToolSpec (cognitive 31) · ×1
  • extractToolSpec (cognitive 31) sdks/typescript/tools/extract-tool-defs.mjs:782 — extractToolSpec has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, ternaries 3 (5 pts), loops 1, other 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaestroUiAutomatorXmlParser.mapXmlHierarchyToMaestroTreeNode (cognitive 30) · ×1
  • MaestroUiAutomatorXmlParser.mapXmlHierarchyToMaestroTreeNode (cognitive 30) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/android/MaestroUiAutomatorXmlParser.kt:44 — MaestroUiAutomatorXmlParser.mapXmlHierarchyToMaestroTreeNode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · McpProxy.runSseListener (cognitive 30) · ×1
  • McpProxy.runSseListener (cognitive 30) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/McpProxy.kt:1403 — McpProxy.runSseListener has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResolvedTargetReportEmitter.renderAgentToolbox (cognitive 30) · ×1
  • ResolvedTargetReportEmitter.renderAgentToolbox (cognitive 30) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:428 — ResolvedTargetReportEmitter.renderAgentToolbox has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (5 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.
D2 · Cognitive Complexity · ScriptedToolDefinitionAnalyzer.scanToolSources (cognitive 30) · ×1
  • ScriptedToolDefinitionAnalyzer.scanToolSources (cognitive 30) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionAnalyzer.kt:369 — ScriptedToolDefinitionAnalyzer.scanToolSources has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeDesktopApp.handleCliRunRequest (cognitive 30) · ×1
  • TrailblazeDesktopApp.handleCliRunRequest (cognitive 30) trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDesktopApp.kt:203 — TrailblazeDesktopApp.handleCliRunRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 4 (7 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlmTokenBreakdownEstimator.estimateBreakdown (cognitive 30) · ×1
  • LlmTokenBreakdownEstimator.estimateBreakdown (cognitive 30) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/LlmTokenBreakdownEstimator.kt:32 — LlmTokenBreakdownEstimator.estimateBreakdown has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data-core.applyTrailRunnerUiCommand (cognitive 30) · ×1
  • data-core.applyTrailRunnerUiCommand (cognitive 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1285 — data-core.applyTrailRunnerUiCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 13, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). Of this number, 25 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.
D2 · Cognitive Complexity · demonstrate.DemoLiveTrailRail (cognitive 30) · ×1
  • demonstrate.DemoLiveTrailRail (cognitive 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:684 — demonstrate.DemoLiveTrailRail has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (10 pts), if/else 9 (nesting depth added 5). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 693, 717, 690, …). 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.
D2 · Cognitive Complexity · external-agents.ExternalAgentsScreen (cognitive 30) · ×1
  • external-agents.ExternalAgentsScreen (cognitive 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:163 — external-agents.ExternalAgentsScreen has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 18, if/else 8, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 6 function items inside it that branch (stop, a function literal at line 177, a function literal at line 195, …). 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.
D2 · Cognitive Complexity · trail-detail.parseTrailSteps (cognitive 30) · ×1
  • trail-detail.parseTrailSteps (cognitive 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:57 — trail-detail.parseTrailSteps has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (8 pts), boolean chains 6, loops 2, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 13 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 81, mapTools). 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.
D2 · Cognitive Complexity · trail-yaml.normalizeTrailDoc (cognitive 30) · ×1
  • trail-yaml.normalizeTrailDoc (cognitive 30) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:525 — trail-yaml.normalizeTrailDoc has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 9, ternaries 6 (9 pts), loops 1 (nesting depth added 8). Of this number, 24 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.
D2 · Cognitive Complexity · perf-extract.buildSteps (cognitive 30) · ×1
  • perf-extract.buildSteps (cognitive 30) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:630 — perf-extract.buildSteps has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 8, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KotlinSourceParser.stripAnnotationsAndWhitespace (cognitive 29) · ×1
  • KotlinSourceParser.stripAnnotationsAndWhitespace (cognitive 29) build-logic/src/main/kotlin/SelectorTsCodegen.kt:626 — KotlinSourceParser.stripAnnotationsAndWhitespace has cognitive complexity 29 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (8 pts), boolean chains 6, match/switch 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComposeSemanticTreeMapper.appendCompactNode (cognitive 29) · ×1
  • ComposeSemanticTreeMapper.appendCompactNode (cognitive 29) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeSemanticTreeMapper.kt:291 — ComposeSemanticTreeMapper.appendCompactNode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeHostYamlRunner.executeTrailSession (cognitive 29) · ×1
  • TrailblazeHostYamlRunner.executeTrailSession (cognitive 29) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:256 — TrailblazeHostYamlRunner.executeTrailSession has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 6 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorHelpersKt.buildStructuralMatch (cognitive 29) · ×1
  • TrailblazeNodeSelectorGeneratorHelpersKt.buildStructuralMatch (cognitive 29) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:384 — TrailblazeNodeSelectorGeneratorHelpersKt.buildStructuralMatch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 7, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · QuickJsToolHost.connect (cognitive 29) · ×1
  • QuickJsToolHost.connect (cognitive 29) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolHost.kt:627 — QuickJsToolHost.connect has cognitive complexity 29 (threshold 15). Drivers by points: error handling 10 (18 pts), if/else 6 (11 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerateReportEndpoint.register (cognitive 29) · ×1
  • GenerateReportEndpoint.register (cognitive 29) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/endpoints/GenerateReportEndpoint.kt:117 — GenerateReportEndpoint.register has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 2, match/switch 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · resolver.matchesAndroidAccessibility (cognitive 29) · ×1
  • resolver.matchesAndroidAccessibility (cognitive 29) REDACTED:335 — resolver.matchesAndroidAccessibility has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27 (29 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.
D2 · Cognitive Complexity · companion.CompanionDemoFiles (cognitive 29) · ×1
  • companion.CompanionDemoFiles (cognitive 29) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:389 — companion.CompanionDemoFiles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 413, a function literal at line 395, openFile, …). 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.
D2 · Cognitive Complexity · external-agents.AgentYamlPanel (cognitive 29) · ×1
  • external-agents.AgentYamlPanel (cognitive 29) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1641 — external-agents.AgentYamlPanel has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 9, if/else 2 (nesting depth added 8). Of this number, 22 points are the body's own statements and 7 belong to 4 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater.updateRail (cognitive 29) · ×1
  • run-report-theater.mountTheater.updateRail (cognitive 29) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:728 — run-report-theater.mountTheater.updateRail has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 6, if/else 6, loops 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 742, 763, 734, …). 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.
D2 · Cognitive Complexity · CliOutputFormattersKt.formatBlazeResultAgent (cognitive 28) · ×1
  • CliOutputFormattersKt.formatBlazeResultAgent (cognitive 28) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliOutputFormatters.kt:25 — CliOutputFormattersKt.formatBlazeResultAgent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 5, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CompileCommand.call (cognitive 28) · ×1
  • CompileCommand.call (cognitive 28) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CompileCommand.kt:106 — CompileCommand.call has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (21 pts), error handling 6, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HostOnDeviceRpcTrailblazeAgent.executeToolViaRpcUntraced (cognitive 28) · ×1
  • HostOnDeviceRpcTrailblazeAgent.executeToolViaRpcUntraced (cognitive 28) trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:869 — HostOnDeviceRpcTrailblazeAgent.executeToolViaRpcUntraced has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (6 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DaemonScriptedToolBundler.bundleAll (cognitive 28) · ×1
  • DaemonScriptedToolBundler.bundleAll (cognitive 28) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:102 — DaemonScriptedToolBundler.bundleAll has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaywrightScreenState.handleHiddenElements (cognitive 28) · ×1
  • PlaywrightScreenState.handleHiddenElements (cognitive 28) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:471 — PlaywrightScreenState.handleHiddenElements has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract-tool-defs.literalValueOf (cognitive 28) · ×1
  • extract-tool-defs.literalValueOf (cognitive 28) sdks/typescript/tools/extract-tool-defs.mjs:1006 — extract-tool-defs.literalValueOf has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data-extract.buildTrailTree (cognitive 28) · ×1
  • data-extract.buildTrailTree (cognitive 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-extract.tsx:172 — data-extract.buildTrailTree has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (9 pts), loops 3, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (trailRow, ensureNode, renderEntry, …). 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.
D2 · Cognitive Complexity · demonstrate.useTrailheadPicker (cognitive 28) · ×1
  • demonstrate.useTrailheadPicker (cognitive 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:18 — demonstrate.useTrailheadPicker has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 16, if/else 9, ternaries 3. Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 53, 39, 58, …). 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.
D2 · Cognitive Complexity · external-agents.ExternalAgentChat · ×1
  • external-agents.ExternalAgentChat::proposeAtPoint (cognitive 28) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:345 — external-agents.ExternalAgentChat::proposeAtPoint has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts), ternaries 4 (5 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. This shape REPEATS in the file: one other method here (external-agents.ExternalAgentChat) 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.
D2 · Cognitive Complexity · run-report-extract.mergeWebHierarchyBounds (cognitive 28) · ×1
  • run-report-extract.mergeWebHierarchyBounds (cognitive 28) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:447 — run-report-extract.mergeWebHierarchyBounds has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 9, ternaries 6. Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 5 function items inside it that branch (compatible, legacyRect, graft, …). 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.
D2 · Cognitive Complexity · ResolvedTargetReportEmitter.renderAvailabilityMatrix (cognitive 27) · ×1
  • ResolvedTargetReportEmitter.renderAvailabilityMatrix (cognitive 27) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:537 — ResolvedTargetReportEmitter.renderAvailabilityMatrix has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 6 (11 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DeviceApiEndpointKt.launchLegacyPollingSubscription (cognitive 27) · ×1
  • DeviceApiEndpointKt.launchLegacyPollingSubscription (cognitive 27) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:441 — DeviceApiEndpointKt.launchLegacyPollingSubscription has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 6 (8 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlazeRoutesKt.blazeRoutes (cognitive 27) · ×1
  • BlazeRoutesKt.blazeRoutes (cognitive 27) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/BlazeRoutes.kt:31 — BlazeRoutesKt.blazeRoutes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, boolean chains 7, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GenerateTestResultsCliCommand.generateToolUsageReport (cognitive 27) · ×1
  • GenerateTestResultsCliCommand.generateToolUsageReport (cognitive 27) trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:838 — GenerateTestResultsCliCommand.generateToolUsageReport has cognitive complexity 27 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 5 (9 pts), match/switch 1 (3 pts) (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.
D2 · Cognitive Complexity · parse.networkFromRows (cognitive 27) · ×1
  • parse.networkFromRows (cognitive 27) sdks/typescript/src/surveys/parse.ts:152 — parse.networkFromRows has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 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.
D2 · Cognitive Complexity · android_ensureAppCompiled.parseDexoptState (cognitive 27) · ×1
  • android_ensureAppCompiled.parseDexoptState (cognitive 27) trailblaze-common/src/commonMain/resources/trails/config/trailmaps/android/tools/android_ensureAppCompiled.ts:125 — android_ensureAppCompiled.parseDexoptState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · live-device-stream.openLiveDeviceStream.startFallback (cognitive 27) · ×1
  • live-device-stream.openLiveDeviceStream.startFallback (cognitive 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:372 — live-device-stream.openLiveDeviceStream.startFallback has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 6, error handling 2 (6 pts), loops 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.
D2 · Cognitive Complexity · companion.deriveCompanionDirectives (cognitive 27) · ×1
  • companion.deriveCompanionDirectives (cognitive 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:27 — companion.deriveCompanionDirectives has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, ternaries 3, error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 4 function items inside it that branch (entry, str, items, …). 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.
D2 · Cognitive Complexity · companion.CompanionGuidance (cognitive 27) · ×1
  • companion.CompanionGuidance (cognitive 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:87 — companion.CompanionGuidance has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 25, if/else 2. Of this number, 23 points are the body's own statements and 4 belong to 3 function literals 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.
D2 · Cognitive Complexity · external-agents.Collapsible (cognitive 27) · ×1
  • external-agents.Collapsible (cognitive 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:77 — external-agents.Collapsible has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 16 (23 pts), boolean chains 3, if/else 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · record.ElementsPanel (cognitive 27) · ×1
  • record.ElementsPanel (cognitive 27) REDACTED:2474 — record.ElementsPanel has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 9, if/else 2 (nesting depth added 3). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2494, 2504, 2503). 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.
D2 · Cognitive Complexity · run-report-html.buildMultiReportHtml (cognitive 27) · ×1
  • run-report-html.buildMultiReportHtml (cognitive 27) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-html.ts:42 — run-report-html.buildMultiReportHtml has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 8, if/else 4 (5 pts) (nesting depth added 4). Of this number, 14 points are the body's own statements and 13 belong to 5 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.
D2 · Cognitive Complexity · run-report-summary-model.captureNoticesLane (cognitive 27) · ×1
  • run-report-summary-model.captureNoticesLane (cognitive 27) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1186 — run-report-summary-model.captureNoticesLane has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 5 (13 pts), loops 4 (7 pts), if/else 3 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary.mountSummary.openMenu (cognitive 27) · ×1
  • run-report-summary.mountSummary.openMenu (cognitive 27) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1378 — run-report-summary.mountSummary.openMenu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 1430, a function literal at line 1448, outside, …). 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.
D2 · Cognitive Complexity · openLiveDeviceStream.startFallback (cognitive 27) · ×1
  • openLiveDeviceStream.startFallback (cognitive 27) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/live-device-stream.js:372 — openLiveDeviceStream.startFallback has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 6, error handling 2 (6 pts), loops 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.
D2 · Cognitive Complexity · IosVideoCapture.stop (cognitive 26) · ×1
  • IosVideoCapture.stop (cognitive 26) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/IosVideoCapture.kt:452 — IosVideoCapture.stop has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniqueParentStrategy.findAllWithContext (cognitive 26) · ×1
  • UniqueParentStrategy.findAllWithContext (cognitive 26) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/UniqueParentStrategy.kt:28 — UniqueParentStrategy.findAllWithContext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReportCommand.call (cognitive 26) · ×1
  • ReportCommand.call (cognitive 26) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportCommand.kt:349 — ReportCommand.call has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 12, error handling 1, match/switch 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.
D2 · Cognitive Complexity · UsagesCommand.printHumanReadable (cognitive 26) · ×1
  • UsagesCommand.printHumanReadable (cognitive 26) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/UsagesCommand.kt:643 — UsagesCommand.printHumanReadable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry (cognitive 26) · ×1
  • TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry (cognitive 26) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/TrailblazeMcpServer.kt:1776 — TrailblazeMcpServer.addToolsAsMcpToolsFromRegistry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, error handling 2, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · labels.runLabelPhases (cognitive 26) · ×1
  • labels.runLabelPhases (cognitive 26) sdks/typescript/src/surveys/labels.ts:121 — labels.runLabelPhases has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (8 pts), loops 4 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 12). Of this number, 15 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · runcommand.buildRunCommand (cognitive 26) · ×1
  • runcommand.buildRunCommand (cognitive 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runcommand.tsx:24 — runcommand.buildRunCommand has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, boolean chains 5, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · external-agents.AgentComposer · ×1
  • external-agents.AgentComposer::send (cognitive 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1154 — external-agents.AgentComposer::send has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, ternaries 4 (5 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. This shape REPEATS in the file: one other method here (external-agents.AgentComposer) 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.
D2 · Cognitive Complexity · external-agents.AgentEventLogRow (cognitive 26) · ×1
  • external-agents.AgentEventLogRow (cognitive 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2706 — external-agents.AgentEventLogRow has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, ternaries 4 (6 pts), if/else 2 (3 pts) (nesting depth added 3). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · home.ExternalAgentPromptPanel (cognitive 26) · ×1
  • home.ExternalAgentPromptPanel (cognitive 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx:45 — home.ExternalAgentPromptPanel has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 15, ternaries 7, if/else 4. Of this number, 21 points are the body's own statements and 5 belong to 4 function literals 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.
D2 · Cognitive Complexity · tools.ToolUsedBy (cognitive 26) · ×1
  • tools.ToolUsedBy (cognitive 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:280 — tools.ToolUsedBy has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, ternaries 3 (5 pts), if/else 3 (4 pts) (nesting depth added 3). Of this number, 15 points are the body's own statements and 11 belong to 6 function literals 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.
D2 · Cognitive Complexity · run-report-compare-model.toDisplayPair (cognitive 26) · ×1
  • run-report-compare-model.toDisplayPair (cognitive 26) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1012 — run-report-compare-model.toDisplayPair has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 9). Of this number, 19 points are the body's own statements and 7 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.
D2 · Cognitive Complexity · unifiedDocToMatrix (cognitive 26) · ×1
  • unifiedDocToMatrix (cognitive 26) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:57 — unifiedDocToMatrix has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, ternaries 9, if/else 4. Of this number, 13 points are the body's own statements and 13 belong to 6 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.
D2 · Cognitive Complexity · KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph (cognitive 25) · ×1
  • KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph (cognitive 25) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mcp/agent/KoogStrategyGraphHostRunner.kt:70 — KoogStrategyGraphHostRunnerKt.runPromptsWithKoogStrategyGraph has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 4 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SurveySourceText.scan (cognitive 25) · ×1
  • SurveySourceText.scan (cognitive 25) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/surveys/SurveySourceText.kt:109 — SurveySourceText.scan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScrollUntilTextIsVisibleTrailblazeTool.scrollUntilVisibleWithStartPosition (cognitive 25) · ×1
  • ScrollUntilTextIsVisibleTrailblazeTool.scrollUntilVisibleWithStartPosition (cognitive 25) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/ScrollUntilTextIsVisibleTrailblazeTool.kt:151 — ScrollUntilTextIsVisibleTrailblazeTool.scrollUntilVisibleWithStartPosition has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostOnDeviceRpcTrailblazeAgent.executeTool (cognitive 25) · ×1
  • HostOnDeviceRpcTrailblazeAgent.executeTool (cognitive 25) trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:607 — HostOnDeviceRpcTrailblazeAgent.executeTool has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 2 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RevylHostDriverDescriptor.runRevylYaml (cognitive 25) · ×1
  • RevylHostDriverDescriptor.runRevylYaml (cognitive 25) trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:149 — RevylHostDriverDescriptor.runRevylYaml has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (16 pts), error handling 5 (6 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorAndroidViewKt.androidViewStrategies (cognitive 25) · ×1
  • TrailblazeNodeSelectorGeneratorAndroidViewKt.androidViewStrategies (cognitive 25) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:21 — TrailblazeNodeSelectorGeneratorAndroidViewKt.androidViewStrategies has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailblazeNodeSelectorResolver.matchesAndroidAccessibility (cognitive 25) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidAccessibility (cognitive 25) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:369 — TrailblazeNodeSelectorResolver.matchesAndroidAccessibility has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. 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. This shape REPEATS in the file: one other method here (TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView) 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.
D2 · Cognitive Complexity · TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView (cognitive 25) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView (cognitive 25) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:433 — TrailblazeNodeSelectorResolver.matchesAndroidAccessibilityAgainstView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. 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. This shape REPEATS in the file: one other method here (TrailblazeNodeSelectorResolver.matchesAndroidAccessibility) 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.
D2 · Cognitive Complexity · ConfigToolSet.handleSet (cognitive 25) · ×1
  • ConfigToolSet.handleSet (cognitive 25) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ConfigToolSet.kt:101 — ConfigToolSet.handleSet has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · live-plan.planReads.readFor (cognitive 25) · ×1
  • live-plan.planReads.readFor (cognitive 25) sdks/typescript/src/surveys/live-plan.ts:49 — live-plan.planReads.readFor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
D2 · Cognitive Complexity · discover.discoverSessions · ×1
  • discover.discoverSessions::walk (cognitive 25) sdks/typescript/src/surveys/discover.ts:99 — discover.discoverSessions::walk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · waypoint-graph-template.html.MapView (cognitive 25) · ×1
  • waypoint-graph-template.html.MapView (cognitive 25) trailblaze-host/src/main/resources/xyz/block/trailblaze/graph/waypoint-graph-template.html:1606 — waypoint-graph-template.html.MapView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 10, ternaries 2. None of this is in the body itself: all 25 points belong to 9 function literals inside it that branch (lines 1712, 1628, 1644, …). 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.
D2 · Cognitive Complexity · external-agents.agentToolMeta (cognitive 25) · ×1
  • external-agents.agentToolMeta (cognitive 25) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2226 — external-agents.agentToolMeta has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, ternaries 3, 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.
D2 · Cognitive Complexity · run-report-extract.slimLlmForShare (cognitive 25) · ×1
  • run-report-extract.slimLlmForShare (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1761 — run-report-extract.slimLlmForShare has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 19, ternaries 6. Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1762, 1786). 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.
D2 · Cognitive Complexity · perf-extract.buildTraceSpans (cognitive 25) · ×1
  • perf-extract.buildTraceSpans (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:363 — perf-extract.buildTraceSpans has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13, boolean chains 11, if/else 1. None of this is in the body itself: all 25 points belong to 2 function literals inside it that branch (lines 372, 388). 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.
D2 · Cognitive Complexity · run-report-playback.buildPlaybackSchedule (cognitive 25) · ×1
  • run-report-playback.buildPlaybackSchedule (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-playback.ts:79 — run-report-playback.buildPlaybackSchedule has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 5 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 9 belong to 3 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.
D2 · Cognitive Complexity · run-report-strings-frames.grabClipFrames (cognitive 25) · ×1
  • run-report-strings-frames.grabClipFrames (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-strings-frames.ts:44 — run-report-strings-frames.grabClipFrames has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), ternaries 2 (3 pts), boolean chains 2, error handling 2 (nesting depth added 7). Of this number, 24 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · run-report-summary.mountSummary.onClick (cognitive 25) · ×1
  • run-report-summary.mountSummary.onClick (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1534 — run-report-summary.mountSummary.onClick has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-shell.analysisProblem (cognitive 25) · ×1
  • run-report-shell.analysisProblem (cognitive 25) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:405 — run-report-shell.analysisProblem has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 18, if/else 4, 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.
D2 · Cognitive Complexity · CaptureSession.fromOptions (cognitive 24) · ×1
  • CaptureSession.fromOptions (cognitive 24) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/CaptureSession.kt:266 — CaptureSession.fromOptions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MemoryCapture.workerLoop (cognitive 24) · ×1
  • MemoryCapture.workerLoop (cognitive 24) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/memory/MemoryCapture.kt:196 — MemoryCapture.workerLoop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AndroidPackageDump.dexoptState (cognitive 24) · ×1
  • AndroidPackageDump.dexoptState (cognitive 24) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/device/AndroidPackageDump.kt:139 — AndroidPackageDump.dexoptState has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaestroLaunchArgumentRedactionKt.scrubKnownValues (cognitive 24) · ×1
  • MaestroLaunchArgumentRedactionKt.scrubKnownValues (cognitive 24) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:138 — MaestroLaunchArgumentRedactionKt.scrubKnownValues has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CheckCommand.runTrailLintPhase (cognitive 24) · ×1
  • CheckCommand.runTrailLintPhase (cognitive 24) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:1009 — CheckCommand.runTrailLintPhase has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 2, error handling 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CliInfrastructureKt.cliTryStartDaemon (cognitive 24) · ×1
  • CliInfrastructureKt.cliTryStartDaemon (cognitive 24) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:2561 — CliInfrastructureKt.cliTryStartDaemon has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2, match/switch 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailCommand.executeTrailAndCollectResults (cognitive 24) · ×1
  • TrailCommand.executeTrailAndCollectResults (cognitive 24) REDACTED:2117 — TrailCommand.executeTrailAndCollectResults has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, match/switch 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory.createMemory (cognitive 24) · ×1
  • memory.createMemory (cognitive 24) sdks/typescript/src/memory.ts:171 — memory.createMemory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 4 (5 pts), boolean chains 1, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 314, get, lookupToken, …). 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.
D2 · Cognitive Complexity · session.loadScreenTextFile (cognitive 24) · ×1
  • session.loadScreenTextFile (cognitive 24) sdks/typescript/src/surveys/session.ts:530 — session.loadScreenTextFile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveSessionReader.drainFiltered (cognitive 24) · ×1
  • LiveSessionReader.drainFiltered (cognitive 24) sdks/typescript/src/surveys/live.ts:305 — LiveSessionReader.drainFiltered has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 10). Of this number, 23 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · zip-report.ZipReportScreen (cognitive 24) · ×1
  • zip-report.ZipReportScreen (cognitive 24) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/zip-report.tsx:14 — zip-report.ZipReportScreen has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), error handling 3, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (load, revokeObjectUrls, a function literal at line 30, …). 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.
D2 · Cognitive Complexity · run-report-compare-model.eventSummary (cognitive 24) · ×1
  • run-report-compare-model.eventSummary (cognitive 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:974 — run-report-compare-model.eventSummary has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 7, boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 5 function items inside it that branch (walk, a function literal at line 1001, crop, …). 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.
D2 · Cognitive Complexity · run-report-compare-model.compareEventStreamsByStep (cognitive 24) · ×1
  • run-report-compare-model.compareEventStreamsByStep (cognitive 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1366 — run-report-compare-model.compareEventStreamsByStep has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, loops 1 (2 pts), ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 1392, a function literal at line 1378, a function literal at line 1422, …). 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.
D2 · Cognitive Complexity · run-report-selectors.selectorSuggestionsHtml · ×1
  • run-report-selectors.selectorSuggestionsHtml::card (cognitive 24) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-selectors.ts:130 — run-report-selectors.selectorSuggestionsHtml::card has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 12 (20 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.
D2 · Cognitive Complexity · GenerateAndroidTrailJUnitShellsTask.generate (cognitive 23) · ×1
  • GenerateAndroidTrailJUnitShellsTask.generate (cognitive 23) trailblaze-android-gradle/src/main/kotlin/TrailblazeAndroidGradlePlugin.kt:825 — GenerateAndroidTrailJUnitShellsTask.generate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AndroidTrailblazeRule.runFromAssets (cognitive 23) · ×1
  • AndroidTrailblazeRule.runFromAssets (cognitive 23) trailblaze-android/src/main/java/xyz/block/trailblaze/android/AndroidTrailblazeRule.kt:1413 — AndroidTrailblazeRule.runFromAssets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, loops 1, match/switch 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.
D2 · Cognitive Complexity · EventStreamScanner.contains (cognitive 23) · ×1
  • EventStreamScanner.contains (cognitive 23) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/events/EventStreamScanner.kt:323 — EventStreamScanner.contains has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SurveySourceText.callArgumentsAt (cognitive 23) · ×1
  • SurveySourceText.callArgumentsAt (cognitive 23) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/surveys/SurveySourceText.kt:26 — SurveySourceText.callArgumentsAt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (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.
D2 · Cognitive Complexity · TapTrailblazeTool.toExecutableTrailblazeTools (cognitive 23) · ×1
  • TapTrailblazeTool.toExecutableTrailblazeTools (cognitive 23) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/TapTrailblazeTool.kt:44 — TapTrailblazeTool.toExecutableTrailblazeTools has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, error handling 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliMcpClient.connectToDevice (cognitive 23) · ×1
  • CliMcpClient.connectToDevice (cognitive 23) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliMcpClient.kt:769 — CliMcpClient.connectToDevice has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigCommand.showAllConfig (cognitive 23) · ×1
  • ConfigCommand.showAllConfig (cognitive 23) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ConfigCommand.kt:103 — ConfigCommand.showAllConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSaveCommand.call (cognitive 23) · ×1
  • SessionSaveCommand.call (cognitive 23) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1295 — SessionSaveCommand.call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ToolYamlBuilder.appendYamlList (cognitive 23) · ×1
  • ToolYamlBuilder.appendYamlList (cognitive 23) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolYamlBuilder.kt:34 — ToolYamlBuilder.appendYamlList has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 3 (11 pts), if/else 5 (7 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PlaywrightAriaSnapshot.buildCompactElementList (cognitive 23) · ×1
  • PlaywrightAriaSnapshot.buildCompactElementList (cognitive 23) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:860 — PlaywrightAriaSnapshot.buildCompactElementList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaywrightNativeRequireTextInViewportTool.executeWithPlaywright (cognitive 23) · ×1
  • PlaywrightNativeRequireTextInViewportTool.executeWithPlaywright (cognitive 23) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeTextEvidenceTools.kt:33 — PlaywrightNativeRequireTextInViewportTool.executeWithPlaywright has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (5 pts), loops 2 (3 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.
D2 · Cognitive Complexity · SessionSummary.fromLogs (cognitive 23) · ×1
  • SessionSummary.fromLogs (cognitive 23) trailblaze-report/src/main/java/xyz/block/trailblaze/report/models/SessionSummary.kt:65 — SessionSummary.fromLogs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 4 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runcommand.applyYamlOverrides (cognitive 23) · ×1
  • runcommand.applyYamlOverrides (cognitive 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runcommand.tsx:60 — runcommand.applyYamlOverrides has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · external-agents.AgentConversationColumn (cognitive 23) · ×1
  • external-agents.AgentConversationColumn (cognitive 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:623 — external-agents.AgentConversationColumn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, boolean chains 8, ternaries 4 (5 pts) (nesting depth added 1). Of this number, 12 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · external-agents.AgentSkillsPanel (cognitive 23) · ×1
  • external-agents.AgentSkillsPanel (cognitive 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1466 — external-agents.AgentSkillsPanel has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 18, if/else 4, ternaries 1. Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 1473, 1484, 1482, …). 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.
D2 · Cognitive Complexity · external-agents.AgentRecordStage (cognitive 23) · ×1
  • external-agents.AgentRecordStage (cognitive 23) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2770 — external-agents.AgentRecordStage has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 16 (42 pts), boolean chains 40, if/else 19 (24 pts), error handling 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. This shape REPEATS in the file: one other method here (external-agents.AgentRecordStage::onStagePointerUp) 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.
D2 · Cognitive Complexity · run-report-cli.readAttachments (cognitive 23) · ×1
  • run-report-cli.readAttachments (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:586 — run-report-cli.readAttachments has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 1 (2 pts), loops 2, boolean chains 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.
D2 · Cognitive Complexity · run-report-cli.main (cognitive 23) · ×1
  • run-report-cli.main (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:928 — run-report-cli.main has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 6, if/else 3 (5 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 971, 961, 946, …). 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.
D2 · Cognitive Complexity · run-report-extract.summarizeToolArgs (cognitive 23) · ×1
  • run-report-extract.summarizeToolArgs (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1541 — run-report-extract.summarizeToolArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 2 (3 pts) (nesting depth added 3). Of this number, 19 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · run-report-inspector.nodeBounds (cognitive 23) · ×1
  • run-report-inspector.nodeBounds (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:63 — run-report-inspector.nodeBounds has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (10 pts), ternaries 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · run-report-trail-model.cellFromGroups (cognitive 23) · ×1
  • run-report-trail-model.cellFromGroups (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-model.ts:249 — run-report-trail-model.cellFromGroups has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), ternaries 5 (6 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary-model.layoutBand (cognitive 23) · ×1
  • run-report-summary-model.layoutBand (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:2026 — run-report-summary-model.layoutBand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 6 (11 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater.applySnapshot (cognitive 23) · ×1
  • run-report-theater.mountTheater.applySnapshot (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:949 — run-report-theater.mountTheater.applySnapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 5). Of this number, 20 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.
D2 · Cognitive Complexity · run-report-summary.mountSummary.entryRows (cognitive 23) · ×1
  • run-report-summary.mountSummary.entryRows (cognitive 23) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:891 — run-report-summary.mountSummary.entryRows has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (5 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 7). Of this number, 22 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.
D2 · Cognitive Complexity · collectTrailblazeAliases (cognitive 23) · ×1
  • collectTrailblazeAliases (cognitive 23) sdks/typescript/tools/extract-tool-defs.mjs:597 — collectTrailblazeAliases has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), other 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeviceTimedFlvMuxer.write (cognitive 22) · ×1
  • DeviceTimedFlvMuxer.write (cognitive 22) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/DeviceTimedFlvMuxer.kt:126 — DeviceTimedFlvMuxer.write has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 8, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NextMoveDecisionLlmClient.decide (cognitive 22) · ×1
  • NextMoveDecisionLlmClient.decide (cognitive 22) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/decision/NextMoveDecisionLlmClient.kt:179 — NextMoveDecisionLlmClient.decide has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NextMoveDecisionLlmClient.treePath (cognitive 22) · ×1
  • NextMoveDecisionLlmClient.treePath (cognitive 22) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/decision/NextMoveDecisionLlmClient.kt:573 — NextMoveDecisionLlmClient.treePath has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, match/switch 5 (9 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MaestroYamlSerializer.toPrimitive (cognitive 22) · ×1
  • MaestroYamlSerializer.toPrimitive (cognitive 22) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroYamlSerializer.kt:198 — MaestroYamlSerializer.toPrimitive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ParentChildSelectorFinder.findMostSpecificChildSelector (cognitive 22) · ×1
  • ParentChildSelectorFinder.findMostSpecificChildSelector (cognitive 22) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/search/ParentChildSelectorFinder.kt:198 — ParentChildSelectorFinder.findMostSpecificChildSelector has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailmapUnitTestRunner.run (cognitive 22) · ×1
  • TrailmapUnitTestRunner.run (cognitive 22) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/TrailmapUnitTestRunner.kt:62 — TrailmapUnitTestRunner.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExternalAgentSupervisorKt.parseClaudeEvent (cognitive 22) · ×1
  • ExternalAgentSupervisorKt.parseClaudeEvent (cognitive 22) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentSupervisor.kt:2929 — ExternalAgentSupervisorKt.parseClaudeEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 3 (5 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ToolSourceFiles.buildIndex (cognitive 22) · ×1
  • ToolSourceFiles.buildIndex (cognitive 22) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogBuilder.kt:121 — ToolSourceFiles.buildIndex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IosCompactElementList.isSystemUi (cognitive 22) · ×1
  • IosCompactElementList.isSystemUi (cognitive 22) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:391 — IosCompactElementList.isSystemUi has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AndroidAccessibility.description (cognitive 22) · ×1
  • AndroidAccessibility.description (cognitive 22) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:320 — AndroidAccessibility.description has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailArgBinder.bind (cognitive 22) · ×1
  • TrailArgBinder.bind (cognitive 22) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailArgBinder.kt:55 — TrailArgBinder.bind has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (8 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StoryboardHtmlBuilder.buildSections (cognitive 22) · ×1
  • StoryboardHtmlBuilder.buildSections (cognitive 22) trailblaze-report/src/main/java/xyz/block/trailblaze/report/StoryboardHtmlBuilder.kt:405 — StoryboardHtmlBuilder.buildSections has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jsKt.translateQuoteSections (cognitive 22) · ×1
  • jsKt.translateQuoteSections (cognitive 22) trailblaze-selector-engine-js/src/jsMain/kotlin/xyz/block/trailblaze/api/SelectorPatternRegex.js.kt:86 — jsKt.translateQuoteSections has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StepToolSet.parseAndValidateDirectTools (cognitive 22) · ×1
  • StepToolSet.parseAndValidateDirectTools (cognitive 22) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:678 — StepToolSet.parseAndValidateDirectTools has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.main (cognitive 22) · ×1
  • cli.main (cognitive 22) sdks/typescript/src/surveys/snapshot/cli.ts:48 — cli.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 6 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 3). Of this number, 21 points are the body's own statements and 1 belongs 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · companion.CompanionReplies (cognitive 22) · ×1
  • companion.CompanionReplies (cognitive 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:284 — companion.CompanionReplies has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, if/else 6, ternaries 2. Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (post, a function literal at line 328, flash, …). 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.
D2 · Cognitive Complexity · external-agents.AgentTrailRail (cognitive 22) · ×1
  • external-agents.AgentTrailRail (cognitive 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1391 — external-agents.AgentTrailRail has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, if/else 4, ternaries 3. Of this number, 14 points are the body's own statements and 8 belong to 4 function literals 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.
D2 · Cognitive Complexity · steps-board.variantClassifier (cognitive 22) · ×1
  • steps-board.variantClassifier (cognitive 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:49 — steps-board.variantClassifier has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps-board.scaffoldArgs (cognitive 22) · ×1
  • steps-board.scaffoldArgs (cognitive 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:177 — steps-board.scaffoldArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, error handling 2 (3 pts), loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 7 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.
D2 · Cognitive Complexity · share-export.ShareRunModal (cognitive 22) · ×1
  • share-export.ShareRunModal (cognitive 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/share-export.tsx:42 — share-export.ShareRunModal has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 5 (6 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 53, fmtSize, a function literal at line 68, …). 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.
D2 · Cognitive Complexity · shell.CommandPalette (cognitive 22) · ×1
  • shell.CommandPalette (cognitive 22) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:511 — shell.CommandPalette has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 16, if/else 4 (5 pts), ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (section, onKeyDown, match, …). 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.
D2 · Cognitive Complexity · run-report-events.derivedStreamStatus (cognitive 22) · ×1
  • run-report-events.derivedStreamStatus (cognitive 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:564 — run-report-events.derivedStreamStatus has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 7, if/else 3 (4 pts), error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary-model.llmNote (cognitive 22) · ×1
  • run-report-summary-model.llmNote (cognitive 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:431 — run-report-summary-model.llmNote has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 9, boolean chains 3 (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · run-report-theater-model.buildTheaterStory.addAction (cognitive 22) · ×1
  • run-report-theater-model.buildTheaterStory.addAction (cognitive 22) REDACTED:476 — run-report-theater-model.buildTheaterStory.addAction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 3, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · run-report-theater-model.yamlSegments · ×1
  • run-report-theater-model.yamlSegments::scalar (cognitive 22) REDACTED:1022 — run-report-theater-model.yamlSegments::scalar has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (8 pts), loops 1 (2 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.
D2 · Cognitive Complexity · run-report-summary.mountSummary.onWindowKeyDown (cognitive 22) · ×1
  • run-report-summary.mountSummary.onWindowKeyDown (cognitive 22) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1723 — run-report-summary.mountSummary.onWindowKeyDown has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AccessibilityServiceExtKt.toTreeNode (cognitive 21) · ×1
  • AccessibilityServiceExtKt.toTreeNode (cognitive 21) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityServiceExt.kt:11 — AccessibilityServiceExtKt.toTreeNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailblazeCompiler.collectUnresolvedReferences (cognitive 21) · ×1
  • TrailblazeCompiler.collectUnresolvedReferences (cognitive 21) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/compile/TrailblazeCompiler.kt:330 — TrailblazeCompiler.collectUnresolvedReferences has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaestroLaunchArgumentRedactionKt.redactLaunches (cognitive 21) · ×1
  • MaestroLaunchArgumentRedactionKt.redactLaunches (cognitive 21) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:187 — MaestroLaunchArgumentRedactionKt.redactLaunches has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 6, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TapOnByElementSelector.execute (cognitive 21) · ×1
  • TapOnByElementSelector.execute (cognitive 21) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/TapOnByElementSelector.kt:78 — TapOnByElementSelector.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · ConfigCommand.showLlmConfig (cognitive 21) · ×1
  • ConfigCommand.showLlmConfig (cognitive 21) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ConfigCommand.kt:275 — ConfigCommand.showLlmConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SkillStatusCommand.call (cognitive 21) · ×1
  • SkillStatusCommand.call (cognitive 21) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SkillCommand.kt:637 — SkillStatusCommand.call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SurveyCommand.call (cognitive 21) · ×1
  • SurveyCommand.call (cognitive 21) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SurveyCommand.kt:98 — SurveyCommand.call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ToolboxCommand.call (cognitive 21) · ×1
  • ToolboxCommand.call (cognitive 21) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxCommand.kt:124 — ToolboxCommand.call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DesktopYamlRunner.runHostAgentWithOnDeviceRpc (cognitive 21) · ×1
  • DesktopYamlRunner.runHostAgentWithOnDeviceRpc (cognitive 21) trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/DesktopYamlRunner.kt:2229 — DesktopYamlRunner.runHostAgentWithOnDeviceRpc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, match/switch 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DaemonScriptedToolBundler.discoverScriptedToolDescriptors (cognitive 21) · ×1
  • DaemonScriptedToolBundler.discoverScriptedToolDescriptors (cognitive 21) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:250 — DaemonScriptedToolBundler.discoverScriptedToolDescriptors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 4 (7 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorComposeKt.composeStrategies (cognitive 21) · ×1
  • TrailblazeNodeSelectorGeneratorComposeKt.composeStrategies (cognitive 21) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorCompose.kt:9 — TrailblazeNodeSelectorGeneratorComposeKt.composeStrategies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ScriptedToolArgTypeCoercionKt.coerceValueToSchema (cognitive 21) · ×1
  • ScriptedToolArgTypeCoercionKt.coerceValueToSchema (cognitive 21) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/toolcalls/ScriptedToolArgTypeCoercion.kt:115 — ScriptedToolArgTypeCoercionKt.coerceValueToSchema has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PlaywrightNativeAssertNetworkEventTool.executeWithPlaywright (cognitive 21) · ×1
  • PlaywrightNativeAssertNetworkEventTool.executeWithPlaywright (cognitive 21) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/tools/PlaywrightNativeAssertNetworkEventTool.kt:40 — PlaywrightNativeAssertNetworkEventTool.executeWithPlaywright has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerateTestResultsCliCommand.run (cognitive 21) · ×1
  • GenerateTestResultsCliCommand.run (cognitive 21) trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:192 — GenerateTestResultsCliCommand.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, error handling 1 (2 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory.attachMemoryDeltaToResult (cognitive 21) · ×1
  • memory.attachMemoryDeltaToResult (cognitive 21) sdks/typescript/src/memory.ts:393 — memory.attachMemoryDeltaToResult has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context.fromMeta (cognitive 21) · ×1
  • context.fromMeta (cognitive 21) sdks/typescript/src/context.ts:333 — context.fromMeta has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · context.parseTarget (cognitive 21) · ×1
  • context.parseTarget (cognitive 21) sdks/typescript/src/context.ts:443 — context.parseTarget has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 6, if/else 5. Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (resolveBaseUrl, resolveAppId). 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.
D2 · Cognitive Complexity · resolver.matchesIosMaestroAgainstAxe (cognitive 21) · ×1
  • resolver.matchesIosMaestroAgainstAxe (cognitive 21) REDACTED:653 — resolver.matchesIosMaestroAgainstAxe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · match.matchLog (cognitive 21) · ×1
  • match.matchLog (cognitive 21) sdks/typescript/src/surveys/match.ts:302 — match.matchLog has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveSessionReader.build (cognitive 21) · ×1
  • LiveSessionReader.build (cognitive 21) sdks/typescript/src/surveys/live.ts:351 — LiveSessionReader.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (6 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). Of this number, 15 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.
D2 · Cognitive Complexity · editor.ToolDocPopover (cognitive 21) · ×1
  • editor.ToolDocPopover (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:350 — editor.ToolDocPopover has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (7 pts), if/else 5 (nesting depth added 2). Of this number, 14 points are the body's own statements and 7 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.
D2 · Cognitive Complexity · demonstrate.DemoVerifiedPanel (cognitive 21) · ×1
  • demonstrate.DemoVerifiedPanel (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:771 — demonstrate.DemoVerifiedPanel has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 19, if/else 2. Of this number, 14 points are the body's own statements and 7 belong to 3 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.
D2 · Cognitive Complexity · device-console.useDeviceActivity (cognitive 21) · ×1
  • device-console.useDeviceActivity (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:632 — device-console.useDeviceActivity has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 700, 670, 654, …). 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.
D2 · Cognitive Complexity · external-agents.AgentRecordStage · ×1
  • external-agents.AgentRecordStage::onStagePointerUp (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2828 — external-agents.AgentRecordStage::onStagePointerUp has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5 (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. This shape REPEATS in the file: one other method here (external-agents.AgentRecordStage) 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.
D2 · Cognitive Complexity · record.relevantTools (cognitive 21) · ×1
  • record.relevantTools (cognitive 21) REDACTED:86 — record.relevantTools has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 8, if/else 3 (nesting depth added 6). Of this number, 15 points are the body's own statements and 6 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.
D2 · Cognitive Complexity · sessions.SessionRow (cognitive 21) · ×1
  • sessions.SessionRow (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:716 — sessions.SessionRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 7, if/else 1 (nesting depth added 1). 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, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · trail-detail.UnifiedStepsBoard · ×1
  • trail-detail.UnifiedStepsBoard::renderRow (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:400 — trail-detail.UnifiedStepsBoard::renderRow has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, ternaries 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · trail-detail.LegacyStepsRunList (cognitive 21) · ×1
  • trail-detail.LegacyStepsRunList (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:642 — trail-detail.LegacyStepsRunList has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts), if/else 5 (nesting depth added 1). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 671, a function literal at line 645, a function literal at line 653, …). 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.
D2 · Cognitive Complexity · trailmaps.ComponentOverview (cognitive 21) · ×1
  • trailmaps.ComponentOverview (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:409 — trailmaps.ComponentOverview has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 5, if/else 2 (nesting depth added 4). Of this number, 12 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · run-report-extract.driverActionsAfterTheirTool (cognitive 21) · ×1
  • run-report-extract.driverActionsAfterTheirTool (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:261 — run-report-extract.driverActionsAfterTheirTool has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 20 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · run-report-extract.actionMark (cognitive 21) · ×1
  • run-report-extract.actionMark (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1112 — run-report-extract.actionMark has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 4 (7 pts) (nesting depth added 4). Of this number, 19 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.
D2 · Cognitive Complexity · run-report-extract.parseLlmResponse (cognitive 21) · ×1
  • run-report-extract.parseLlmResponse (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1149 — run-report-extract.parseLlmResponse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-device-frames.frameKindFor (cognitive 21) · ×1
  • run-report-device-frames.frameKindFor (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-device-frames.ts:21 — run-report-device-frames.frameKindFor has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (7 pts), if/else 4 (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.
D2 · Cognitive Complexity · run-report-trail-model.pickLastFrame (cognitive 21) · ×1
  • run-report-trail-model.pickLastFrame (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-model.ts:179 — run-report-trail-model.pickLastFrame has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 10). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary-model.rowNote (cognitive 21) · ×1
  • run-report-summary-model.rowNote (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:882 — run-report-summary-model.rowNote has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 5, if/else 2 (3 pts) (nesting depth added 6). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 894, 887). 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.
D2 · Cognitive Complexity · run-report-theater.mountTheater.paintMirror (cognitive 21) · ×1
  • run-report-theater.mountTheater.paintMirror (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:398 — run-report-theater.mountTheater.paintMirror has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 6, boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · zip-report-core.sessionDisplayName (cognitive 21) · ×1
  • zip-report-core.sessionDisplayName (cognitive 21) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:435 — zip-report-core.sessionDisplayName has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 6, ternaries 2 (3 pts) (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.
D2 · Cognitive Complexity · dispatchRuns (cognitive 21) · ×1
  • dispatchRuns (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-fanout.js:237 — dispatchRuns has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 249, a function literal at line 245, (anonymous)::failed, …). 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.
D2 · Cognitive Complexity · buildTargetGroups (cognitive 21) · ×1
  • buildTargetGroups (cognitive 21) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/target-picker-model.js:12 — buildTargetGroups has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 36, 58, 22, …). 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.
D2 · Cognitive Complexity · McpProxy.run (cognitive 20) · ×1
  • McpProxy.run (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/McpProxy.kt:270 — McpProxy.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaywrightInstallWaiter.awaitReady (cognitive 20) · ×1
  • PlaywrightInstallWaiter.awaitReady (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/PlaywrightInstallWaiter.kt:74 — PlaywrightInstallWaiter.awaitReady 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.
D2 · Cognitive Complexity · StepCommand.call (cognitive 20) · ×1
  • StepCommand.call (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/StepCommand.kt:132 — StepCommand.call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailCommand.expandTrailFiles (cognitive 20) · ×1
  • TrailCommand.expandTrailFiles (cognitive 20) REDACTED:3958 — TrailCommand.expandTrailFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 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.
D2 · Cognitive Complexity · WindowsCallerShell.isThrowawayCmd (cognitive 20) · ×1
  • WindowsCallerShell.isThrowawayCmd (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WindowsCallerShell.kt:80 — WindowsCallerShell.isThrowawayCmd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnDeviceRpcMemoryProbe.readWithin (cognitive 20) · ×1
  • OnDeviceRpcMemoryProbe.readWithin (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/host/capture/OnDeviceRpcMemoryProbe.kt:80 — OnDeviceRpcMemoryProbe.readWithin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiDeviceConfigurationResolver.selectConfigurationName (cognitive 20) · ×1
  • MultiDeviceConfigurationResolver.selectConfigurationName (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/host/yaml/MultiDeviceConfigurationResolver.kt:397 — MultiDeviceConfigurationResolver.selectConfigurationName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 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.
D2 · Cognitive Complexity · CompanionRoutesKt.companionRoutes (cognitive 20) · ×1
  • CompanionRoutesKt.companionRoutes (cognitive 20) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/CompanionRoutes.kt:31 — CompanionRoutesKt.companionRoutes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailblazeNodeSelectorResolver.matchesCompose (cognitive 20) · ×1
  • TrailblazeNodeSelectorResolver.matchesCompose (cognitive 20) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:749 — TrailblazeNodeSelectorResolver.matchesCompose has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ViewHierarchyFilter.filterOccludedElements (cognitive 20) · ×1
  • ViewHierarchyFilter.filterOccludedElements (cognitive 20) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/ViewHierarchyFilter.kt:184 — ViewHierarchyFilter.filterOccludedElements has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaywrightAriaSnapshot.parseAriaLines (cognitive 20) · ×1
  • PlaywrightAriaSnapshot.parseAriaLines (cognitive 20) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:575 — PlaywrightAriaSnapshot.parseAriaLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliExecEndpoint.register (cognitive 20) · ×1
  • CliExecEndpoint.register (cognitive 20) trailblaze-server/src/main/java/xyz/block/trailblaze/logs/server/endpoints/CliExecEndpoint.kt:211 — CliExecEndpoint.register has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeviceManagerToolSet.bindNamedDevice (cognitive 20) · ×1
  • DeviceManagerToolSet.bindNamedDevice (cognitive 20) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:468 — DeviceManagerToolSet.bindNamedDevice has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DeviceManagerToolSet.connectAndReplaceSessionDevice (cognitive 20) · ×1
  • DeviceManagerToolSet.connectAndReplaceSessionDevice (cognitive 20) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/DeviceManagerToolSet.kt:897 — DeviceManagerToolSet.connectAndReplaceSessionDevice has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LocalLlmSamplingSource.emitSamplingLog (cognitive 20) · ×1
  • LocalLlmSamplingSource.emitSamplingLog (cognitive 20) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:463 — LocalLlmSamplingSource.emitSamplingLog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · UnifiedTrailStepSerializer.deserialize (cognitive 20) · ×1
  • UnifiedTrailStepSerializer.deserialize (cognitive 20) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailStepSerializer.kt:41 — UnifiedTrailStepSerializer.deserialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolMapEntryRendererKt.renderToolMapEntry (cognitive 20) · ×1
  • ToolMapEntryRendererKt.renderToolMapEntry (cognitive 20) trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/ToolMapEntryRenderer.kt:94 — ToolMapEntryRendererKt.renderToolMapEntry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trailblaze-node.hitTest · ×1
  • trailblaze-node.hitTest::visit (cognitive 20) sdks/typescript/src/matcher/trailblaze-node.ts:234 — trailblaze-node.hitTest::visit has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · resolver.matchesCompose (cognitive 20) · ×1
  • resolver.matchesCompose (cognitive 20) REDACTED:461 — resolver.matchesCompose has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · parse.enrichFromInAppNetworkStreams (cognitive 20) · ×1
  • parse.enrichFromInAppNetworkStreams (cognitive 20) sdks/typescript/src/surveys/parse.ts:245 — parse.enrichFromInAppNetworkStreams has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · report.renderSession (cognitive 20) · ×1
  • report.renderSession (cognitive 20) sdks/typescript/src/surveys/report.ts:89 — report.renderSession has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (10 pts), loops 3 (5 pts), if/else 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · waypoints.loadYamlWaypoints (cognitive 20) · ×1
  • waypoints.loadYamlWaypoints (cognitive 20) REDACTED:527 — waypoints.loadYamlWaypoints has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-payload.collectAttachments (cognitive 20) · ×1
  • run-payload.collectAttachments (cognitive 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:320 — run-payload.collectAttachments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · run-payload.fetchReportEvents (cognitive 20) · ×1
  • run-payload.fetchReportEvents (cognitive 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:465 — run-payload.fetchReportEvents has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, ternaries 4, if/else 3, error handling 1. Of this number, 10 points are the body's own statements and 10 belong to 3 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.
D2 · Cognitive Complexity · external-agents.AgentTapeCard (cognitive 20) · ×1
  • external-agents.AgentTapeCard (cognitive 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2269 — external-agents.AgentTapeCard has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, ternaries 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · record.selectorRegexInfo (cognitive 20) · ×1
  • record.selectorRegexInfo (cognitive 20) REDACTED:2058 — record.selectorRegexInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, a function literal at line 2060). 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.
D2 · Cognitive Complexity · steps-board.ToolCallsPopover (cognitive 20) · ×1
  • steps-board.ToolCallsPopover (cognitive 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:249 — steps-board.ToolCallsPopover has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 36, if/else 12 (17 pts), ternaries 7 (10 pts), error handling 2 (4 pts), loops 1 (nesting depth added 10). 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. This shape REPEATS in the file: one other method here (steps-board.ToolCallsPopover::buildOut) 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.
D2 · Cognitive Complexity · tools.ToolSummary (cognitive 20) · ×1
  • tools.ToolSummary (cognitive 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:74 — tools.ToolSummary has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 4 (nesting depth added 6). Of this number, 13 points are the body's own statements and 7 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.
D2 · Cognitive Complexity · run-report-events.derivedLanes (cognitive 20) · ×1
  • run-report-events.derivedLanes (cognitive 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:532 — run-report-events.derivedLanes has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 5, if/else 2, error handling 1, loops 1 (nesting depth added 5). Of this number, 19 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.
D2 · Cognitive Complexity · run-report-payload.jsonToYaml (cognitive 20) · ×1
  • run-report-payload.jsonToYaml (cognitive 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:275 — run-report-payload.jsonToYaml has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 20 points belong to 5 function items inside it that branch (append, a function literal at line 299, scalar, …). 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.
D2 · Cognitive Complexity · run-report-compare-model.pickGroupPath (cognitive 20) · ×1
  • run-report-compare-model.pickGroupPath (cognitive 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:565 — run-report-compare-model.pickGroupPath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 3 (6 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 589, 575). 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.
D2 · Cognitive Complexity · run-report-summary-model.readArgsYaml · ×1
  • run-report-summary-model.readArgsYaml::block (cognitive 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:521 — run-report-summary-model.readArgsYaml::block has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary.mountSummary.paintPreview (cognitive 20) · ×1
  • run-report-summary.mountSummary.paintPreview (cognitive 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:758 — run-report-summary.mountSummary.paintPreview has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · sessionEventStreams (cognitive 20) · ×1
  • sessionEventStreams (cognitive 20) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:685 — sessionEventStreams has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 17 function items inside it that branch (readStream, a function literal at line 725, a function literal at line 749, …). 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.
D2 · Cognitive Complexity · withSourceLabels (cognitive 20) · ×1
  • withSourceLabels (cognitive 20) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:419 — withSourceLabels has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 433, 424, 429). 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.
D2 · Cognitive Complexity · ScriptedToolSchemaRefFlattener.percentDecode (cognitive 19) · ×1
  • ScriptedToolSchemaRefFlattener.percentDecode (cognitive 19) trailblaze-common/src/commonMain/kotlin/xyz/block/trailblaze/scripting/ScriptedToolSchemaRefFlattener.kt:154 — ScriptedToolSchemaRefFlattener.percentDecode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionCleanups.runAll (cognitive 19) · ×1
  • SessionCleanups.runAll (cognitive 19) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/SessionCleanups.kt:89 — SessionCleanups.runAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 4 (8 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelectorQueryEngine.pollLive (cognitive 19) · ×1
  • SelectorQueryEngine.pollLive (cognitive 19) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/SelectorQueryEngine.kt:184 — SelectorQueryEngine.pollLive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TeardownTrailblazeTool.execute (cognitive 19) · ×1
  • TeardownTrailblazeTool.execute (cognitive 19) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/trailhead/TeardownTrailblazeTool.kt:55 — TeardownTrailblazeTool.execute has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 6 (8 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelectorSuggestCommandKt.suggest (cognitive 19) · ×1
  • SelectorSuggestCommandKt.suggest (cognitive 19) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorSuggestCommand.kt:454 — SelectorSuggestCommandKt.suggest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailLabelWriter.configLayout (cognitive 19) · ×1
  • TrailLabelWriter.configLayout (cognitive 19) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailLabelWriter.kt:99 — TrailLabelWriter.configLayout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 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.
D2 · Cognitive Complexity · HostScriptedToolLauncher.launch (cognitive 19) · ×1
  • HostScriptedToolLauncher.launch (cognitive 19) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:161 — HostScriptedToolLauncher.launch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BundleStore.writeFile (cognitive 19) · ×1
  • BundleStore.writeFile (cognitive 19) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/BundleStore.kt:137 — BundleStore.writeFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExternalAgentSupervisor.runProcess (cognitive 19) · ×1
  • ExternalAgentSupervisor.runProcess (cognitive 19) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentSupervisor.kt:1752 — ExternalAgentSupervisor.runProcess has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · IosAxeCompactElementList.walk (cognitive 19) · ×1
  • IosAxeCompactElementList.walk (cognitive 19) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosAxeCompactElementList.kt:79 — IosAxeCompactElementList.walk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PlaywrightTrailblazeAgentKt.cssUnescape (cognitive 19) · ×1
  • PlaywrightTrailblazeAgentKt.cssUnescape (cognitive 19) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:765 — PlaywrightTrailblazeAgentKt.cssUnescape has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuickJsToolBundleLauncher.launchAll (cognitive 19) · ×1
  • QuickJsToolBundleLauncher.launchAll (cognitive 19) trailblaze-quickjs-tools/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/quickjs/tools/QuickJsToolBundleLauncher.kt:166 — QuickJsToolBundleLauncher.launchAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 2, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionToolSet.handleStop (cognitive 19) · ×1
  • SessionToolSet.handleStop (cognitive 19) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:249 — SessionToolSet.handleStop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailMcpTool.handleRun (cognitive 19) · ×1
  • TrailMcpTool.handleRun (cognitive 19) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:322 — TrailMcpTool.handleRun has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailMcpTool.handleEditClearRecording (cognitive 19) · ×1
  • TrailMcpTool.handleEditClearRecording (cognitive 19) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:802 — TrailMcpTool.handleEditClearRecording has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (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.
D2 · Cognitive Complexity · McpSamplingClient.extractBalancedJson (cognitive 19) · ×1
  • McpSamplingClient.extractBalancedJson (cognitive 19) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/McpSamplingClient.kt:289 — McpSamplingClient.extractBalancedJson has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stored.merged (cognitive 19) · ×1
  • stored.merged (cognitive 19) sdks/typescript/src/surveys/stored.ts:238 — stored.merged has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). Of this number, 17 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · extract-tool-defs.unreadableSpecGates (cognitive 19) · ×1
  • extract-tool-defs.unreadableSpecGates (cognitive 19) sdks/typescript/tools/extract-tool-defs.mjs:918 — extract-tool-defs.unreadableSpecGates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · editor.TrailEditor (cognitive 19) · ×1
  • editor.TrailEditor (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:189 — editor.TrailEditor has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, ternaries 2. Of this number, 12 points are the body's own statements and 7 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.
D2 · Cognitive Complexity · run-payload.fetchDerivedStreams (cognitive 19) · ×1
  • run-payload.fetchDerivedStreams (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:427 — run-payload.fetchDerivedStreams has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), error handling 2 (3 pts), ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · device-activity-model.slimLog (cognitive 19) · ×1
  • device-activity-model.slimLog (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-activity-model.js:55 — device-activity-model.slimLog has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 15, if/else 2 (3 pts), match/switch 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals 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.
D2 · Cognitive Complexity · external-agents.groupPlumbingRuns (cognitive 19) · ×1
  • external-agents.groupPlumbingRuns (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1907 — external-agents.groupPlumbingRuns has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 8. None of this is in the body itself: all 19 points belong to 6 function items inside it that branch (failSig, a function literal at line 1932, pinned, …). 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.
D2 · Cognitive Complexity · integrations.IntegrationsScreen (cognitive 19) · ×1
  • integrations.IntegrationsScreen (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/integrations.tsx:76 — integrations.IntegrationsScreen has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (9 pts) (nesting depth added 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.
D2 · Cognitive Complexity · steps-board.ToolCallsPopover · ×1
  • steps-board.ToolCallsPopover::buildOut (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:282 — steps-board.ToolCallsPopover::buildOut has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (4 pts), boolean chains 3, error handling 1 (3 pts), 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 (steps-board.ToolCallsPopover) 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.
D2 · Cognitive Complexity · trail-yaml.buildRecordedTrailYaml (cognitive 19) · ×1
  • trail-yaml.buildRecordedTrailYaml (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:58 — trail-yaml.buildRecordedTrailYaml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 4 (7 pts), boolean chains 4, loops 1 (nesting depth added 6). Of this number, 18 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.
D2 · Cognitive Complexity · ui.HoverTip (cognitive 19) · ×1
  • ui.HoverTip (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:884 — ui.HoverTip has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8 (nesting depth added 3). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 892, show). 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.
D2 · Cognitive Complexity · run-report-cli.readEvents (cognitive 19) · ×1
  • run-report-cli.readEvents (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:512 — run-report-cli.readEvents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), error handling 2, boolean chains 1, ternaries 1 (nesting depth added 6). Of this number, 15 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.
D2 · Cognitive Complexity · perf-viewer.PERF_VIEWER (cognitive 19) · ×1
  • perf-viewer.PERF_VIEWER (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:126 — perf-viewer.PERF_VIEWER has cognitive complexity 19 (threshold 15). Drivers by points: if/else 98 (131 pts), ternaries 51 (82 pts), boolean chains 64, loops 8 (13 pts), error handling 3 (nesting depth added 69). To reduce it, split the body into named stages: move each independent 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: 2 other methods here (perf-viewer.PERF_VIEWER::drawBlock, perf-viewer.PERF_VIEWER::renderInspector) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D2 · Cognitive Complexity · run-report-clip-player.parseWebm · ×1
  • run-report-clip-player.parseWebm::walk (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:149 — run-report-clip-player.parseWebm::walk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-compare-model.pickGroupPathMany (cognitive 19) · ×1
  • run-report-compare-model.pickGroupPathMany (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:612 — run-report-compare-model.pickGroupPathMany has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 3 (6 pts), boolean chains 5 (nesting depth added 3). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 631, 619). 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.
D2 · Cognitive Complexity · run-report-playback.buildExportSchedule (cognitive 19) · ×1
  • run-report-playback.buildExportSchedule (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-playback.ts:119 — run-report-playback.buildExportSchedule has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 9 belong to 3 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.
D2 · Cognitive Complexity · run-report-summary-model.firstBranch (cognitive 19) · ×1
  • run-report-summary-model.firstBranch (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:280 — run-report-summary-model.firstBranch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary-model.eventDetail (cognitive 19) · ×1
  • run-report-summary-model.eventDetail (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:853 — run-report-summary-model.eventDetail has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 5, if/else 3 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary.mountSummary.cardHtml (cognitive 19) · ×1
  • run-report-summary.mountSummary.cardHtml (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:931 — run-report-summary.mountSummary.cardHtml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 3 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · buildSessionInputsFromZipBytes (cognitive 19) · ×1
  • buildSessionInputsFromZipBytes (cognitive 19) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:967 — buildSessionInputsFromZipBytes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 3 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 999, 1027, 996, …). 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.
D2 · Cognitive Complexity · mountLsp · ×1
  • mountLsp::build (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:520 — mountLsp::build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 3, if/else 3, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · logicalLegs (cognitive 19) · ×1
  • logicalLegs (cognitive 19) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-model.js:243 — logicalLegs has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 3 (5 pts) (nesting depth added 2). Of this number, 13 points are the body's own statements and 6 belong to 6 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.
D2 · Cognitive Complexity · KotlinSourceParser.parseParams (cognitive 18) · ×1
  • KotlinSourceParser.parseParams (cognitive 18) build-logic/src/main/kotlin/SelectorTsCodegen.kt:488 — KotlinSourceParser.parseParams has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckCommand.runTypecheckPhase (cognitive 18) · ×1
  • CheckCommand.runTypecheckPhase (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:1388 — CheckCommand.runTypecheckPhase has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, error handling 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CliOutputFormattersKt.formatVerifyResultAgent (cognitive 18) · ×1
  • CliOutputFormattersKt.formatVerifyResultAgent (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliOutputFormatters.kt:329 — CliOutputFormattersKt.formatVerifyResultAgent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · CliReportGenerator.generateMarkdownReport (cognitive 18) · ×1
  • CliReportGenerator.generateMarkdownReport (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:229 — CliReportGenerator.generateMarkdownReport has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionInfoCommand.call (cognitive 18) · ×1
  • SessionInfoCommand.call (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1545 — SessionInfoCommand.call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, error handling 3, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ToolboxCommand.formatTargetResult (cognitive 18) · ×1
  • ToolboxCommand.formatTargetResult (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolboxCommand.kt:533 — ToolboxCommand.formatTargetResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailCommand.resolveLlmModel (cognitive 18) · ×1
  • TrailCommand.resolveLlmModel (cognitive 18) REDACTED:1893 — TrailCommand.resolveLlmModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 1 (4 pts), loops 1 (3 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · IosDriverTrailRunner.runActions (cognitive 18) · ×1
  • IosDriverTrailRunner.runActions (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/IosDriverTrailRunner.kt:64 — IosDriverTrailRunner.runActions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolCatalogCache.workspaceToolFingerprint (cognitive 18) · ×1
  • ToolCatalogCache.workspaceToolFingerprint (cognitive 18) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ToolCatalogCache.kt:52 — ToolCatalogCache.workspaceToolFingerprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.namedStructuralAndroidAccessibilityStrategies (cognitive 18) · ×1
  • TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.namedStructuralAndroidAccessibilityStrategies (cognitive 18) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:283 — TrailblazeNodeSelectorGeneratorAndroidAccessibilityKt.namedStructuralAndroidAccessibilityStrategies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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.
D2 · Cognitive Complexity · TrailblazeNodeSelectorGeneratorIosAxeKt.iosAxeStrategies (cognitive 18) · ×1
  • TrailblazeNodeSelectorGeneratorIosAxeKt.iosAxeStrategies (cognitive 18) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorIosAxe.kt:12 — TrailblazeNodeSelectorGeneratorIosAxeKt.iosAxeStrategies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ViewHierarchyHitTester.hitTestRecursive (cognitive 18) · ×1
  • ViewHierarchyHitTester.hitTestRecursive (cognitive 18) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/recording/ViewHierarchyHitTester.kt:21 — ViewHierarchyHitTester.hitTestRecursive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SerialDescriptorTsCodegen.renderType (cognitive 18) · ×1
  • SerialDescriptorTsCodegen.renderType (cognitive 18) trailblaze-models/src/jvmMain/kotlin/xyz/block/trailblaze/codegen/SerialDescriptorTsCodegen.kt:304 — SerialDescriptorTsCodegen.renderType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BridgeUiActionExecutor.extractContextLabels (cognitive 18) · ×1
  • BridgeUiActionExecutor.extractContextLabels (cognitive 18) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:598 — BridgeUiActionExecutor.extractContextLabels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SessionToolSet.handleLogcat (cognitive 18) · ×1
  • SessionToolSet.handleLogcat (cognitive 18) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:795 — SessionToolSet.handleLogcat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · stored.sessionInputs · ×1
  • stored.sessionInputs::walk (cognitive 18) sdks/typescript/src/surveys/stored.ts:172 — stored.sessionInputs::walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 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.
D2 · Cognitive Complexity · data-hooks.useSessions (cognitive 18) · ×1
  • data-hooks.useSessions (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-hooks.tsx:191 — data-hooks.useSessions has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, ternaries 2, if/else 1. Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 204, 192). 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.
D2 · Cognitive Complexity · run-payload.readBodyWithinLimit (cognitive 18) · ×1
  • run-payload.readBodyWithinLimit (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:235 — run-payload.readBodyWithinLimit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runconfig-steps.RunStepsPane (cognitive 18) · ×1
  • runconfig-steps.RunStepsPane (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig-steps.tsx:223 — runconfig-steps.RunStepsPane has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 18. Of this number, 16 points are the body's own statements and 2 belong to 4 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.
D2 · Cognitive Complexity · follow-run-model.decide (cognitive 18) · ×1
  • follow-run-model.decide (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/follow-run-model.js:24 — follow-run-model.decide has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · record.selectorMeta (cognitive 18) · ×1
  • record.selectorMeta (cognitive 18) REDACTED:43 — record.selectorMeta has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · record.bestSelectorObj (cognitive 18) · ×1
  • record.bestSelectorObj (cognitive 18) REDACTED:131 — record.bestSelectorObj has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trace-viewer.SaveBackBanner (cognitive 18) · ×1
  • trace-viewer.SaveBackBanner (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:47 — trace-viewer.SaveBackBanner has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trail-detail.TrailDetailView (cognitive 18) · ×1
  • trail-detail.TrailDetailView (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:956 — trail-detail.TrailDetailView has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, ternaries 3, if/else 1. 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · trailmaps.ComponentDetail (cognitive 18) · ×1
  • trailmaps.ComponentDetail (cognitive 18) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:269 — trailmaps.ComponentDetail has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 6, if/else 3 (nesting depth added 2). Of this number, 11 points are the body's own statements and 7 belong to 4 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.
D2 · Cognitive Complexity · run-report-events.clampRow (cognitive 18) · ×1
  • run-report-events.clampRow (cognitive 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:332 — run-report-events.clampRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · run-report-compare-model.highlightSpans (cognitive 18) · ×1
  • run-report-compare-model.highlightSpans (cognitive 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:178 — run-report-compare-model.highlightSpans has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, loops 4, if/else 2, ternaries 1. 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · run-report-trace-model.rowPhase (cognitive 18) · ×1
  • run-report-trace-model.rowPhase (cognitive 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trace-model.ts:101 — run-report-trace-model.rowPhase has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 5, if/else 3 (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · run-report-summary-model.toolReading (cognitive 18) · ×1
  • run-report-summary-model.toolReading (cognitive 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1065 — run-report-summary-model.toolReading has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · run-report-summary-model.visibleStringsLane.notes (cognitive 18) · ×1
  • run-report-summary-model.visibleStringsLane.notes (cognitive 18) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1417 — run-report-summary-model.visibleStringsLane.notes has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12 (14 pts), boolean chains 2, if/else 2 (nesting depth added 2). Of this number, 13 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · collectSdkNamedImportAliases (cognitive 18) · ×1
  • collectSdkNamedImportAliases (cognitive 18) sdks/typescript/tools/extract-tool-defs.mjs:635 — collectSdkNamedImportAliases has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1, other 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KotlinSourceParser.splitTopLevelCommas (cognitive 17) · ×1
  • KotlinSourceParser.splitTopLevelCommas (cognitive 17) build-logic/src/main/kotlin/SelectorTsCodegen.kt:656 — KotlinSourceParser.splitTopLevelCommas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · GetMemoryInfoRequestHandler.read (cognitive 17) · ×1
  • GetMemoryInfoRequestHandler.read (cognitive 17) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/handlers/GetMemoryInfoRequestHandler.kt:89 — GetMemoryInfoRequestHandler.read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailblazeAgentContextKt.logToolExecution (cognitive 17) · ×1
  • TrailblazeAgentContextKt.logToolExecution (cognitive 17) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:68 — TrailblazeAgentContextKt.logToolExecution has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OuterLoopAgent.run (cognitive 17) · ×1
  • OuterLoopAgent.run (cognitive 17) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/OuterLoopAgent.kt:85 — OuterLoopAgent.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (8 pts), loops 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.
D2 · Cognitive Complexity · BarcodeDecoder.tiles (cognitive 17) · ×1
  • BarcodeDecoder.tiles (cognitive 17) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/commands/barcode/BarcodeDecoder.kt:150 — BarcodeDecoder.tiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailheadRuns.checkLanding (cognitive 17) · ×1
  • TrailheadRuns.checkLanding (cognitive 17) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/trailhead/TrailheadRuns.kt:302 — TrailheadRuns.checkLanding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoopCommand.runAgain (cognitive 17) · ×1
  • LoopCommand.runAgain (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:379 — LoopCommand.runAgain has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ResultsShowCommand.prettyPrint (cognitive 17) · ×1
  • ResultsShowCommand.prettyPrint (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ResultsCommand.kt:625 — ResultsShowCommand.prettyPrint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SessionArtifactsCommand.call (cognitive 17) · ×1
  • SessionArtifactsCommand.call (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1019 — SessionArtifactsCommand.call has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, error handling 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ResolvedTargetReportEmitter.renderRuntimeRegistry (cognitive 17) · ×1
  • ResolvedTargetReportEmitter.renderRuntimeRegistry (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:385 — ResolvedTargetReportEmitter.renderRuntimeRegistry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AndroidBinaryXml.findAttributes (cognitive 17) · ×1
  • AndroidBinaryXml.findAttributes (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/AndroidBinaryXml.kt:216 — AndroidBinaryXml.findAttributes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExternalAgentRoutesKt.parseSkillFrontmatter (cognitive 17) · ×1
  • ExternalAgentRoutesKt.parseSkillFrontmatter (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/ExternalAgentRoutes.kt:556 — ExternalAgentRoutesKt.parseSkillFrontmatter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, match/switch 1 (2 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.
D2 · Cognitive Complexity · TrailblazeDeviceManager.getOrCreateSessionResolution (cognitive 17) · ×1
  • TrailblazeDeviceManager.getOrCreateSessionResolution (cognitive 17) trailblaze-host/src/main/java/xyz/block/trailblaze/ui/TrailblazeDeviceManager.kt:694 — TrailblazeDeviceManager.getOrCreateSessionResolution has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PlaywrightAriaSnapshot.forEachCorrelatableAiLine (cognitive 17) · ×1
  • PlaywrightAriaSnapshot.forEachCorrelatableAiLine (cognitive 17) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightAriaSnapshot.kt:491 — PlaywrightAriaSnapshot.forEachCorrelatableAiLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaywrightDriverManager.downloadAndExtractDriver (cognitive 17) · ×1
  • PlaywrightDriverManager.downloadAndExtractDriver (cognitive 17) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightDriverManager.kt:219 — PlaywrightDriverManager.downloadAndExtractDriver has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (8 pts), if/else 2 (6 pts), loops 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.
D2 · Cognitive Complexity · PlaywrightScreenState.enrichCompactElementList (cognitive 17) · ×1
  • PlaywrightScreenState.enrichCompactElementList (cognitive 17) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:812 — PlaywrightScreenState.enrichCompactElementList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StoryboardHtmlBuilder.labelFor (cognitive 17) · ×1
  • StoryboardHtmlBuilder.labelFor (cognitive 17) trailblaze-report/src/main/java/xyz/block/trailblaze/report/StoryboardHtmlBuilder.kt:536 — StoryboardHtmlBuilder.labelFor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TrailblazeMcpSessionContext.sendProgressInternal (cognitive 17) · ×1
  • TrailblazeMcpSessionContext.sendProgressInternal (cognitive 17) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpSessionContext.kt:894 — TrailblazeMcpSessionContext.sendProgressInternal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (5 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SessionToolSet.handleSave (cognitive 17) · ×1
  • SessionToolSet.handleSave (cognitive 17) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:356 — SessionToolSet.handleSave has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ToolDiscoveryToolSet.toolSetStanding (cognitive 17) · ×1
  • ToolDiscoveryToolSet.toolSetStanding (cognitive 17) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:479 — ToolDiscoveryToolSet.toolSetStanding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailFormatYaml.appendJsonElementAsYaml (cognitive 17) · ×1
  • TrailFormatYaml.appendJsonElementAsYaml (cognitive 17) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/TrailFormatYaml.kt:85 — TrailFormatYaml.appendJsonElementAsYaml has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · UnifiedTrailEmitter.appendScalar (cognitive 17) · ×1
  • UnifiedTrailEmitter.appendScalar (cognitive 17) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailEmitter.kt:245 — UnifiedTrailEmitter.appendScalar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceClientDtsGenerator.renderClientDts (cognitive 17) · ×1
  • WorkspaceClientDtsGenerator.renderClientDts (cognitive 17) trailblaze-trailmap-bundler/src/main/kotlin/xyz/block/trailblaze/bundle/WorkspaceClientDtsGenerator.kt:461 — WorkspaceClientDtsGenerator.renderClientDts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · waypoints.waypointFindings (cognitive 17) · ×1
  • waypoints.waypointFindings (cognitive 17) REDACTED:369 — waypoints.waypointFindings has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (5 pts), loops 1 (nesting depth added 8). Of this number, 13 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · cli-main.writeStreams (cognitive 17) · ×1
  • cli-main.writeStreams (cognitive 17) sdks/typescript/src/surveys/cli-main.ts:260 — cli-main.writeStreams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (5 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data-core.switchWorkspace (cognitive 17) · ×1
  • data-core.switchWorkspace (cognitive 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:484 — data-core.switchWorkspace has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 2 (3 pts), error handling 2, if/else 2 (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.
D2 · Cognitive Complexity · run-fanout.defaultDeviceIds (cognitive 17) · ×1
  • run-fanout.defaultDeviceIds (cognitive 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-fanout.js:102 — run-fanout.defaultDeviceIds has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 4, if/else 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · run-payload.normalizeSummary (cognitive 17) · ×1
  • run-payload.normalizeSummary (cognitive 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:124 — run-payload.normalizeSummary has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, 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.
D2 · Cognitive Complexity · companion.CompanionReviewAsk · ×1
  • companion.CompanionReviewAsk::send (cognitive 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:197 — companion.CompanionReviewAsk::send has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 2 (5 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. This shape REPEATS in the file: one other method here (companion.CompanionReviewAsk) 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.
D2 · Cognitive Complexity · external-agents.AgentNewConversationBody (cognitive 17) · ×1
  • external-agents.AgentNewConversationBody (cognitive 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:812 — external-agents.AgentNewConversationBody has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 3. Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 821, 828, 835, …). 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.
D2 · Cognitive Complexity · record.buildProposalToolYaml · ×1
  • record.buildProposalToolYaml::valueFor (cognitive 17) REDACTED:109 — record.buildProposalToolYaml::valueFor has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · trace-viewer.SaveAsTrailModal (cognitive 17) · ×1
  • trace-viewer.SaveAsTrailModal (cognitive 17) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:369 — trace-viewer.SaveAsTrailModal has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 4 (5 pts) (nesting depth added 1). Of this number, 10 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · run-report-warnings.runWarningsFromSurveys (cognitive 17) · ×1
  • run-report-warnings.runWarningsFromSurveys (cognitive 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts:26 — run-report-warnings.runWarningsFromSurveys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-payload.transcriptToolCallYaml (cognitive 17) · ×1
  • run-report-payload.transcriptToolCallYaml (cognitive 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts:323 — run-report-payload.transcriptToolCallYaml has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 2, error handling 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.
D2 · Cognitive Complexity · run-report-trail-model.buildTrailMatrix (cognitive 17) · ×1
  • run-report-trail-model.buildTrailMatrix (cognitive 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-model.ts:309 — run-report-trail-model.buildTrailMatrix has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 2 (4 pts), loops 1 (nesting depth added 5). Of this number, 12 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · run-report-trail-replay.alignReplayByStep (cognitive 17) · ×1
  • run-report-trail-replay.alignReplayByStep (cognitive 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:521 — run-report-trail-replay.alignReplayByStep has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5, boolean chains 4, if/else 2 (4 pts), loops 3 (4 pts) (nesting depth added 3). Of this number, 12 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · run-report-theater-model.actionLabel (cognitive 17) · ×1
  • run-report-theater-model.actionLabel (cognitive 17) REDACTED:280 — run-report-theater-model.actionLabel has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 7, if/else 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · run-report-theater.mountTheater.buildSteps (cognitive 17) · ×1
  • run-report-theater.mountTheater.buildSteps (cognitive 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:666 — run-report-theater.mountTheater.buildSteps has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4, loops 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 672). 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.
D2 · Cognitive Complexity · run-report-shell.RUN_REPORT_SHELL (cognitive 17) · ×1
  • run-report-shell.RUN_REPORT_SHELL (cognitive 17) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:771 — run-report-shell.RUN_REPORT_SHELL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 56 (71 pts), boolean chains 17, ternaries 7 (11 pts), error handling 7 (10 pts), loops 1 (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (run-report-shell.RUN_REPORT_SHELL::renderBytes) 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.
D2 · Cognitive Complexity · SelectorTsCodegen.formatTsDoc (cognitive 16) · ×1
  • SelectorTsCodegen.formatTsDoc (cognitive 16) build-logic/src/main/kotlin/SelectorTsCodegen.kt:183 — SelectorTsCodegen.formatTsDoc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), 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.
D2 · Cognitive Complexity · TrailmapTargetGenerator.buildExpectedTargets (cognitive 16) · ×1
  • TrailmapTargetGenerator.buildExpectedTargets (cognitive 16) build-logic/src/main/kotlin/TrailblazeBundledConfigTasks.kt:322 — TrailmapTargetGenerator.buildExpectedTargets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailblazeSdkDtsBundlePlugin.apply (cognitive 16) · ×1
  • TrailblazeSdkDtsBundlePlugin.apply (cognitive 16) build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:153 — TrailblazeSdkDtsBundlePlugin.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LiveFrameConsumer.pumpTeeIntoFfmpeg (cognitive 16) · ×1
  • LiveFrameConsumer.pumpTeeIntoFfmpeg (cognitive 16) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/LiveFrameConsumer.kt:278 — LiveFrameConsumer.pumpTeeIntoFfmpeg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 1 (3 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WallClockMuxConsumer.runDrainLoop (cognitive 16) · ×1
  • WallClockMuxConsumer.runDrainLoop (cognitive 16) trailblaze-capture/src/main/java/xyz/block/trailblaze/capture/video/WallClockMuxConsumer.kt:504 — WallClockMuxConsumer.runDrainLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (4 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AndroidDeviceLocale.apply (cognitive 16) · ×1
  • AndroidDeviceLocale.apply (cognitive 16) trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/AndroidDeviceLocale.kt:63 — AndroidDeviceLocale.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeCompiler.compile (cognitive 16) · ×1
  • TrailblazeCompiler.compile (cognitive 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/compile/TrailblazeCompiler.kt:161 — TrailblazeCompiler.compile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TrailDiscovery.runDiscoveryWalk (cognitive 16) · ×1
  • TrailDiscovery.runDiscoveryWalk (cognitive 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailDiscovery.kt:221 — TrailDiscovery.runDiscoveryWalk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 3, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MaestroYamlSerializer.createTapOnCommand (cognitive 16) · ×1
  • MaestroYamlSerializer.createTapOnCommand (cognitive 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroYamlSerializer.kt:136 — MaestroYamlSerializer.createTapOnCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ToolMemoryInterpolationKt.interpolateViaClassSerializer (cognitive 16) · ×1
  • ToolMemoryInterpolationKt.interpolateViaClassSerializer (cognitive 16) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolMemoryInterpolation.kt:377 — ToolMemoryInterpolationKt.interpolateViaClassSerializer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 4 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostAndroidDeviceConnectUtils.onInstrumentationOutputLine (cognitive 16) · ×1
  • HostAndroidDeviceConnectUtils.onInstrumentationOutputLine (cognitive 16) trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/HostAndroidDeviceConnectUtils.kt:703 — HostAndroidDeviceConnectUtils.onInstrumentationOutputLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReportVideoExporter.export (cognitive 16) · ×1
  • ReportVideoExporter.export (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportVideoExporter.kt:56 — ReportVideoExporter.export has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · SegmentListCommand.call (cognitive 16) · ×1
  • SegmentListCommand.call (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SegmentListCommand.kt:46 — SegmentListCommand.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), error handling 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SkillInstallCommand.call (cognitive 16) · ×1
  • SkillInstallCommand.call (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SkillCommand.kt:509 — SkillInstallCommand.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolCommand.call (cognitive 16) · ×1
  • ToolCommand.call (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ToolCommand.kt:107 — ToolCommand.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, error handling 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ResolvedTargetReportEmitter.renderResolutionTrace (cognitive 16) · ×1
  • ResolvedTargetReportEmitter.renderResolutionTrace (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:730 — ResolvedTargetReportEmitter.renderResolutionTrace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AxeDeviceManager.dispatch (cognitive 16) · ×1
  • AxeDeviceManager.dispatch (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/host/axe/AxeDeviceManager.kt:390 — AxeDeviceManager.dispatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PlaywrightNativeHostDriverDescriptor.runPlaywrightNativeYaml (cognitive 16) · ×1
  • PlaywrightNativeHostDriverDescriptor.runPlaywrightNativeYaml (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightNativeHostDriverDescriptor.kt:94 — PlaywrightNativeHostDriverDescriptor.runPlaywrightNativeYaml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DeviceApiEndpoint.register (cognitive 16) · ×1
  • DeviceApiEndpoint.register (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/DeviceApiEndpoint.kt:108 — DeviceApiEndpoint.register has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 2, match/switch 2, boolean chains 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InProcessShellPackager.collectSurveys (cognitive 16) · ×1
  • InProcessShellPackager.collectSurveys (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:607 — InProcessShellPackager.collectSurveys has cognitive complexity 16 (threshold 15). Drivers by points: error handling 1 (4 pts), if/else 2 (4 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeMcpBridgeImpl.getDriverConnectionStatus (cognitive 16) · ×1
  • TrailblazeMcpBridgeImpl.getDriverConnectionStatus (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:1989 — TrailblazeMcpBridgeImpl.getDriverConnectionStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DaemonScriptedToolBundler.bundleOneInternal (cognitive 16) · ×1
  • DaemonScriptedToolBundler.bundleOneInternal (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:428 — DaemonScriptedToolBundler.bundleOneInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, error handling 1, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailIndexBuilder.walk (cognitive 16) · ×1
  • TrailIndexBuilder.walk (cognitive 16) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailIndexBuilder.kt:147 — TrailIndexBuilder.walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrailblazeNode.hitTest (cognitive 16) · ×1
  • TrailblazeNode.hitTest (cognitive 16) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNode.kt:206 — TrailblazeNode.hitTest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · Compose.description (cognitive 16) · ×1
  • Compose.description (cognitive 16) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelector.kt:621 — Compose.description has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailblazeNodeSelectorResolver.matchesAndroidView (cognitive 16) · ×1
  • TrailblazeNodeSelectorResolver.matchesAndroidView (cognitive 16) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorResolver.kt:595 — TrailblazeNodeSelectorResolver.matchesAndroidView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PlaywrightScreenState.discoverHiddenCssTargetableElements (cognitive 16) · ×1
  • PlaywrightScreenState.discoverHiddenCssTargetableElements (cognitive 16) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:943 — PlaywrightScreenState.discoverHiddenCssTargetableElements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionEventsReader.readBoundedLine (cognitive 16) · ×1
  • SessionEventsReader.readBoundedLine (cognitive 16) trailblaze-report/src/main/java/xyz/block/trailblaze/report/utils/SessionEventsReader.kt:211 — SessionEventsReader.readBoundedLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · McpSubprocessSpawner.resolveFromClasspath (cognitive 16) · ×1
  • McpSubprocessSpawner.resolveFromClasspath (cognitive 16) trailblaze-scripting-subprocess/src/main/kotlin/xyz/block/trailblaze/scripting/subprocess/McpSubprocessSpawner.kt:127 — McpSubprocessSpawner.resolveFromClasspath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, error handling 2, loops 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogcatToolSet.logcat (cognitive 16) · ×1
  • LogcatToolSet.logcat (cognitive 16) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/LogcatToolSet.kt:82 — LogcatToolSet.logcat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StepToolSet.ask (cognitive 16) · ×1
  • StepToolSet.ask (cognitive 16) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/StepToolSet.kt:1007 — StepToolSet.ask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrailExecutorImpl.execute (cognitive 16) · ×1
  • TrailExecutorImpl.execute (cognitive 16) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:266 — TrailExecutorImpl.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (4 pts), error handling 1 (3 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · mitmproxy_netcapture.decide_body (cognitive 16) · ×1
  • mitmproxy_netcapture.decide_body (cognitive 16) trailblaze-host/src/main/resources/networkcapture/mitmproxy_netcapture.py:91 — mitmproxy_netcapture.decide_body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trailhead.attachTrailheadReportToResult (cognitive 16) · ×1
  • trailhead.attachTrailheadReportToResult (cognitive 16) sdks/typescript/src/trailhead.ts:192 — trailhead.attachTrailheadReportToResult has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.matchesAndroidView (cognitive 16) · ×1
  • resolver.matchesAndroidView (cognitive 16) REDACTED:397 — resolver.matchesAndroidView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · resolver.translateQuoteSections (cognitive 16) · ×1
  • resolver.translateQuoteSections (cognitive 16) REDACTED:957 — resolver.translateQuoteSections has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.loadScreenText (cognitive 16) · ×1
  • session.loadScreenText (cognitive 16) sdks/typescript/src/surveys/session.ts:510 — session.loadScreenText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stream.eventStream (cognitive 16) · ×1
  • stream.eventStream (cognitive 16) sdks/typescript/src/surveys/stream.ts:351 — stream.eventStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · report.renderMarkdown (cognitive 16) · ×1
  • report.renderMarkdown (cognitive 16) sdks/typescript/src/surveys/report.ts:28 — report.renderMarkdown has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (8 pts), loops 3 (4 pts), boolean chains 2, if/else 2 (nesting depth added 3). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · waypoints.screensOf (cognitive 16) · ×1
  • waypoints.screensOf (cognitive 16) REDACTED:250 — waypoints.screensOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 3, ternaries 1 (nesting depth added 3). Of this number, 10 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.
D2 · Cognitive Complexity · run-payload.collectShots (cognitive 16) · ×1
  • run-payload.collectShots (cognitive 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:282 — run-payload.collectShots has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 5 belong to 3 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.
D2 · Cognitive Complexity · blaze.BlazeScreen · ×1
  • blaze.BlazeScreen::blaze (cognitive 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx:89 — blaze.BlazeScreen::blaze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 1 (2 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. This shape REPEATS in the file: one other method here (blaze.BlazeScreen) 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.
D2 · Cognitive Complexity · companion.CompanionReviewAsk (cognitive 16) · ×1
  • companion.CompanionReviewAsk (cognitive 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:167 — companion.CompanionReviewAsk has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 25, if/else 13, ternaries 6 (9 pts) (nesting depth added 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. This shape REPEATS in the file: one other method here (companion.CompanionReviewAsk::send) 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.
D2 · Cognitive Complexity · external-agents.AgentPermissionBar (cognitive 16) · ×1
  • external-agents.AgentPermissionBar (cognitive 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:959 — external-agents.AgentPermissionBar has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 2. Of this number, 9 points are the body's own statements and 7 belong to 3 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.
D2 · Cognitive Complexity · external-agents.AgentDeviceEventLog (cognitive 16) · ×1
  • external-agents.AgentDeviceEventLog (cognitive 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2636 — external-agents.AgentDeviceEventLog has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4, ternaries 3. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 2645, 2637, 2643, …). 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.
D2 · Cognitive Complexity · record.parseTrailhead (cognitive 16) · ×1
  • record.parseTrailhead (cognitive 16) REDACTED:264 — record.parseTrailhead has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trail-yaml.parseRecordStepTools (cognitive 16) · ×1
  • trail-yaml.parseRecordStepTools (cognitive 16) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:24 — trail-yaml.parseRecordStepTools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-extract.captureEndTs (cognitive 16) · ×1
  • run-report-extract.captureEndTs (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:538 — run-report-extract.captureEndTs has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (5 pts), ternaries 2 (4 pts), loops 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.
D2 · Cognitive Complexity · run-report-compare-model.eventLines (cognitive 16) · ×1
  • run-report-compare-model.eventLines (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:906 — run-report-compare-model.eventLines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (emit, a function literal at line 918). 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.
D2 · Cognitive Complexity · run-report-perfetto.streamRowSizes (cognitive 16) · ×1
  • run-report-perfetto.streamRowSizes (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-perfetto.ts:180 — run-report-perfetto.streamRowSizes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 14 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.
D2 · Cognitive Complexity · run-report-summary-model.runIfCondition (cognitive 16) · ×1
  • run-report-summary-model.runIfCondition (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:724 — run-report-summary-model.runIfCondition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 5 (7 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary-model.eventLabel (cognitive 16) · ×1
  • run-report-summary-model.eventLabel (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:831 — run-report-summary-model.eventLabel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-report-summary-model.networkCallNote (cognitive 16) · ×1
  • run-report-summary-model.networkCallNote (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:959 — run-report-summary-model.networkCallNote has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), if/else 5, boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · run-report-shell.RUN_REPORT_SHELL · ×1
  • run-report-shell.RUN_REPORT_SHELL::renderBytes (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:854 — run-report-shell.RUN_REPORT_SHELL::renderBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1, loops 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. This shape REPEATS in the file: one other method here (run-report-shell.RUN_REPORT_SHELL) 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.
D2 · Cognitive Complexity · zip-report-core.sessionObjectUrls (cognitive 16) · ×1
  • zip-report-core.sessionObjectUrls (cognitive 16) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:888 — zip-report-core.sessionObjectUrls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 898, add, a function literal at line 902). 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (153 shared lines) · ×1
  • Near-duplicate member pair (153 shared lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:169 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:169-493 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:154-482 — These two members are variants of one another: 153 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (97 shared lines) · ×1
  • Near-duplicate member pair (97 shared lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:211 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:211-312 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:323-424 — These two members are variants of one another: 97 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (135 corresponding lines) · ×1
  • Edited copy of a member (135 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:121 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:121-255 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightNativeHostDriverDescriptor.kt:99-286 — These two members are one piece of code written twice and then edited apart: 135 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (86 corresponding lines) · ×1
  • Edited copy of a member (86 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:22 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:22-107 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/viewmatcher/strategies/SpatialHintsStrategy.kt:109-194 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:148 — trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:148-210 | trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:221-275 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:50 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:50-100 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:710-793 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:30 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/util/BufferedImageUtils.kt:30-75 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:2285-2332 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:539 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:539-627 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/recording/PlaywrightDeviceScreenStream.kt:639-694 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:113 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:113-170 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceTypeScriptSetup.kt:194-246 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:210 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:210-243 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:259-298 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:313-351 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:703 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:703-743 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailMcpTool.kt:749-800 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 49+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 49+ corresponding lines) build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:163 — build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:163-227 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:829-903 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:917-965 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:1001-1071 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 49 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidWriteFileToDownloadsTrailblazeTool.kt:58 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidWriteFileToDownloadsTrailblazeTool.kt:58-106 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidWriteImageToMediaStoreTrailblazeTool.kt:49-108 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportGifExporter.kt:48 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportGifExporter.kt:48-96 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/ReportWebpExporter.kt:81-125 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:1776 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:1776-1812 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:1823-1872 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:110 — trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:110-150 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightTrailblazeAgent.kt:204-243 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:158 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:158-186 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:188-216 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 41+ corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/ListInstalledAppsDetailedTrailblazeTool.kt:90 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/ListInstalledAppsDetailedTrailblazeTool.kt:90-133 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/ListInstalledAppsTrailblazeTool.kt:67-107 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/SetClipboardTrailblazeTool.kt:32-72 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/McpSamplingClient.kt:77 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/McpSamplingClient.kt:77-111 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/McpSamplingClient.kt:136-173 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidMaestro.kt:48 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidMaestro.kt:48-65 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidView.kt:162-184 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorIosMaestro.kt:112-129 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidForceStopTrailblazeTool.kt:36 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidForceStopTrailblazeTool.kt:36-65 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidGrantAppOpsPermissionTrailblazeTool.kt:74-102 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/mobile/tools/AndroidReconnectSessionTrailblazeTool.kt:52-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:438 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:438-450 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:453-464 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:467-478 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:578-590 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:481 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:481-495 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:523-536 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:545-558 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:561-575 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/agent/BridgeUiActionExecutor.kt:650-667 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:745 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:745-750 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:768-771 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/LoopCommand.kt:775-778 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:601 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:601-607 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:652-665 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:758-764 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapSurveyBundling.kt:164 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapSurveyBundling.kt:164-182 | trailblaze-android-gradle/src/main/kotlin/bundler/TrailblazeAuthorToolBundleTasks.kt:529-548 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:345 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/util/IosHostSimctlUtils.kt:345-347 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ios/SimctlCli.kt:374-377 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 4+ corresponding lines) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/BaseTrailblazeAgent.kt:499 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/BaseTrailblazeAgent.kt:499-502 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/TrailblazeAgentContext.kt:243-246 | trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolMemoryInterpolation.kt:323-326 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliExceptionHandlers.kt:64-67 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:791 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CheckCommand.kt:791-794 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/networkcapture/CompositeAndroidNetworkCaptureActivator.kt:83-86 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×1
  • Edited copy of a member (1 corresponding lines) trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:224 — trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/AccessibilityNode.kt:224-224 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNode.kt:87-87 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (72 lines × 2) · ×1
  • Duplicated block (72 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:241 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:241-312 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:353-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:187 — trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:187-255 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:194-262 — before extracting anything, compare `trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android-ondevice-mcp/src/main/java/xyz/block/trailblaze/mcp/progress/ProgressSessionManager.kt:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (53–55 lines × 2) · ×1
  • Duplicated block (53–55 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:397 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:397-451 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:392-444 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:397` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:281 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:281-319 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:284-323 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:281` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–37 lines × 2) · ×1
  • Duplicated block (30–37 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:351 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:351-387 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:353-382 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–34 lines × 3) · ×1
  • Duplicated block (30–34 lines × 3) build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:194 — build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:194-227 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:936-965 | build-logic/src/main/kotlin/TrailblazeSdkDtsBundlePlugin.kt:1042-1071 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `build-logic/src/main/kotlin/TrailblazeSdkBundlePlugin.kt:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:710 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:710-741 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:295-326 — before extracting anything, compare `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt` and `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:193 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:193-219 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightNativeHostDriverDescriptor.kt:224-250 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/playwright/PlaywrightElectronHostDriverDescriptor.kt:193` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:795 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:795-819 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:345-365 — before extracting anything, compare `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt` and `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:795` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:149 — trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:149-171 | trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:222-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:600 — trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:600-620 | trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:229-245 — before extracting anything, compare `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt` and `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:600` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightBrowserManager.kt:597` calls `addInitScript` and `trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightElectronBrowserManager.kt:227` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:676 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:676-695 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:702-719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:676` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:63 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:63-79 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosCompactElementList.kt:66-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/AndroidCompactElementList.kt:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:345 — trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:345-369 | trailblaze-host/src/main/java/xyz/block/trailblaze/inprocess/InProcessShellPackager.kt:698-719 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android-gradle/src/main/kotlin/TrailblazeTrailmapToolBundling.kt:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/AndroidViewHierarchyFilter.kt:15 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/AndroidViewHierarchyFilter.kt:15-32 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/IosViewHierarchyFilter.kt:23-40 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/WebViewHierarchyFilter.kt:24-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:166 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:166-183 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:77-93 — before extracting anything, compare `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1231 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1231-1247 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:435-451 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:428-444 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1230` calls `onProgressMessage` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:434` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:145 — trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:145-161 | trailblaze-trail-format/src/commonMain/kotlin/xyz/block/trailblaze/yaml/unified/UnifiedTrailAdapter.kt:385-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:188 — trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:188-207 | trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:254-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-android/src/main/java/xyz/block/trailblaze/setofmark/android/AndroidCanvasSetOfMark.kt:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) REDACTED:2700 — REDACTED:2700-2714 | REDACTED:2754-2769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2700` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) trailblaze-models/src/iosMain/kotlin/xyz/block/trailblaze/api/SelectorPatternRegex.ios.kt:14 — trailblaze-models/src/iosMain/kotlin/xyz/block/trailblaze/api/SelectorPatternRegex.ios.kt:14-28 | trailblaze-models/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/api/SelectorPatternRegex.jvmAndAndroid.kt:13-27 | trailblaze-models/src/wasmJsMain/kotlin/xyz/block/trailblaze/api/SelectorPatternRegex.wasmJs.kt:13-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:226 — trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/ComposeTrailblazeAgent.kt:226-238 | trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/rpc/ComposeRpcTrailblazeAgent.kt:286-300 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-compose/src/main/java/xyz/block/trailblaze/compose/driver/rpc/ComposeRpcTrailblazeAgent.kt:286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/DirectMcpAgent.kt:384 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/DirectMcpAgent.kt:384-396 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt:173-185 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt:85-96 — before extracting anything, compare `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ObservationToolSet.kt` and `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ViewHierarchyFormatter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/agent/DirectMcpAgent.kt:384` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–13 lines × 3) · ×1
  • Duplicated block (8–13 lines × 3) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:826 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:826-833 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:978-987 | trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/ScriptedToolDefinitionAnalyzer.kt:894-906 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:826` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1216 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1216-1228 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:422-434 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt:417-427 — before extracting anything, compare `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/revyl/RevylHostDriverDescriptor.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1216` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `trailblaze-host/src/main/java/xyz/block/trailblaze/host/TrailblazeHostYamlRunner.kt:1230` calls `onProgressMessage` and `trailblaze-host/src/main/java/xyz/block/trailblaze/host/compose/ComposeHostDriverDescriptor.kt:435` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:183 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:183-195 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:293-305 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:405-417 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/sampling/LocalLlmSamplingSource.kt:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/ConnectToDeviceHandler.kt:47 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/recording/rpc/ConnectToDeviceHandler.kt:47-59 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/RecordRoutes.kt:1145-1156 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (8–13 lines × 2) · ×1
  • Duplicated block (8–13 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:894 — trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:894-901 | trailblaze-scripting-subprocess/src/main/kotlin/xyz/block/trailblaze/scripting/subprocess/McpSubprocessSpawner.kt:218-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/HostScriptedToolLauncher.kt:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–12 lines × 2) · ×1
  • Duplicated block (6–12 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CompileCommand.kt:298 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CompileCommand.kt:298-309 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/WorkspaceCompileBootstrap.kt:373-378 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CompileCommand.kt:298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1039 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1039-1049 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1125-1135 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1479-1489 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SessionCommand.kt:1039` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/InstrumentationUtil.kt:364 — trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/InstrumentationUtil.kt:364-373 | trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/InstrumentationUtil.kt:376-385 | trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/InstrumentationUtil.kt:388-397 | trailblaze-common/src/androidMain/kotlin/xyz/block/trailblaze/InstrumentationUtil.kt:400-409 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:362 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:362-370 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:592-600 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:542-551 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:849-857 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7–10 lines × 3) · ×1
  • Duplicated block (7–10 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:928 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:928-937 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:977-983 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:1014-1020 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/HostOnDeviceRpcTrailblazeAgent.kt:928` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:580 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:580-589 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:729-738 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:760-769 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorHelpers.kt:580` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:300 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:300-306 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:366-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:318 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:318-327 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:352-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRoutes.kt:318` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:22 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:22-30 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:45-53 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:67-75 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeCompat.kt:91-99 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:650 — trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:650-658 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:741-749 | trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:803-811 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/SessionToolSet.kt:650` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:548 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliReportGenerator.kt:548-555 | trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:338-346 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-report/src/main/java/xyz/block/trailblaze/report/GenerateTestResultsCliCommand.kt:338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–8 lines × 3) · ×1
  • Duplicated block (6–8 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:489 — trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:489-494 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:726-731 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:920-927 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRunnerEndpoint.kt:210 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRunnerEndpoint.kt:210-216 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/TrailRunnerEndpoint.kt:267-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:171 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:171-178 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:311-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:171` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:350 — trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:350-357 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorCompose.kt:156-162 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorIosAxe.kt:152-162 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorWeb.kt:79-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeSelectorGeneratorAndroidAccessibility.kt:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) build-logic/src/main/kotlin/SelectorTsCodegen.kt:345 — build-logic/src/main/kotlin/SelectorTsCodegen.kt:345-351 | build-logic/src/main/kotlin/SelectorTsCodegen.kt:661-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `build-logic/src/main/kotlin/SelectorTsCodegen.kt:345` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:62 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:62-67 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/PerTrailmapClientDtsEmitter.kt:492-497 | trailblaze-host/src/main/java/xyz/block/trailblaze/host/ResolvedTargetReportEmitter.kt:925-930 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/config/project/TrailmapExportedToolsResolver.kt:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolNameSuggestions.kt:69 — trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolNameSuggestions.kt:69-74 | trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/VisibleStrings.kt:508-512 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/toolcalls/ToolNameSuggestions.kt:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:221 — trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:221-225 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:277-281 | trailblaze-host/src/main/java/xyz/block/trailblaze/cli/tune/WaypointTuner.kt:329-333 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) trailblaze-trail-format/src/iosMain/kotlin/xyz/block/trailblaze/util/Console.ios.kt:14 — trailblaze-trail-format/src/iosMain/kotlin/xyz/block/trailblaze/util/Console.ios.kt:14-50 | trailblaze-trail-format/src/wasmJsMain/kotlin/xyz/block/trailblaze/util/Console.wasmJs.kt:10-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:296 — trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:296-305 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:362-371 | trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:496-502 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `trailblaze-host/src/main/java/xyz/block/trailblaze/trailrunner/SessionRoutes.kt:296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience trailblaze-report/src/main/java/xyz/block/trailblaze/report/RunReportGenerator.kt:572 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (8 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (8 clone groups) sdks/typescript/src/surveys/log-clock.ts:43 — 8 duplicated blocks under the repository root have copies in at least two of the sibling directories sdks, trailblaze-host, trailblaze-report — 3 of them are reported below, and 5 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 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 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 8 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 (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:19 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:19 · REDACTED:583 — the two spans are one implementation copied and then locally edited — 1074 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 (35 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (35 matched lines × 2 locations) sdks/typescript/src/surveys/log-clock.ts:43 — sdks/typescript/src/surveys/log-clock.ts:43 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:48 — the two spans are one implementation copied and then locally edited — 382 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 (30 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (30 matched lines × 2 locations) sdks/typescript/src/in-process.ts:152 — sdks/typescript/src/in-process.ts:152 · sdks/typescript/src/tool.ts:408 — the two spans are one implementation copied and then locally edited — 253 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 (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2553 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2553 · REDACTED:901 — 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 (20 lines × 3 locations) · ×1
  • Duplicated block (20 lines × 3 locations) trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:13 — trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:13 · trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts:14 · trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts:13 — the 3 copies are spread across 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10590 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10590 · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:10608 — 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 (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) REDACTED:423 — REDACTED:423 · REDACTED:493 — 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.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:378 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:378 · REDACTED:997 — 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 (15 lines × 4 locations) · ×1
  • Duplicated block (15 lines × 4 locations) trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:17 — trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:17 · trails/config/trailmaps/clock/tools/clock_android_launchApp.ts:67 · trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts:18 · trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts:17 — the 4 copies are spread across 4 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 (14 lines × 3 locations) · ×1
  • Duplicated block (14 lines × 3 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:607 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:607 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:484 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trailmaps.tsx:465 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (13 lines × 4 locations) · ×1
  • Duplicated block (13 lines × 4 locations) trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:1 — trails/config/trailmaps/calendar/tools/calendar_android_launchApp.ts:1 · trails/config/trailmaps/clock/tools/clock_clearAlarms.ts:1 · trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts:1 · trails/config/trailmaps/wikipedia/tools/wikipedia_android_launchApp.ts:1 — the 4 copies are spread across 4 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 (12 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (12 matched lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:386 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:386 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:562 — the two spans are one implementation copied and then locally edited — 76 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 (11 lines × 3 locations) · ×1
  • Duplicated block (11 lines × 3 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:151 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:151 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:183 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/rpc/daemon.ts:199 — all 3 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.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1035 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1035 · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1134 — 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.
R2 · Cyclomatic Complexity · Complex function extractTrace (cyclomatic 176, cognitive 307) · ×1
  • Complex function extractTrace (cyclomatic 176, cognitive 307) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:556 — extractTrace has cyclomatic complexity 176 and cognitive complexity 307; 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 RecordScreen (cyclomatic 168, cognitive 158) · ×1
  • Complex function RecordScreen (cyclomatic 168, cognitive 158) REDACTED:474 — RecordScreen has cyclomatic complexity 168 and cognitive complexity 158; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 render (cyclomatic 164, cognitive 177) · ×1
  • Complex function render (cyclomatic 164, cognitive 177) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:8245 — render has cyclomatic complexity 164 and cognitive complexity 177; 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 renderViewerState (cyclomatic 145, cognitive 154) · ×1
  • Complex function renderViewerState (cyclomatic 145, cognitive 154) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:343 — renderViewerState has cyclomatic complexity 145 and cognitive complexity 154; 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 buildSummaryModel (cyclomatic 109, cognitive 172) · ×1
  • Complex function buildSummaryModel (cyclomatic 109, cognitive 172) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1652 — buildSummaryModel has cyclomatic complexity 109 and cognitive complexity 172; 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 RunConfigDialog (cyclomatic 102, cognitive 88) · ×1
  • Complex function RunConfigDialog (cyclomatic 102, cognitive 88) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:6 — RunConfigDialog has cyclomatic complexity 102 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 TrailsScreen (cyclomatic 82, cognitive 71) · ×1
  • Complex function TrailsScreen (cyclomatic 82, cognitive 71) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:6 — TrailsScreen has cyclomatic complexity 82 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 renderTimeline (cyclomatic 77, cognitive 101) · ×1
  • Complex function renderTimeline (cyclomatic 77, cognitive 101) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3622 — renderTimeline has cyclomatic complexity 77 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.
R2 · Cyclomatic Complexity · Complex function applyRoute (cyclomatic 71, cognitive 148) · ×1
  • Complex function applyRoute (cyclomatic 71, cognitive 148) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1994 — applyRoute has cyclomatic complexity 71 and cognitive complexity 148; 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 SessionsScreen (cyclomatic 71, cognitive 64) · ×1
  • Complex function SessionsScreen (cyclomatic 71, cognitive 64) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:71 — SessionsScreen has cyclomatic complexity 71 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 renderCompareView (cyclomatic 60, cognitive 55) · ×1
  • Complex function renderCompareView (cyclomatic 60, cognitive 55) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:7482 — renderCompareView has cyclomatic complexity 60 and cognitive complexity 55; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 routeParams (cyclomatic 59, cognitive 131) · ×1
  • Complex function routeParams (cyclomatic 59, cognitive 131) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:2174 — routeParams has cyclomatic complexity 59 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.
R2 · Cyclomatic Complexity · Complex function stepRowHtml (cyclomatic 58, cognitive 56) · ×1
  • Complex function stepRowHtml (cyclomatic 58, cognitive 56) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3547 — stepRowHtml has cyclomatic complexity 58 and cognitive complexity 56; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 AgentComposer (cyclomatic 58, cognitive 49) · ×1
  • Complex function AgentComposer (cyclomatic 58, cognitive 49) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1019 — AgentComposer has cyclomatic complexity 58 and cognitive complexity 49; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 runSurveyCli (cyclomatic 56, cognitive 69) · ×1
  • Complex function runSurveyCli (cyclomatic 56, cognitive 69) sdks/typescript/src/surveys/cli-main.ts:56 — runSurveyCli has cyclomatic complexity 56 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.
R2 · Cyclomatic Complexity · Complex function AgentToolCard (cyclomatic 56, cognitive 43) · ×1
  • Complex function AgentToolCard (cyclomatic 56, cognitive 43) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2144 — AgentToolCard has cyclomatic complexity 56 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 TrailheadStep (cyclomatic 55, cognitive 49) · ×1
  • Complex function TrailheadStep (cyclomatic 55, cognitive 49) REDACTED:334 — TrailheadStep has cyclomatic complexity 55 and cognitive complexity 49; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 onKeydown (cyclomatic 54, cognitive 67) · ×1
  • Complex function onKeydown (cyclomatic 54, cognitive 67) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:11041 — onKeydown has cyclomatic complexity 54 and cognitive complexity 67; 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 buildRunMeta (cyclomatic 54, cognitive 54) · ×1
  • Complex function buildRunMeta (cyclomatic 54, cognitive 54) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:521 — buildRunMeta has cyclomatic complexity 54 and cognitive complexity 54; 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 (anonymous) (cyclomatic 54, cognitive 40) · ×1
  • Complex function (anonymous) (cyclomatic 54, cognitive 40) REDACTED:529 — (anonymous) has cyclomatic complexity 54 and cognitive complexity 40; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 TrailYamlEditor (cyclomatic 53, cognitive 45) · ×1
  • Complex function TrailYamlEditor (cyclomatic 53, cognitive 45) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:667 — TrailYamlEditor has cyclomatic complexity 53 and cognitive complexity 45; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 RUN_REPORT_VIEWER (cyclomatic 52, cognitive 47) · ×1
  • Complex function RUN_REPORT_VIEWER (cyclomatic 52, cognitive 47) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:60 — RUN_REPORT_VIEWER has cyclomatic complexity 52 and cognitive complexity 47; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 matchesAndroidAccessibility (cyclomatic 50, cognitive 51) · ×1
  • Complex function matchesAndroidAccessibility (cyclomatic 50, cognitive 51) REDACTED:335 — matchesAndroidAccessibility has cyclomatic complexity 50 and cognitive complexity 51; 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 txCallContext (cyclomatic 48, cognitive 38) · ×1
  • Complex function txCallContext (cyclomatic 48, cognitive 38) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:3902 — txCallContext has cyclomatic complexity 48 and cognitive complexity 38; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 ToolComposer (cyclomatic 48, cognitive 33) · ×1
  • Complex function ToolComposer (cyclomatic 48, cognitive 33) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:400 — ToolComposer has cyclomatic complexity 48 and cognitive complexity 33; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 onTreeKeyDown (cyclomatic 47, cognitive 67) · ×1
  • Complex function onTreeKeyDown (cyclomatic 47, cognitive 67) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-tree.tsx:182 — onTreeKeyDown has cyclomatic complexity 47 and cognitive complexity 67; 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 toolChildren (cyclomatic 47, cognitive 52) · ×1
  • Complex function toolChildren (cyclomatic 47, cognitive 52) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:990 — toolChildren has cyclomatic complexity 47 and cognitive complexity 52; 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 querySelector (cyclomatic 47, cognitive 46) · ×1
  • Complex function querySelector (cyclomatic 47, cognitive 46) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:658 — querySelector has cyclomatic complexity 47 and cognitive complexity 46; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 TraceViewer (cyclomatic 47, cognitive 42) · ×1
  • Complex function TraceViewer (cyclomatic 47, cognitive 42) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trace-viewer.tsx:72 — TraceViewer has cyclomatic complexity 47 and cognitive complexity 42; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 querySelectorAll (cyclomatic 46, cognitive 45) · ×1
  • Complex function querySelectorAll (cyclomatic 46, cognitive 45) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:543 — querySelectorAll has cyclomatic complexity 46 and cognitive complexity 45; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 applyDetailRoute (cyclomatic 46, cognitive 45) · ×1
  • Complex function applyDetailRoute (cyclomatic 46, cognitive 45) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1899 — applyDetailRoute has cyclomatic complexity 46 and cognitive complexity 45; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 isInteractive (cyclomatic 46, cognitive 39) · ×1
  • Complex function isInteractive (cyclomatic 46, cognitive 39) sdks/typescript/src/matcher/driver-node-detail.ts:439 — isInteractive has cyclomatic complexity 46 and cognitive complexity 39; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 run (cyclomatic 45, cognitive 54) · ×1
  • Complex function run (cyclomatic 45, cognitive 54) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:301 — run has cyclomatic complexity 45 and cognitive complexity 54; 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 paintLane (cyclomatic 44, cognitive 77) · ×1
  • Complex function paintLane (cyclomatic 44, cognitive 77) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:6723 — paintLane has cyclomatic complexity 44 and cognitive complexity 77; 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 extractLlmLogs (cyclomatic 43, cognitive 59) · ×1
  • Complex function extractLlmLogs (cyclomatic 43, cognitive 59) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1301 — extractLlmLogs has cyclomatic complexity 43 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.
R2 · Cyclomatic Complexity · Complex function update (cyclomatic 43, cognitive 42) · ×1
  • Complex function update (cyclomatic 43, cognitive 42) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:11218 — update has cyclomatic complexity 43 and cognitive complexity 42; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 DemoGeneratePhase (cyclomatic 43, cognitive 40) · ×1
  • Complex function DemoGeneratePhase (cyclomatic 43, cognitive 40) trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:532 — DemoGeneratePhase has cyclomatic complexity 43 and cognitive complexity 40; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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 buildTheaterStory (cyclomatic 42, cognitive 43) · ×1
  • Complex function buildTheaterStory (cyclomatic 42, cognitive 43) REDACTED:400 — buildTheaterStory has cyclomatic complexity 42 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.
R2 · Cyclomatic Complexity · Complex function readRoute (cyclomatic 42, cognitive 43) · ×1
  • Complex function readRoute (cyclomatic 42, cognitive 43) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1836 — readRoute has cyclomatic complexity 42 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.
R2 · Cyclomatic Complexity · Complex function getElementById (cyclomatic 42, cognitive 40) · ×1
  • Complex function getElementById (cyclomatic 42, cognitive 40) trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-core.test.ts:1124 — getElementById has cyclomatic complexity 42 and cognitive complexity 40; 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. 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.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts: 11186 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-viewer.ts has 11186 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx: 2887 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx has 2887 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2434 lines of code REDACTED:1 — REDACTED has 2434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts: 2015 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary-model.ts has 2015 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-css.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-css.ts: 1973 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-css.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-css.ts has 1973 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts: 1842 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-extract.ts has 1842 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts: 1746 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-summary.ts has 1746 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts: 1428 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-compare-model.ts has 1428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts: 1337 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-trail-replay.ts has 1337 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx: 1258 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx has 1258 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts: 1253 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-theater.ts has 1253 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx: 1249 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx has 1249 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1209 lines of code REDACTED:1 — REDACTED has 1209 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts: 1131 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-shell.ts has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js: 1074 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/zip-report-core.js has 1074 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · sdks/typescript/tools/extract-tool-defs.mjs · ×1
  • sdks/typescript/tools/extract-tool-defs.mjs: 1066 lines of code sdks/typescript/tools/extract-tool-defs.mjs:1 — sdks/typescript/tools/extract-tool-defs.mjs has 1066 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 987 lines of code REDACTED:1 — REDACTED has 987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts: 983 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts has 983 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx: 975 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx has 975 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · sdks/typescript/src/client.ts · ×1
  • sdks/typescript/src/client.ts: 951 lines of code sdks/typescript/src/client.ts:1 — sdks/typescript/src/client.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx: 945 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts: 944 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-viewer.ts has 944 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx: 925 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/ui.tsx has 925 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx: 913 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx has 913 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts: 840 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/perf-extract.ts has 840 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx: 833 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx has 833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · sdks/typescript/src/surveys/session.ts · ×1
  • sdks/typescript/src/surveys/session.ts: 818 lines of code sdks/typescript/src/surveys/session.ts:1 — sdks/typescript/src/surveys/session.ts has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx: 807 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx has 807 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js: 778 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor/monaco-lsp.js has 778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx: 775 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/device-console.tsx has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · sdks/typescript/src/tool.ts · ×1
  • sdks/typescript/src/tool.ts: 769 lines of code sdks/typescript/src/tool.ts:1 — sdks/typescript/src/tool.ts has 769 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · sdks/typescript/src/surveys/live.ts · ×1
  • sdks/typescript/src/surveys/live.ts: 718 lines of code sdks/typescript/src/surveys/live.ts:1 — sdks/typescript/src/surveys/live.ts has 718 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx: 689 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx has 689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js: 649 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-payload.js has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx: 645 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx has 645 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx: 613 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trails.tsx has 613 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx: 598 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts · ×1
  • trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts: 597 lines of code trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts:1 — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-clip-player.ts has 597 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js: 585 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/trail-yaml.js has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx · ×1
  • trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx: 583 lines of code trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx:1 — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/devices.tsx has 583 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 lint script · ×1
  • No lint 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.
R7 · Dead Code · Dead file (~82 LoC) · ×1
  • Dead file (~82 LoC) trails/config/trailmaps/clock/tools/clock_android_launchApp.ts — no import path from any entry point (216 application, 8 tooling, 86 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
R7 · Dead Code · Dead file (~39 LoC) · ×1
  • Dead file (~39 LoC) trails/config/trailmaps/clock/tools/clock_clearAlarms.ts — no import path from any entry point (216 application, 8 tooling, 86 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
R7 · Dead Code · Dead file (~34 LoC) · ×1
  • Dead file (~34 LoC) trails/config/trailmaps/contacts/tools/contacts_android_launchApp.ts — no import path from any entry point (216 application, 8 tooling, 86 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
R7 · Dead Code · Dead file (~20 LoC) · ×1
  • Dead file (~20 LoC) trails/config/trailmaps/goose/tools/goose_launchDesktop.ts — no import path from any entry point (216 application, 8 tooling, 86 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
R8 · Dependency Hygiene · Unused dependency '@vtsls/language-server' · ×1
  • Unused dependency '@vtsls/language-server' sdks/typescript/package.json:52 — Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'dts-bundle-generator' · ×1
  • Unused dependency 'dts-bundle-generator' sdks/typescript/package.json:53 — Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'esbuild' · ×1
  • Unused dependency 'esbuild' sdks/typescript/package.json:54 — Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'yaml-language-server' · ×1
  • Unused dependency 'yaml-language-server' sdks/typescript/package.json:57 — Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/index.html:20 — `https://unpkg.com/react@18.3.1/umd/react.production.min.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 11 such include(s) across the repository's markup.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×1
  • Length read from the parsed input is spent without ever being bounded trailblaze-inprocess-apk/src/main/kotlin/xyz/block/trailblaze/inprocess/apk/AndroidBinaryXml.kt:140 — `stringCount` is read from the bytes being parsed at line 134 (`int`), then used to size a `IntArray` at line 140 — and nowhere in its scope is `stringCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringCount` against the bytes actually remaining and a maximum the format allows before allocating.
Minor — 132 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts:159 — `!hierarchy || typeof hierarchy !== 'object'` appears character-identically in 2 files — trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-inspector.ts, trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-selectors.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:538 — `!selected || selected.available !== false` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx. 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 trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts:538 — `!streams || typeof streams !== "object" || Array.isArray(streams)` appears character-identically in 2 files — trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-events.ts, trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-warnings.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/agent-setup.tsx:11 — `(agentsHook.data && agentsHook.data.supportedAgents) || []` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/agent-setup.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx:157 — `(deviceApps.data && deviceApps.data.targets) || []` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/runconfig.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx. 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 sdks/typescript/src/tool-core.ts:428 — `args != null && typeof args === "object" && !Array.isArray(args)` appears character-identically in 2 files — sdks/typescript/src/tool-core.ts, sdks/typescript/src/tool.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:480 — `cbRef.current.onChange && cbRef.current.onChange(t)` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:481 — `cbRef.current.onSave && cbRef.current.onSave()` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:215 — `d.instanceId || d.trailblazeDeviceId?.instanceId` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:216 — `d.platform || d.trailblazeDeviceId?.trailblazeDevicePlatform || ''` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-hooks.tsx. 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 sdks/typescript/src/client.ts:726 — `envelope.structuredContent !== undefined && envelope.structuredContent !== null` appears character-identically in 3 files — sdks/typescript/src/client.ts, sdks/typescript/src/testing.ts, sdks/typescript/tools/in-process-wrapper-template.mjs. 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 sdks/typescript/src/surveys/discover.ts:291 — `existsSync(dir) && statSync(dir).isDirectory()` appears character-identically in 3 files — sdks/typescript/src/surveys/discover.ts, sdks/typescript/src/surveys/workspace.ts, trailblaze-report/src/main/resources/xyz/block/trailblaze/report/run-report-cli.ts. 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 sdks/typescript/src/client.ts:605 — `firstArg !== null && typeof firstArg === "object"` appears character-identically in 2 files — sdks/typescript/src/client.ts, sdks/typescript/src/testing.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx:533 — `from == null || to == null || from === to` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/steps-board.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/trail-detail.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx:509 — `h && value != null && h.getValue() !== value` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/editor.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/tools.tsx. 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 sdks/typescript/src/surveys/runner.ts:179 — `options.where && !options.where(session.summary)` appears character-identically in 2 files — sdks/typescript/src/surveys/runner.ts, sdks/typescript/src/surveys/stream-write.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx:37 — `parsed && typeof parsed === 'object' && !Array.isArray(parsed)` appears character-identically in 3 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/companion.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-report/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-report-payload.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:335 — `r && r.ok !== false && r.success !== false && r.sessionId` appears character-identically in 3 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/run-fanout.js, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/blaze.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx:94 — `res.error || 'Could not switch to that folder. It may not be a readable directory.'` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/settings.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx. 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 sdks/typescript/src/surveys/labels.ts:200 — `result === undefined || result === null || result === false` appears character-identically in 2 files — sdks/typescript/src/surveys/labels.ts, sdks/typescript/src/surveys/run-one.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx:542 — `selected && selected.models && selected.models.length` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/demonstrate.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx. 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 sdks/typescript/src/in-process.ts:150 — `specObj.inputSchema && typeof specObj.inputSchema === "object" && !Array.isArray(specObj.inputSchema)` appears character-identically in 2 files — sdks/typescript/src/in-process.ts, sdks/typescript/src/tool.ts. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1189 — `status.data && status.data.trailsDirectory` appears character-identically in 3 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx:75 — `status.data && status.data.workspaceBranch` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx. 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 trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx:76 — `status.data && status.data.workspaceIsWorktree` appears character-identically in 2 files — trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/home.tsx, trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/shell.tsx. 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.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×39
  • Silent fallback default in catch trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/InProcessIdleSettleClient.kt:44 — `sysprop` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/ReplayCaptureOptions.kt:105 — `sysprop` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-android/src/main/java/xyz/block/trailblaze/android/accessibility/SettleSwitches.kt:49 — `sysprop` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/MaestroLaunchArgumentRedaction.kt:57 — `maestroLaunchArgumentSecrets` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/recordings/UnifiedRecordingWriter.kt:305 — `replayedToolNamesForDevice` swallows every exception into `emptySet()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/replay/ActionTrace.kt:136 — `sysprop` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/InProcessIdleApkInstaller.kt:159 — `bundledDetectorFileNames` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/InProcessIdleApkInstaller.kt:172 — `detectorFileNamesInClasspathEntry` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-common/src/jvmMain/kotlin/xyz/block/trailblaze/util/InProcessIdleApkInstaller.kt:195 — `detectorFileNamesUnder` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliInfrastructure.kt:2192 — `loadTargetIds` swallows every exception into `emptySet()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch REDACTED:3337 — `boundDeviceNames` swallows every exception into `emptySet()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch REDACTED:3832 — `delegatedDeviceBindings` swallows every exception into `emptyMap()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-host/src/main/java/xyz/block/trailblaze/scripting/DaemonScriptedToolBundler.kt:1087 — `drainProcessOutput` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-host/src/main/java/xyz/block/trailblaze/usages/ScriptedToolSourceSnapshotScanner.kt:132 — `typedBindingNames` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightReplayTree.kt:231 — `captureTextBoxes` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightReplayTree.kt:258 — `captureFrameOrigins` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:854 — `enrichCompactElementList` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightScreenState.kt:1116 — `discoverHiddenCssTargetableElements` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/network/WebNetworkCapture.kt:636 — `pathOf` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:1124 — `getCustomToolDescriptors` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/ToolDiscoveryToolSet.kt:1182 — `getCustomToolDescriptorsForPlatform` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch sdks/typescript/src/surveys/parse.ts:349 — `parseProperties` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch sdks/typescript/src/surveys/session.ts:372 — `readBody` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch sdks/typescript/src/surveys/discover.ts:486 — `localModule` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/data-core.tsx:922 — `recordToolParams` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • + 14 more in this group — see findings.md.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×11
  • Hand-rolled JSON/XML parsing via regex trailblaze-playwright/src/main/java/xyz/block/trailblaze/playwright/PlaywrightDriverManager.kt:477 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1895 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:1927 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2162 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2222 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/external-agents.tsx:2742 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/resources/xyz/block/trailblaze/trailrunner/web/app/screens/sessions.tsx:11 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/java/xyz/block/trailblaze/cli/SelectorCommandShared.kt:219 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointMigrateTrailCommand.kt:1298 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-host/src/main/java/xyz/block/trailblaze/cli/WaypointMigrateTrailCommand.kt:1340 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/waypoint/SessionLogScreenState.kt:343 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×10
  • Projects may be oversized for their cohesion trailblaze-host/build.gradle.kts:1 — `trailblaze-host` (112025 LoC, 1399 module-visible types across 45 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-common/build.gradle.kts:1 — `trailblaze-common` (59588 LoC, 894 module-visible types across 99 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-report/build.gradle.kts:1 — `trailblaze-report` (46566 LoC, 321 module-visible types across 10 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-models/build.gradle.kts:1 — `trailblaze-models` (36271 LoC, 902 module-visible types across 62 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion sdks/typescript/package.json:1 — `sdks/typescript` (16995 LoC, 588 module-visible types across 7 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-server/build.gradle.kts:1 — `trailblaze-server` (22582 LoC, 291 module-visible types across 15 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-android/build.gradle.kts:1 — `trailblaze-android` (15287 LoC, 197 module-visible types across 12 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-playwright/build.gradle.kts:1 — `trailblaze-playwright` (13334 LoC, 140 module-visible types across 5 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-capture/build.gradle.kts:1 — `trailblaze-capture` (9926 LoC, 146 module-visible types across 5 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion trailblaze-trail-format/build.gradle:1 — `trailblaze-trail-format` (7554 LoC, 123 module-visible types across 14 directories) overshoots its size bounds. 10 of 33 build unit(s) (Gradle, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
P2 · Observability · Console output used as the logging channel · ×8
  • Console output used as the logging channel sdks/typescript/src/memory.ts:233 — `sdks/typescript/src/memory.ts` reports through `console.*` at line 233 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/memory.ts:252 — `sdks/typescript/src/memory.ts` reports through `console.*` at line 252 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/run.ts:23 — `sdks/typescript/src/run.ts` reports through `console.*` at line 23 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/tool-core.ts:409 — `sdks/typescript/src/tool-core.ts` reports through `console.*` at line 409 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/tool.ts:292 — `sdks/typescript/src/tool.ts` reports through `console.*` at line 292 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/tool.ts:500 — `sdks/typescript/src/tool.ts` reports through `console.*` at line 500 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/surveys/workspace.ts:26 — `sdks/typescript/src/surveys/workspace.ts` reports through `console.*` at line 26 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel sdks/typescript/src/rpc/example.ts:44 — `sdks/typescript/src/rpc/example.ts` reports through `console.*` at line 44 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
P10 · Library API & versioning · Implementation type on the public API · ×3
  • Implementation type on the public API trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:54 — 1 public type in `xyz.block.trailblaze.host` is marked as implementation by its own namespace, folder or name: `MaestroHostRunnerImpl` (trailblaze-host/src/main/java/xyz/block/trailblaze/host/MaestroHostRunnerImpl.kt:54, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126 — 1 public type in `xyz.block.trailblaze.mcp` is marked as implementation by its own namespace, folder or name: `TrailblazeMcpBridgeImpl` (trailblaze-host/src/main/java/xyz/block/trailblaze/mcp/TrailblazeMcpBridgeImpl.kt:126, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:157 — 1 public type in `xyz.block.trailblaze.mcp.newtools` is marked as implementation by its own namespace, folder or name: `TrailExecutorImpl` (trailblaze-server/src/main/java/xyz/block/trailblaze/mcp/newtools/TrailExecutor.kt:157, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found build.gradle.kts:73 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `build.gradle.kts` makes this repository a deployable product (line 73).
D21 · Naming Consistency · `createIOS` spells `IOS` where 49 names in the project spell it `Ios` · ×1
  • `createIOS` spells `IOS` where 49 names in the project spell it `Ios` trailblaze-host/src/main/java/xyz/block/trailblaze/host/devices/HostIosDriverFactory.kt:137 — 49 of 50 names in project trailblaze-host spell the token `Ios` (49 of 50; unit: names in project trailblaze-host containing `Ios`). Peers: CliConfigHelper.parseIosDriver (trailblaze-host/src/main/java/xyz/block/trailblaze/cli/CliConfigHelper.kt:683); DeviceClassifierResolver.probeIosDims (trailblaze-host/src/main/java/xyz/block/trailblaze/cli/DeviceClassifierResolver.kt:580); TrailCommand.captureIosLogs (REDACTED:593); Companion.resolveIos (trailblaze-host/src/main/java/xyz/block/trailblaze/host/StreamScreenshotMode.kt:49); SessionState.previousIosCoefficient (trailblaze-host/src/main/java/xyz/block/trailblaze/host/animations/SessionAnimationDisabler.kt:65). Rename to `createIos`. [rule N6]
D21 · Naming Consistency · `getLLMClientForProviderIfAvailable` spells `LLM` where 45 names in the project spell it `Llm` · ×1
  • `getLLMClientForProviderIfAvailable` spells `LLM` where 45 names in the project spell it `Llm` trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/llm/providers/TrailblazeDynamicLlmTokenProvider.kt:17 — 45 of 46 names in project trailblaze-models spell the token `Llm` (45 of 46; unit: names in project trailblaze-models containing `Llm`). Peers: AgentMemory.argsForLlmContext (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/AgentMemory.kt:274); InlineScriptToolConfig.surfaceToLlm (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/config/AppTargetYamlConfig.kt:234); ProjectDefaults.maxLlmCalls (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/config/project/TrailblazeProjectConfig.kt:128); TrailmapScriptedToolFile.surfaceToLlm (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/config/project/TrailmapScriptedToolFile.kt:117); TrailmapScriptedToolEntry.surfaceToLlm (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/config/project/TrailmapScriptedToolFile.kt:313). Rename to `getLlmClientForProviderIfAvailable`. [rule N6]
D21 · Naming Consistency · `collectIOSElements` spells `IOS` where 25 names in the project spell it `Ios` · ×1
  • `collectIOSElements` spells `IOS` where 25 names in the project spell it `Ios` trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/viewhierarchy/ViewHierarchyFilter.kt:540 — 25 of 26 names in project trailblaze-models spell the token `Ios` (25 of 26; unit: names in project trailblaze-models containing `Ios`). Peers: Companion.buildForIos (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/CompactScreenElements.kt:59); Companion.buildForIosAxe (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/CompactScreenElements.kt:69); IosIdentityCoalescingKt.effectiveIosResourceId (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/IosIdentityCoalescing.kt:30); xyz.block.trailblaze.api.TrailblazeNodeMapperIosMaestroKt (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeMapperIosMaestro.kt:1); TrailblazeNodeMapperIosMaestroKt.toIosMaestroTrailblazeNode (trailblaze-models/src/commonMain/kotlin/xyz/block/trailblaze/api/TrailblazeNodeMapperIosMaestro.kt:13). Rename to `collectIosElements`. [rule N6]
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 9/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `docs/generator`, `trailblaze-android-ondevice-mcp`, `trailblaze-desktop`, `trailblaze-inprocess-apk`, `trailblaze-report` and 1 more.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:5 — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 10 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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation examples/android-sample-app/trails/config/host-tools/package.json:7 — `examples/android-sample-app/trails/config/host-tools/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`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:81 — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code · Unused module-local declaration '_listResultShape' · ×1
  • Unused module-local declaration '_listResultShape' sdks/typescript/src/built-in-tools.ts:64 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration '_detailedResultShape' · ×1
  • Unused module-local declaration '_detailedResultShape' sdks/typescript/src/built-in-tools.ts:65 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'RegisteredHandler' · ×1
  • Unused module-local declaration 'RegisteredHandler' sdks/typescript/src/tool.test.ts:64 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X2 · Cancellation propagation · Not all functions that make a request accept an AbortSignal or the coroutine's cancellation · ×1
  • Not all functions that make a request accept an AbortSignal or the coroutine's cancellation — Only 26/64 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; Ktor, OkHttp newCall, URL streams) accept an AbortSignal or the coroutine's cancellation or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` () and hand it to the request; in a Kotlin suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X4 · Structured logging · Interpolated log message defeats structured logging · ×1
  • Interpolated log message defeats structured logging trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/maestro/AssertionLogger.kt:103 — `debug` at line 103 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure trailblaze-common/src/jvmAndAndroid/kotlin/xyz/block/trailblaze/device/AndroidDeviceCommandExecutor.kt:915 — `decodeTrampolineToken` answers `""` when `IllegalArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Minor — 548 finding(s)
D12 · Dependency Hygiene · Outdated (compile) · ×542
  • Outdated (compile): org.jetbrains.dokka:analysis-kotlin-descriptors — org.jetbrains.dokka:analysis-kotlin-descriptors 1.9.20 → 2.2.0 available.
  • Outdated (compile): org.jetbrains.dokka:dokka-base — org.jetbrains.dokka:dokka-base 1.9.20 → 2.3.0 available.
  • Outdated (compile): org.jetbrains.dokka:analysis-markdown — org.jetbrains.dokka:analysis-markdown 1.9.20 → 2.3.0 available.
  • Outdated (compile): org.jsoup:jsoup — org.jsoup:jsoup 1.16.1 → 1.24.1 available.
  • Outdated (compile): org.jetbrains:markdown — org.jetbrains:markdown 0.5.2 → 0.7.18 available.
  • Outdated (compile): org.jetbrains:markdown-jvm — org.jetbrains:markdown-jvm 0.5.2 → 0.7.18 available.
  • Outdated (compile): it.unimi.dsi:fastutil-core — it.unimi.dsi:fastutil-core 8.5.12 → 8.5.19 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib-jdk8 — org.jetbrains.kotlin:kotlin-stdlib-jdk8 2.4.0 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib — org.jetbrains.kotlin:kotlin-stdlib 2.4.0 → 2.4.21 available.
  • Outdated (compile): org.jetbrains:annotations — org.jetbrains:annotations 23.0.0 → 26.1.0 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib-common — org.jetbrains.kotlin:kotlin-stdlib-common 2.4.0 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib-jdk7 — org.jetbrains.kotlin:kotlin-stdlib-jdk7 2.4.0 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-reflect — org.jetbrains.kotlin:kotlin-reflect 2.4.0 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlinx:kotlinx-coroutines-core — org.jetbrains.kotlinx:kotlinx-coroutines-core 1.7.3 → 1.11.0 available.
  • Outdated (compile): org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm — org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm 1.7.3 → 1.11.0 available.
  • Outdated (compile): org.jetbrains.kotlinx:kotlinx-coroutines-bom — org.jetbrains.kotlinx:kotlinx-coroutines-bom 1.7.3 → 1.11.0 available.
  • Outdated (compile): org.freemarker:freemarker — org.freemarker:freemarker 2.3.32 → 2.3.35 available.
  • Outdated (compile): org.jetbrains.kotlinx:kotlinx-html-jvm — org.jetbrains.kotlinx:kotlinx-html-jvm 0.9.1 → 0.12.0 available.
  • Outdated (compile): com.fasterxml.jackson.module:jackson-module-kotlin — com.fasterxml.jackson.module:jackson-module-kotlin 2.12.7 → 2.23.0 available.
  • Outdated (compile): com.fasterxml.jackson.core:jackson-databind — com.fasterxml.jackson.core:jackson-databind 2.12.7.1 → 2.23.0 available.
  • Outdated (compile): com.fasterxml.jackson.core:jackson-annotations — com.fasterxml.jackson.core:jackson-annotations 2.12.7 → 2.23 available.
  • Outdated (compile): com.fasterxml.jackson:jackson-bom — com.fasterxml.jackson:jackson-bom 2.12.7 → 2.23.0 available.
  • Outdated (compile): com.fasterxml.jackson.core:jackson-core — com.fasterxml.jackson.core:jackson-core 2.12.7 → 2.23.0 available.
  • Outdated (compile): org.jetbrains.dokka:gfm-template-processing-plugin — org.jetbrains.dokka:gfm-template-processing-plugin 1.9.20 → 2.3.0 available.
  • Outdated (compile): org.jetbrains.dokka:gfm-plugin — org.jetbrains.dokka:gfm-plugin 1.9.20 → 2.3.0 available.
  • + 517 more in this group — see findings.md.
D10 · Test Quality · Skipped (documented) · ×4
  • Skipped (documented): (unnamed test) REDACTED:84 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) REDACTED:92 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) REDACTED:99 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) REDACTED:110 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names sdks/typescript/src/surveys/live-plan.ts:13 — 0 of 0 documented parameters and 2 of 1022 summaries in `@trailblaze/scripting` only repeat the member or parameter name (e.g. "How one stream is read." for `StreamRead`). Delete the restating tags, or add what the name does not say.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: :trailblaze-common — :trailblaze-common: abstractness 0.08, instability 0.19, distance 0.73 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-868ee1282cc2458ca1c5a36cd14c19ae/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=16" --report-format json --report-path /tmp/watchdog-gitleaks-868ee1282cc2458ca1c5a36cd14c19ae/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-868ee1282cc2458ca1c5a36cd14c19ae/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude docs/generated/functions --exclude sdks/typescript/src/generated .98artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .14artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 104 file(s) — `docs/generator/src/main/java/xyz/block/trailblaze/docs/LlmConfigDocsGenerator.kt`, `sdks/typescript/src/memory.ts`, `sdks/typescript/src/surveys/match.ts`, `sdks/typescript/src/surveys/phase.ts`, `sdks/typescript/src/surveys/stream.ts`, … (+99 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e67c-fb66-7e5f-b294-f2762fca72a6 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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