Public report — serviceradar, published 24 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.15 (frozen) · verify this surveyFiledcd_1e0c9f6fa7494183ae677fa8586703c5
Filed 25 September 2026, 05:09 UTC
Public
Very large · 1,530,627 LoC · rebuild ~31.3 person-years · weakest lens: Accessibility (64%)
Findings by grade
178 critical3357 serious206 minor40 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 September 2026, 03:03 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
3638findings with an exact file:lineof 3741 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
69/138dimensions across the health lenses1530627 LoC — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
The system holds a 68% health score, indicating a large, valuable asset that is currently at risk. With over 1.5 million lines of production code and a rebuild cost nearing €4.5 million, the business has significant capital tied up here. While the core domain logic is mature and well-modeled, the overall standing suggests that without intervention, operational costs will rise and compliance risks will grow.
The most urgent issue is accessibility debt. This is the weakest lens, scoring only 64%, and it poses a direct legal and reputational risk for a system of this size. The cost of inaction is substantial: the drag on developer velocity caused by poor code quality averages 3–6% across all changes. This means every new feature or bug fix takes longer and costs more than it should, creating a compounding tax on the team’s ability to deliver value quickly.
A second theme is structural complexity. The codebase is very large, and while the architecture is generally sound, the lack of standardized testing for key parts of the stack means defects can slip through. This uncertainty slows down release cycles and increases the likelihood of production incidents. The team is effectively paying for this instability in delayed time and increased engineering effort, which erodes the return on the massive investment already made.
What is genuinely good is the maturity of the domain model and the event-driven architecture. The core business logic is clean, consistent, and easy for new engineers to understand. This strong foundation means that when we fix the surface-level issues, the system will be stable and reliable. The high maturity score shows that the team has done the hard work of defining clear boundaries and behaviors.
Focus first on accessibility compliance. The top fixes, such as adding proper labels and landmarks, are low-effort but high-impact. They pay for themselves within months by reducing the annual drag on productivity. Addressing these items first provides immediate risk reduction and frees up engineering capacity for more valuable work. This is the highest-leverage move available right now.
Note that performance was not measured, so the full picture of system health is partial. Some test suites were also not analyzed, meaning certain areas may have hidden issues. However, the current data is sufficient to identify the most critical path forward.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
0.9× (at 68% quality) — the last 20% of quality is most of the work
Size & shape
Very large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~31.3 person-years of build effort (about ~€4,500,000 to rebuild). Its weakest lens is Accessibility at 64% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Very high (×1.8) — DDD/clean architecture, CQRS, domain model, event-driven integration × a 0.9× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
The top fix pays for itself · REDACTED · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 1411.4–8468.2 engineer-days every year, paid as drag on the ~19,858,385 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 3–6% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 4,896,588 line(s) changed over a 90-day window ⇒ ~19,858,385/year · D1/D2/D4 code quality: averaging 6.9/10 ⇒ a 3–6% drag on each change · top-ranked remediation: REDACTED effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · REDACTED · Value at risk
This is a Very large asset (~31.3 person-years to rebuild), and its weakest lens is Accessibility at 64%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · REDACTED · Leverage
Of everything flagged, the best return on effort is: Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
A velocity tax on every change · REDACTED · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.9/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–6% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 6.9/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
2134 modules, 4059 dependencies. 11 dependency cycles across 207 modules, marked above the diagonal.
Showing the 40 most-connected modules; 2094 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
github.com/carverauto/serviceradar/go/pkg/agent uses github.com/carverauto/serviceradar/go/pkg/addon. Changing github.com/carverauto/serviceradar/go/pkg/addon can break github.com/carverauto/serviceradar/go/pkg/agent, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
8→23 quote.to_tokens depends on proc_macro2.fallbackcycle✕
Type pairs
1 distinct (type in quote.to_tokens → type in proc_macro2.fallback) reference.
github.com/carverauto/serviceradar/go/pkg/addon uses github.com/carverauto/serviceradar/go/pkg/agent. Changing github.com/carverauto/serviceradar/go/pkg/agent can break github.com/carverauto/serviceradar/go/pkg/addon, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
11→9 serde_json.ser depends on serviceradar_afpacket✕
Type pairs
1 distinct (type in serde_json.ser → type in serviceradar_afpacket) reference.
105 distinct (type in syn.token → type in anyhow.context.private) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
syn.token uses anyhow.context.private. Changing anyhow.context.private can break syn.token, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
15→4 syn.token depends on memchr.arch.all.rabinkarp✕
Type pairs
104 distinct (type in syn.token → type in memchr.arch.all.rabinkarp) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
100 distinct (type in syn.token → type in quote.to_tokens) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Which types
syn.token.Abstract → quote.to_tokens.ToTokens
syn.token.And → quote.to_tokens.ToTokens
syn.token.AndAnd → quote.to_tokens.ToTokens
syn.token.AndEq → quote.to_tokens.ToTokens
syn.token.As → quote.to_tokens.ToTokens
syn.token.Async → quote.to_tokens.ToTokens
syn.token.At → quote.to_tokens.ToTokens
syn.token.Auto → quote.to_tokens.ToTokens
syn.token.Await → quote.to_tokens.ToTokens
syn.token.Become → quote.to_tokens.ToTokens
syn.token.Box → quote.to_tokens.ToTokens
syn.token.Break → quote.to_tokens.ToTokens
syn.token.Caret → quote.to_tokens.ToTokens
syn.token.CaretEq → quote.to_tokens.ToTokens
syn.token.Colon → quote.to_tokens.ToTokens
syn.token.Comma → quote.to_tokens.ToTokens
syn.token.Const → quote.to_tokens.ToTokens
syn.token.Continue → quote.to_tokens.ToTokens
syn.token.Crate → quote.to_tokens.ToTokens
syn.token.Default → quote.to_tokens.ToTokens
syn.token.Do → quote.to_tokens.ToTokens
syn.token.Dollar → quote.to_tokens.ToTokens
syn.token.Dot → quote.to_tokens.ToTokens
syn.token.DotDot → quote.to_tokens.ToTokens
syn.token.DotDotDot → quote.to_tokens.ToTokens
Direction
syn.token uses quote.to_tokens. Changing quote.to_tokens can break syn.token, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
104 distinct (type in syn.token → type in serde_json.ser) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Which types
syn.token.Abstract → serde_json.ser.Formatter
syn.token.And → serde_json.ser.Formatter
syn.token.AndAnd → serde_json.ser.Formatter
syn.token.AndEq → serde_json.ser.Formatter
syn.token.As → serde_json.ser.Formatter
syn.token.Async → serde_json.ser.Formatter
syn.token.At → serde_json.ser.Formatter
syn.token.Auto → serde_json.ser.Formatter
syn.token.Await → serde_json.ser.Formatter
syn.token.Become → serde_json.ser.Formatter
syn.token.Box → serde_json.ser.Formatter
syn.token.Brace → serde_json.ser.Formatter
syn.token.Bracket → serde_json.ser.Formatter
syn.token.Break → serde_json.ser.Formatter
syn.token.Caret → serde_json.ser.Formatter
syn.token.CaretEq → serde_json.ser.Formatter
syn.token.Colon → serde_json.ser.Formatter
syn.token.Comma → serde_json.ser.Formatter
syn.token.Const → serde_json.ser.Formatter
syn.token.Continue → serde_json.ser.Formatter
syn.token.Crate → serde_json.ser.Formatter
syn.token.Default → serde_json.ser.Formatter
syn.token.Do → serde_json.ser.Formatter
syn.token.Dollar → serde_json.ser.Formatter
syn.token.Dot → serde_json.ser.Formatter
Direction
syn.token uses serde_json.ser. Changing serde_json.ser can break syn.token, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
2 distinct (type in syn.token → type in camino) references.
Which types
syn.token.Box → camino.Utf8Path
syn.token.Box → camino.Utf8PathBuf
Direction
syn.token uses camino. Changing camino can break syn.token, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
15→23 syn.token depends on proc_macro2.fallbackcycle✕
Type pairs
158 distinct (type in syn.token → type in proc_macro2.fallback) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
syn.token uses serviceradar_netprobe.capture.filter. Changing serviceradar_netprobe.capture.filter can break syn.token, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
15→31 syn.token depends on cargo_platform.cfgcycle✕
Type pairs
104 distinct (type in syn.token → type in cargo_platform.cfg) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Which types
syn.token.Abstract → cargo_platform.cfg.Token
syn.token.And → cargo_platform.cfg.Token
syn.token.AndAnd → cargo_platform.cfg.Token
syn.token.AndEq → cargo_platform.cfg.Token
syn.token.As → cargo_platform.cfg.Token
syn.token.Async → cargo_platform.cfg.Token
syn.token.At → cargo_platform.cfg.Token
syn.token.Auto → cargo_platform.cfg.Token
syn.token.Await → cargo_platform.cfg.Token
syn.token.Become → cargo_platform.cfg.Token
syn.token.Box → cargo_platform.cfg.Token
syn.token.Brace → cargo_platform.cfg.Token
syn.token.Bracket → cargo_platform.cfg.Token
syn.token.Break → cargo_platform.cfg.Token
syn.token.Caret → cargo_platform.cfg.Token
syn.token.CaretEq → cargo_platform.cfg.Token
syn.token.Colon → cargo_platform.cfg.Token
syn.token.Comma → cargo_platform.cfg.Token
syn.token.Const → cargo_platform.cfg.Token
syn.token.Continue → cargo_platform.cfg.Token
syn.token.Crate → cargo_platform.cfg.Token
syn.token.Default → cargo_platform.cfg.Token
syn.token.Do → cargo_platform.cfg.Token
syn.token.Dollar → cargo_platform.cfg.Token
syn.token.Dot → cargo_platform.cfg.Token
Direction
syn.token uses cargo_platform.cfg. Changing cargo_platform.cfg can break syn.token, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
15→37 syn.token depends on serde_derive.internals.attrcycle✕
Type pairs
105 distinct (type in syn.token → type in serde_derive.internals.attr) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
serviceradar_netprobe.kernel_layout uses aya_ebpf.maps.hash_map. Changing aya_ebpf.maps.hash_map can break serviceradar_netprobe.kernel_layout, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→4 syn.parse depends on memchr.arch.all.rabinkarp✕
Type pairs
1 distinct (type in syn.parse → type in memchr.arch.all.rabinkarp) reference.
gimli.read.rnglists uses serviceradar_netprobe.kernel_layout. Changing serviceradar_netprobe.kernel_layout can break gimli.read.rnglists, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→21 gimli.read.rnglists depends on object.build.table✕
Type pairs
2 distinct (type in gimli.read.rnglists → type in object.build.table) references.
proc_macro2.fallback uses cargo_platform.cfg. Changing cargo_platform.cfg can break proc_macro2.fallback, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
24→4 syn.item depends on memchr.arch.all.rabinkarp✕
Type pairs
42 distinct (type in syn.item → type in memchr.arch.all.rabinkarp) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
36 distinct (type in syn.item → type in proc_macro2.fallback) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
serviceradar_netprobe.capture.filter uses memchr.arch.all.rabinkarp. Changing memchr.arch.all.rabinkarp can break serviceradar_netprobe.capture.filter, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
30→11 serviceradar_netprobe.capture.filter depends on serde_json.ser✕
Type pairs
1 distinct (type in serviceradar_netprobe.capture.filter → type in serde_json.ser) reference.
cargo_platform.cfg uses serviceradar_netprobe.capture.filter. Changing serviceradar_netprobe.capture.filter can break cargo_platform.cfg, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
serde_derive.internals.ast uses serde_derive.internals.attr. Changing serde_derive.internals.attr can break serde_derive.internals.ast, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
36→2 object.read.traits depends on anyhow.context.private✕
Type pairs
6 distinct (type in object.read.traits → type in anyhow.context.private) references.
serde_derive.internals.attr uses serde_derive.internals.ast. Changing serde_derive.internals.ast can break serde_derive.internals.attr, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→37 __CRATE_NAME__ depends on serde_derive.internals.attr✕
Type pairs
1 distinct (type in __CRATE_NAME__ → type in serde_derive.internals.attr) reference.
32 distinct (type in gimli.read.dwarf → type in gimli.common) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2021 — Security Misconfiguration
297
REDACTED / Critical
A03:2021 — Injection
97
REDACTED / Critical
A06:2021 — Vulnerable & Outdated Components
74
REDACTED / Critical
A02:2021 — Cryptographic Failures
34
REDACTED / Critical
Roadmap
First, establish a solid page structure by adding essential semantic landmarks and ensuring proper heading order. Next, enforce accessibility standards across the development lifecycle by integrating linting, testing, and CI gates. Simultaneously, ensure all form controls and buttons have programmatic labels and maintain visual safety through visible focus styles, reduced motion support, and sufficient color contrast. Finally, harden the security posture by configuring response headers, prioritizing Content Security Policy, and ensuring these settings are included in the build container.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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.
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
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 — 178
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 — 3357
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 — 206
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 40
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
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 64 of 69 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 69 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3638 of 3741 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D4 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 924 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .rs (171,346 lines, 17% of production source), .go (159,354 lines, 16% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 983 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 2,458 test source file(s) (.exs, .py, .go, .rs, .ex) 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 — Watchdog 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 .ex, .rs, and the built-in reliability runner cannot re-run the .ex, .rs test suite(s) — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in elixir/web-ng/assets/ (972 tests)): measured (1 flaky); Go (10 modules): measured (0 flaky) suite(s) did re-run, and came back with 1 flaky across 2 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.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
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 (5 contributor(s) across 13993 commit(s) sampled, automation and bot accounts excluded). One of them holds 96% of the history; the other 4 hold 1% 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.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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/docusaurus.config.ts` 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.
D44 Platform End-of-Life — not measured this run — Watchdog 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (REDACTED, a Gemfile's ruby directive, a REDACTED) is simply not read here yet.
AX3 Project dependency cycles — not measured this run — Watchdog 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 is computed over which project references which — facts that live in .csproj references. This repository either commits no MSBuild project at all (its C# may still have been parsed as syntax-only projects, which carry no references between them) or its projects failed to load, so there was no graph to read. That is a gap in this analyzer's reach — not a finding that the repository is free of what this check looks for.
AX4 Dependency direction — not measured this run — Watchdog 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 is computed over the direction each project reference points — facts that live in .csproj references. This repository either commits no MSBuild project at all (its C# may still have been parsed as syntax-only projects, which carry no references between them) or its projects failed to load, so there was no graph to read. That is a gap in this analyzer's reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — Watchdog 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
AX8 Test isolation — not measured this run — Watchdog 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 is computed over which projects are test projects, and what they reference — facts that live in .csproj references. This repository either commits no MSBuild project at all (its C# may still have been parsed as syntax-only projects, which carry no references between them) or its projects failed to load, so there was no graph to read. That is a gap in this analyzer's reach — not a finding that the repository is free of what this check looks for.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog 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.
C3 Audit Trail — not measured this run — Watchdog 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 audit 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 audit controls.
C4 Data Retention — not measured this run — Watchdog 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 retention 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 retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog 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 data-subject rights 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 data-subject rights controls.
DM3 Integration-event coupling — not measured this run — Watchdog 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. Not scored — a domain type leaking across a crate boundary cannot be told apart from source alone from a legitimate shared-kernel crate. Reported as guidance rather than measured.
DM7 Repository granularity — not measured this run — Watchdog 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. Not scored — detecting 'a repository per CHILD entity' needs the aggregate-root structure, which is not resolvable from source alone here. Reported as guidance rather than measured.
ED5 Idempotency — not measured this run — Watchdog 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 95 further occurrence(s) are not listed individually; the score already reflects all 135.
X1 Async correctness — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X12 Unreachable branch — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X13 Undrained process stream — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X14 Bypassable address classification — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X16 Unfloored truncation loop — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X18 Disposal-pattern correctness — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X19 Unrestored process-global state — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X2 Cancellation propagation — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X20 Mistyped argument guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X21 Side-effecting pattern guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X22 Contradicted release guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X25 Inert configuration knob — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X26 Unsynchronised callback handoff — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X27 Collection changed while being enumerated — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X3 Exception handling — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X30 Support guard that admits what it rejects — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X4 Structured logging — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — 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.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D42 Runtime Threat Enforcement: Runtime enforcement is read from committed policy files — a Tetragon/Falco/Kyverno stack installed cluster-wide (Helm release, platform add-on) with no in-repo trace can't be credited, and a committed policy is declared intent, not proof the engine is running and blocking in the live cluster.
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.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
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.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (5): D19, D20, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
535 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was RemoteAccessSSHConsole.Component at 152. A further 62 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 srql::parser::entity::parse_entity at 82 — they are counted neither in the figure above nor in this dimension's score. 30 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: rust/srql/src/parser/entity.rs (srql::parser::entity::parse_entity at 82), rust/srql/src/query/viz/mod.rs (srql::query::viz::meta_for_plan at 73), rust/srql/src/query/engine.rs (QueryEngine::execute_query at 55), rust/rdp-adapter/src/backend_ironrdp/active_stage.rs (serviceradar_rdp_adapter::backend_ironrdp::active_stage::browser_key_to_set1_scancode_for_probe at 53), rust/srql/src/query/devices/stats/filters.rs (srql::query::devices::stats::filters::build_grouped_stats_filter_clause at 42), and 25 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.
+ 423 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 42 srql finding(s) in Cyclomatic Complexity — start with REDACTED (5), virtualization.rs (2), fields.rs (2). — One of this dimension's main actionable groups (42 warning-level).
Resolve the 6 serviceradar_netprobe finding(s) in Cyclomatic Complexity — start with kernel_layout.rs, mdns.rs, attribution.rs. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 4 serviceradar_netprobe_ebpf finding(s) in Cyclomatic Complexity — start with lib.rs (4). — One of this dimension's main actionable groups (4 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 615 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 34 srql finding(s) in Cognitive Complexity — start with REDACTED (5), starrocks.rs (4), virtualization.rs (2). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 15 serviceradar_netprobe finding(s) in Cognitive Complexity — start with mdns.rs (2), attribution.rs (2), kernel_layout.rs (2). — One of this dimension's main actionable groups (15 warning-level).
Resolve the 8 serviceradar_fieldsurvey_sidekick finding(s) in Cognitive Complexity — start with streams.rs (3), radio.rs (2), live_capture.rs (2). — One of this dimension's main actionable groups (8 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 314 FileTooLong finding(s) in God Classes — start with index.ex (24), show.ex (13), REDACTED (7). — One of this dimension's main actionable groups (314 warning-level).
Resolve the 104 TooManyFunctions finding(s) in God Classes — start with camera_media_session_tracker.ex (2), native_addon_importer.ex (2), ocsf.ex. — One of this dimension's main actionable groups (104 warning-level).
Resolve the 57 FunctionTooLong finding(s) in God Classes — start with REDACTED (4), timeseries_metrics.rs (4), RemoteAccessDesktopSession.jsx (3). — One of this dimension's main actionable groups (57 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
924 duplicated block group(s) detected. A further 36 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 960 are in trees this repository does not ship — vendored, example/demo, 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. Measured on part of this repository only: .rs, .go (32% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.
+ 157 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 103 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with index.ex (11), show.ex (3), telemetry.ex (3). — One of this dimension's main actionable groups (103 warning-level).
Resolve the 88 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with index.ex (9), callback_command_result_coordinator.ex (3), callback_command_dispatcher.ex (2). — One of this dimension's main actionable groups (88 warning-level).
Resolve the 66 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with show.ex (4), index.ex (4), callback_command_contract.ex (2). — One of this dimension's main actionable groups (66 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
What to do
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
8534 test methods: 7484 unit, 1046 integration, 0 BDD, 4 e2e. The JavaScript/TypeScript suite contributes 985 `it`/`test` case(s) across 110 test file(s) declaring at least one beside 22 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 4707 `#[test]` function(s) across 661 file(s) declaring at least one; its unit/integration split is Cargo's own — 182 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 220 test function(s) across 30 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 2600 test case(s) across 365 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 20 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
4 skipped (4 with a documented reason), 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 983 tests. Measured on the JavaScript/TypeScript suite only — at least 2,458 test source file(s) (.exs, .py, .go, .rs, .ex) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
82 outdated, 0 retired direct Hex dependencies, 4 pinning defect(s). 197 of 236 direct dependencies were graded against hex.pm (0 not published there, 39 not resolved by a committed lockfile). Whether any of these packages is UNMAINTAINED is not graded — hex.pm publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: a Hex app name does not determine the modules it provides (`ecto_sql` provides Ecto.Adapters.SQL), and a large idiomatic class of BEAM dependencies — runtime adapters, codec plugins, protocol implementations and OTP applications the release starts — is correctly declared and never referenced in source, so absence of a reference is not evidence of an unused dependency. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Unbounded dependency requirement: postgrex · ×2
No dependency lockfile committed (third_party/hex_vendored/boombox/mix.exs)
No dependency lockfile committed (third_party/hex_vendored/opentelemetry_oban/mix.exs)
Outdated: ash_cloak · ×82
What to do
Resolve the 2 Unbounded dependency requirement finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 No dependency lockfile committed (third_party/hex_vendored/boombox/mix.e… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No dependency lockfile committed (third_party/hex_vendored/opentelemetry… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 6 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 806 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 2 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum) and package.json, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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.
Top hotspots: elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js (10×91=910); elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js (16×49=784); elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex (37×15=555) Repeated repair below the complexity floor: elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex (21 of 33 changes were fixes); elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex (18 of 30 changes were fixes); elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex (17 of 26 changes were fixes)
Resolve the 149 Repeated repair finding(s) in Churn × Complexity Hotspots — start with config.ex (2), show.ex (2), loader.ex (2). — One of this dimension's main actionable groups (149 warning-level).
Resolve the 102 Hotspot finding(s) in Churn × Complexity Hotspots — start with show.ex (2), layout_elk_scene.js, rendering_graph_data_methods.js. — One of this dimension's main actionable groups (102 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
23 deducted task-comment markers across 1530627 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.
Resolve the 23 TodoComment finding(s) in Explicit Debt — start with bootstrap.go (4), spire.go (3), device.ex (2). — One of this dimension's main actionable groups (23 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
ServiceRadar's documentation is clear, complete, and well-structured: a single README with an impressive 135-word body plus architecture/Docs markdown covering the repository as one whole (missing-installation, missing-usage, missing-contributing, missing-license, missing-architecture-docs) but each of those documents in turn; the visible content is a strong overview, a Docker deployment guide, and configuration with validation semantics, while the outline names every section present. The README files are well organized by language (Go, Elixir, Docker, config), each carrying its own focused documentation. The repository's documentation is strong: the README files alone at 135 documents cover vendored hex packages (with a detailed unpacking/dependency-matching rule), the libcwalk C path library with cross-platform features and build docs, the bumblebee scanner vendoring guide, the SNMP trapd gRPC service with configuration, rperf-checker throughput testing, RDP connector probe, integration database fixture, config-bootstrap for unified config loading across components, and the StarRocks operator lab install plus sysctl, checksum, CNPG, JDBC, and catalog setup. The architecture/design docs (254 markdown files) are also present but not shown in this summary. All visible documents are clear and complete; the only unshown element is the full architecture doc set that would otherwise be flagged as missing. The repository's documentation is clear and complete for its audience — a README plus architecture/Docs markdown covering each project with an outline of contents, deployment details, usage examples, and contributor guidance. The SRQL fixture README describes the cluster namespace, credentials secrets, CNPG Cluster spec, cert-manager Issuer, CA bundle, LAN HTTPS, LoadBalancer, and maintenance steps; the SR testing README covers one-time self-signed cert generation, a single-replica NATS server with JetStream, TLS secret templates, kustomization, ExternalDNS annotations for public reachability, and client environment setup; the CNPG operator README records a snapshot of the deployment/controller/webhooks targeting cnpg-system, explains GitOps review baseline and conditional compatibility, and lists verified/unverified review baselines plus migration steps. All sections are present in the outline.
What to do
Improve Documentation Quality — currently 8.5/10. — ServiceRadar's documentation is clear, complete, and well-structured: a single README with an impressive 135-word body plus architecture/Docs markdown covering the repository as one whole (missing-installation, missing-usage, missing-contributing, missing-license, missing-architecture-docs) but each of those documents in turn; the visible content is a strong overview, a Docker deployment guide, and configuration with validation semantics, while the outline names every section present. The README files are well organized by language (Go, Elixir, Docker, config), each carrying its own focused documentation. The repository's documentation is strong: the README files alone at 135 documents cover vendored hex packages (with a detailed unpacking/dependency-matching rule), the libcwalk C path library with cross-platform features and build docs, the bumblebee scanner vendoring guide, the SNMP trapd gRPC service with configuration, rperf-checker throughput testing, RDP connector probe, integration database fixture, config-bootstrap for unified config loading across components, and the StarRocks operator lab install plus sysctl, checksum, CNPG, JDBC, and catalog setup. The architecture/design docs (254 markdown files) are also present but not shown in this summary. All visible documents are clear and complete; the only unshown element is the full architecture doc set that would otherwise be flagged as missing. The repository's documentation is clear and complete for its audience — a README plus architecture/Docs markdown covering each project with an outline of contents, deployment details, usage examples, and contributor guidance. The SRQL fixture README describes the cluster namespace, credentials secrets, CNPG Cluster spec, cert-manager Issuer, CA bundle, LAN HTTPS, LoadBalancer, and maintenance steps; the SR testing README covers one-time self-signed cert generation, a single-replica NATS server with JetStream, TLS secret templates, kustomization, ExternalDNS annotations for public reachability, and client environment setup; the CNPG operator README records a snapshot of the deployment/controller/webhooks targeting cnpg-system, explains GitOps review baseline and conditional compatibility, and lists verified/unverified review baselines plus migration steps. All sections are present in the outline.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR QualityExemplary◐ Sampled · advisory
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyAdequate◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
4 API inconsistencies across a 400-member sample of 3319 exposed types.
Inconsistent return types for equivalent operations: ArrowArrayHolderImpl and ImportArrayHolder return [Data] directly, while ChunkedArrayHolder returns Result<[Data], ArrowError>. This forces consumers to handle errors differently depending on which holder type they are interacting with, despite the operation (getting buffer data) being conceptually the same. · ×2
Duplicate intent: Two distinct types (ArrowArrayHolderImpl and ImportArrayHolder) expose identical methods with identical signatures for constructing an ArrowColumn. These types appear to serve similar wrapper roles for Arrow data (one likely for internal implementation, one for C-Data import), yet they duplicate the public API surface for column construction.
Inconsistent naming for string conversion: While most arrays use asString, the presence of TimestampArray.formattedDate suggests a split in string representation strategies. More importantly, asString is used for both binary data (BinaryArray) and logical types (TimestampArray, NestedArray), which can be ambiguous. However, the primary inconsistency is that ChunkedArray also has asString, but it operates on a collection of arrays. If the intent is 'convert this specific element to string', the naming is consistent, but the semantic meaning of 'asString' varies wildly between Binary (hex/utf8?) and Timestamp (formatted date?).
What to do
Resolve the 2 Inconsistent return types for equivalent operations finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Duplicate intent finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Inconsistent naming for string conversion finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED 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 REDACTED. 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.
27 finding(s): 0 critical, 27 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 27 REDACTED finding(s) in Secrets (history) — start with REDACTED (5), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (27 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
97 finding(s): 0 critical, 47 high, 15 medium, 35 low. 13 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 108 file(s) — `buildbuddy_setup_fixture_env.sh` (lines 41–403), `config/proto_bindings/go/config.pb.go`, `docker/compose/bootstrap-admin.sh` (line 61), `docker/compose/tools-profile.sh` (line 60), `docs/docusaurus.config.ts` (line 89, line 106, line 227), … (+103 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 17 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 35 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (35 recommendation-level).
Resolve the 34 REDACTED finding(s) charged to Static Analysis (SAST) — the other 13 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 (47 issue-level, 34 of them charged here).
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir/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, Go, Java and Kotlin via Maven/Gradle, 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.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 24 REDACTED CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (16), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (24 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 176 REDACTED IaC finding(s) in IaC & Container Security — start with REDACTED (18), REDACTED (18), REDACTED (15). — One of this dimension's main actionable groups (176 warning-level).
Resolve the 64 REDACTED IaC finding(s) in IaC & Container Security — start with REDACTED (10), REDACTED (10), REDACTED (7). — One of this dimension's main actionable groups (64 recommendation-level).
Resolve the 57 REDACTED IaC finding(s) in IaC & Container Security — start with REDACTED (20), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (57 issue-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 3000 of the 4412 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with catalog_allowlist.ex, rows.ex. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 4 Change coupling finding(s) in Change Coupling — start with engine.rs, sweep_service.go, attribution.rs. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the Kubernetes deployment wires runtime threat enforcement — a detection engine (Tetragon/Falco) and/or an admission-control policy gate (Kyverno / OPA Gatekeeper / PodSecurity). Presence of committed policy, not a runtime guarantee.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a runtime threat-detection engine (Tetragon TracingPolicy / Falco) and an admission-control policy (Kyverno / OPA Gatekeeper / PodSecurity). Reward-leaning; NotApplicable without workloads. Deterministic.
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. Scored 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. SCORED, not informational.
No dependency in any ecosystem this repository declares is published as malicious.
✓ On the Gold path — maintain.
Detailed fixes: d43_recommendation.md.
Do you agree with this assessment?
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.
Do you agree with this assessment?
AC2 · Forms & labels6.7 / 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.
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×6) — elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1145, elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1188, elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1482, …
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. (×2) — js/cli/templates/react-map/src/main.jsx:103, js/cli/templates/react-table/src/main.jsx:42
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.
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.
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — elixir/web-ng/lib/serviceradar_web_ng_web/components/layouts/root.html.heex:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×4) — elixir/web-ng/lib/serviceradar_web_ng_web/components/layouts/root.html.heex:2, openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2, …
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.
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: interactive elements plus elements the markup gives a click/key handler or the repo's own CSS styles `cursor: pointer`, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). 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".
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.
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.
`[data-theme="light"] .sr-mtr-radial` sets color: #059669 on background-color: #e2e8f0 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — elixir/web-ng/assets/css/app.css:6322
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 37 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
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.
Other · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`ActiveStageSessionProbe.session_binding_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — rust/rdp-adapter/src/backend_ironrdp/active_session.rs:26
`ActiveStageSessionProbe.media_session_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — rust/rdp-adapter/src/backend_ironrdp/active_session.rs:27
What to do
Adopt the repo's newtype typed-id idiom consistently — wrap every entity identity in its own newtype.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Other · Event-Driven — Whether event handlers stay asynchronous (no blocking remote HTTP/gRPC calls awaited inside a handler).
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
Do you agree with this assessment?
ED3 · Event naming7.0 / 10Strong✓ Tool-verified
Other · Event-Driven — Whether events are named in the past tense (a clarity nudge — low weight).
Method: Roslyn scan (event-driven gated): domain and integration events checked for past-tense naming (-ed/-en suffix or irregular set). Naming nudge, low-weight advisory.
`AccountLimits` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — go/pkg/nats/accounts/account_manager.go:44
`SubjectMapping` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — go/pkg/nats/accounts/account_manager.go:55
`StreamExport` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — go/pkg/nats/accounts/account_manager.go:61
`StreamImport` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — go/pkg/nats/accounts/account_manager.go:67
`UserPermissions` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — go/pkg/nats/accounts/user_manager.go:37
`UserCredentials` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — go/pkg/nats/accounts/user_manager.go:47
`SuiteEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — third_party/netprobe_ebpf_vendor/cargo_metadata/src/libtest.rs:11
`TestEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — third_party/netprobe_ebpf_vendor/cargo_metadata/src/libtest.rs:53
What to do
Name events in the past tense — they record facts that already happened.
Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.
Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 50 of 76 project(s) that lack one — worth up to 1.3 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Dependabot is configured but does not watch `npm`, `gitsubmodule` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
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.
Do you agree with this assessment?
P5 · DR & Backup10.0 / 10Exemplary✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
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.
Do you agree with this assessment?
R1 · Type Safety10.0 / 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.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.
14 duplicated blocks under elixir/web-ng/assets/js/ have copies in at least two of the sibling directories dashboards, hooks, lib, netflow_charts, utils, wasm — 9 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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. — REDACTED:820
7 duplicated blocks under js/cli/src/ have copies in at least two of the sibling directories auth, dashboard, notifications, plugin — 4 of them are reported below, and 3 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 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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. — js/cli/src/dashboard/init.ts:16
elixir/web-ng/assets/js/hooks/charts/TimeseriesChart.js:9 · elixir/web-ng/assets/js/hooks/charts/TimeseriesCombinedChart.js:11 — the two spans are one implementation copied and then locally edited — 876 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. — elixir/web-ng/assets/js/hooks/charts/TimeseriesChart.js:9
elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:167 · elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:124 — the two spans are one implementation copied and then locally edited — 391 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. — elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:167
js/cli/src/dashboard/init.ts:16 · js/cli/src/plugin/init.ts:16 — the two spans are one implementation copied and then locally edited — 444 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. — js/cli/src/dashboard/init.ts:16
elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:99 · elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:61 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:99
elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:213 · elixir/web-ng/assets/js/dashboards/service_availability_noc.js:179 — the two spans are one implementation copied and then locally edited — 297 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. — elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:213
elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:121 · elixir/web-ng/assets/js/hooks/charts/NetflowLineSeriesChart.js:24 — the two spans are one implementation copied and then locally edited — 399 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. — elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:121
elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:85 · elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:3 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:85
elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:128 · elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:370 — 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. — elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:128
elixir/web-ng/assets/js/lib/camera_relay/player.js:277 · elixir/web-ng/assets/js/lib/camera_relay/player.js:403 — the two spans are one implementation copied and then locally edited — 191 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. — elixir/web-ng/assets/js/lib/camera_relay/player.js:277
elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:129 · elixir/web-ng/assets/js/hooks/charts/FlowSparkline.js:15 — the two spans are one implementation copied and then locally edited — 223 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. — elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:129
elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:8 · elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:8 — 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. — elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:8
elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:10 · REDACTED:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:10
elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:401 · REDACTED:805 — 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. — elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:401
REDACTED:104 · js/cli/harness/harness.js:193 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:104
elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:6 · elixir/web-ng/assets/js/hooks/charts/NetflowTalkersIcicle.js:104 — the two spans are one implementation copied and then locally edited — 148 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. — elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:6
elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:36 · elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:83 — 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. — elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:36
elixir/web-ng/assets/js/hooks/JdmEditorHook.js:91 · elixir/web-ng/assets/js/hooks/JdmEditorHook.js:143 — 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. — elixir/web-ng/assets/js/hooks/JdmEditorHook.js:91
elixir/web-ng/assets/js/hooks/charts/BGPTimeSeriesChart.js:159 · elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:236 — the two spans are one implementation copied and then locally edited — 130 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. — elixir/web-ng/assets/js/hooks/charts/BGPTimeSeriesChart.js:159
js/cli/src/validation.ts:158 · js/cli/src/validation.ts:252 — 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. — js/cli/src/validation.ts:158
elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:6 · elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:6 — 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. — elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:6
elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:82 · elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:615 — the two spans are one implementation copied and then locally edited — 138 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. — elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:82
elixir/web-ng/assets/js/hooks/charts/FlowDonut.js:19 · elixir/web-ng/assets/js/hooks/charts/FlowSparkline.js:11 — 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. — elixir/web-ng/assets/js/hooks/charts/FlowDonut.js:19
elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:24 · elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:105 — the two spans are one implementation copied and then locally edited — 218 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. — elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:24
elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:64 · elixir/web-ng/assets/js/hooks/charts/NetflowTalkersIcicle.js:102 — the two spans are one implementation copied and then locally edited — 92 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. — elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:64
elixir/web-ng/assets/js/lib/srql/tokenizer.js:210 · elixir/web-ng/assets/js/lib/srql/tokenizer.js:255 — 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. — elixir/web-ng/assets/js/lib/srql/tokenizer.js:210
elixir/web-ng/assets/js/lib/srql/tokenizer.js:78 · elixir/web-ng/assets/js/lib/srql/tokenizer.js:213 · elixir/web-ng/assets/js/lib/srql/tokenizer.js:258 — 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. — elixir/web-ng/assets/js/lib/srql/tokenizer.js:78
REDACTED:471 · REDACTED:498 — 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:471
elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:13 · elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:36 · elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:13 — 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. — elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:13
elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:8 · elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:77 — the two spans are one implementation copied and then locally edited — 87 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. — elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:8
elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:87 · elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:128 — the two spans are one implementation copied and then locally edited — 268 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:87
elixir/web-ng/assets/js/utils/window_events.js:26 · elixir/web-ng/assets/js/utils/window_events.js: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. — elixir/web-ng/assets/js/utils/window_events.js:26
js/cli/harness/dev.js:284 · js/cli/harness/harness.js:233 — 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. — js/cli/harness/dev.js:284
REDACTED:1611 · elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:124 — 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. — REDACTED:1611
elixir/web-ng/assets/js/hooks/SRQLInput.js:48 · elixir/web-ng/assets/js/hooks/SRQLInput.js:93 — the two spans are one implementation copied and then locally edited — 156 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. — elixir/web-ng/assets/js/hooks/SRQLInput.js:48
elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:274 · elixir/web-ng/assets/js/hooks/charts/NetflowTrafficTooltip.js:128 — the two spans are one implementation copied and then locally edited — 136 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. — elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:274
elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:551 · elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:687 — 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. — elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:551
elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:3 · elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:20 · elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:3 — 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. — elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:3
elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:81 · elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:34 — 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. — elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:81
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · 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.
elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:4 reaches into another package with a relative path (../../js/utils/user_time) — import the package by name instead. — elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:4
elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:21 reaches into another package with a relative path (../../js/utils/user_time) — import the package by name instead. — elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:21
elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:3 reaches into another package with a relative path (../../js/lib/remote_desktop/control_frame.js) — import the package by name instead. — elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:3
elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:10 reaches into another package with a relative path (../../js/lib/remote_desktop/renderer_state.js) — import the package by name instead. — elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:10
elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:11 reaches into another package with a relative path (../../js/lib/remote_desktop/renderer_runtime.js) — import the package by name instead. — elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:11
elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:12 reaches into another package with a relative path (../../js/lib/remote_desktop/webrtc_client.js) — import the package by name instead. — elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:12
elixir/web-ng/assets/component/src/SrqlEditor.jsx:2 reaches into another package with a relative path (../../js/lib/srql/monaco_srql.js) — import the package by name instead. — elixir/web-ng/assets/component/src/SrqlEditor.jsx:2
elixir/web-ng/assets/js/hooks/DashboardBuilderCanvas.js:4 reaches into another package with a relative path (../../component/src/DashboardBuilderCanvas.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/DashboardBuilderCanvas.js:4
elixir/web-ng/assets/js/hooks/DashboardPanelChart.js:4 reaches into another package with a relative path (../../component/src/DashboardPanelChart.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/DashboardPanelChart.js:4
elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:4 reaches into another package with a relative path (../../component/src/RemoteAccessApplication.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:4
elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:4 reaches into another package with a relative path (../../component/src/RemoteAccessDesktopSession.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:4
elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:6 reaches into another package with a relative path (../../component/src/RemoteAccessSSHConsole.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:6
elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:4 reaches into another package with a relative path (../../component/src/RemoteAccessTCPText.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:4
elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:6 reaches into another package with a relative path (../../component/src/RemoteAccessTerminal.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:6
elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:6 reaches into another package with a relative path (../../component/src/RemoteConsoleTerminal.jsx) — import the package by name instead. — elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:6
elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:1 imports elkjs/lib/elk.bundled.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. — elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:1
js/cli/src/validation.ts:93 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. — js/cli/src/validation.ts:93
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
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.
validateTopologyScene has cyclomatic complexity 91 and cognitive complexity 152; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1030
validateTopologyOverview has cyclomatic complexity 62 and cognitive complexity 81; 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. — elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:395
renderSelectionDetails has cyclomatic complexity 60 and cognitive complexity 53; 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. — elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:49
_draw has cyclomatic complexity 53 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 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. — elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:25
(anonymous) has cyclomatic complexity 49 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. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:436
_showFlowDetails has cyclomatic complexity 44 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. — elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1484
(anonymous) has cyclomatic complexity 44 and cognitive complexity 28; 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. — elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1599
(anonymous) has cyclomatic complexity 43 and cognitive complexity 31; 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. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:304
buildVisibleGraphData has cyclomatic complexity 42 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 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. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:140
(anonymous) has cyclomatic complexity 42 and cognitive complexity 37; 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. — elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:211
buildPacketFlowInstances has cyclomatic complexity 39 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:20
Component has cyclomatic complexity 36 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 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. — elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386
(anonymous) has cyclomatic complexity 36 and cognitive complexity 24; 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. — elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1886
handleSnapshot has cyclomatic complexity 34 and cognitive complexity 35; 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. — elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:77
getNodeTooltip has cyclomatic complexity 34 and cognitive complexity 35; 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. — elixir/web-ng/assets/js/lib/god_view/rendering_tooltip_methods.js:75
applyCommand has cyclomatic complexity 32 and cognitive complexity 53; 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. — js/cli/src/plugin/apply.ts:70
runDeviceCodeFlow has cyclomatic complexity 32 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 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. — js/cli/src/auth/login.ts:62
decodeArrowGraph has cyclomatic complexity 31 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 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. — elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_decode_methods.js:17
publishCommand has cyclomatic complexity 31 and cognitive complexity 30; 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. — js/cli/src/dashboard/publish.ts:19
_applyBrandBasemapTint has cyclomatic complexity 30 and cognitive complexity 36; 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. — elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:192
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files4.9 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
27 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js (1699), REDACTED (1622), elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx (1347), elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js (1187), elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js (1164), elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx (911) (+21 more).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage8.8 / 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. (×24) — elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js, js/cli/harness/harness.js, js/cli/harness/dev.js, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ 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.
Do you agree with this assessment?
R7 · Dead Code10.0 / 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.
258 file(s) (~60216 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: elixir/web-ng/assets/js/app.js imports '../vendor/topbar', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — elixir/web-ng/assets
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. — elixir/web-ng/assets/js/utils/chart_axis_grid.test.js:1
Declared in elixir/web-ng/assets/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. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. 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.
No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — docker/compose/Caddyfile:11
What to do
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Do you agree with this assessment?
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).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 1 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X9 Subsumed condition operand — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit 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 audit 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.
C4 Data Retention — Not assessed: these retention 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 retention 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.
C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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.
Not included — 65 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 — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — 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.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half has no runner
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.
D23 Boundary Type-Coupling — Production source is present (.erl, .ex, .exs, .go, .py, .rb, .rs, .swift, .ts, .tsx) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — none of 1 ADRs are conformance-checkable — unverifiable.
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a CS/VB/GO/SCALA/SWIFT/DART class graph, and this repository's production source is .c, .cc, .erl, .ex, .exs, .mm, .py, .rb, .rs, .ts, .tsx, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — elixir/web-ng/assets/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM3 Integration-event coupling — not scored — a domain type leaking across a crate boundary cannot be told apart from source alone from a legitimate shared-kernel crate. Reported as guidance rather than measured
DM7 Repository granularity — not scored — detecting 'a repository per CHILD entity' needs the aggregate-root structure, which is not resolvable from source alone here. Reported as guidance rather than measured
ED2 Event/command shape — no command-shaped messages detected — single-handler-per-command check not applicable
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from 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
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — 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
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — 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
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — 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
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X31 Test-only surface in a production module — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
AC2 · Forms & labels· <input> without a programmatic label · ×6
<input> without a programmatic label elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1145— 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 elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1188— 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 elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1482— 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 elixir/web-ng/assets/component/src/SrqlEditor.jsx:69— 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 js/cli/templates/react-map/src/main.jsx:103— 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 js/cli/templates/react-table/src/main.jsx:42— 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.
Boundary-crossing change coupling: catalog_allowlist.ex ↔ starrocks.rs elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/catalog_allowlist.ex— `elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/catalog_allowlist.ex` (context elixir) and `rust/srql/src/query/starrocks.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `7f700c8b` no-mistakes(review): Match CNPG log and event filters on StarRocks; `0ce9d340` feat(srql): resolve flow country breakdowns on StarRocks through the …; `c7974667` no-mistakes(review): Write flow SNMP columns, join interface cache, g… — run `git show` on any of them.
Boundary-crossing change coupling: rows.ex ↔ starrocks.rs elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex— `elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex` (context elixir) and `rust/srql/src/query/starrocks.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `7f700c8b` no-mistakes(review): Match CNPG log and event filters on StarRocks; `e542da1d` fix(srql): StarRocks parity for logs and events rollups and filters; `c7974667` no-mistakes(review): Write flow SNMP columns, join interface cache, g… — run `git show` on any of them.
DM2 · Strongly-typed ids· Raw-primitive id despite a typed-id idiom · ×2
Raw-primitive id despite a typed-id idiom: ActiveStageSessionProbe.session_binding_id rust/rdp-adapter/src/backend_ironrdp/active_session.rs:26— `ActiveStageSessionProbe.session_binding_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ActiveStageSessionProbe.media_session_id rust/rdp-adapter/src/backend_ironrdp/active_session.rs:27— `ActiveStageSessionProbe.media_session_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label elixir/web-ng/assets/component/src/SrqlEditor.jsx:78— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <select> without a programmatic label · ×1
<select> without a programmatic label js/cli/templates/react-table/src/main.jsx:49— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC3 · Page structure· Document without a <title> · ×1
Document without a <title> elixir/web-ng/lib/serviceradar_web_ng_web/components/layouts/root.html.heex:2— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Flaky test: elixir/web-ng/assets/god_view_production_bundle_contract.test.js::God-View production module graph contains neither acceptance global nor the acceptance snapshot publisher — Passed 2×, failed 1× across repeated runs.
Unlisted import 'd3-scale' elixir/web-ng/assets/js/utils/chart_axis_grid.test.js:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
FileTooLong: log_live/index.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex— FileTooLong — 8628 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 416 functions. The bar is 500 significant lines; this is 8128 over it, 17.26× 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: topology/god_view_stream.ex elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex— FileTooLong — 4975 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 397 functions. The bar is 500 significant lines; this is 4475 over it, 9.95× 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: plugin_package_live/index.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex— FileTooLong — 4831 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 259 functions. The bar is 500 significant lines; this is 4331 over it, 9.66× 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: network_discovery/mapper_results_ingestor.ex elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex— FileTooLong — 3340 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 277 functions. The bar is 500 significant lines; this is 2840 over it, 6.68× 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: integrations_live/index.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex— FileTooLong — 3136 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 100 functions. The bar is 500 significant lines; this is 2636 over it, 6.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: event_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex— FileTooLong — 2714 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 144 functions. The bar is 500 significant lines; this is 2214 over it, 5.43× 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: settings/network_credential_rules_live.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex— FileTooLong — 2545 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 143 functions. The bar is 500 significant lines; this is 2045 over it, 5.09× 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: edge/agent_config_generator.ex elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex— FileTooLong — 2544 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 200 functions. The bar is 500 significant lines; this is 2044 over it, 5.09× 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: awx/main.go go/cmd/wasm-plugins/awx/main.go— FileTooLong — 2541 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2041 over it, 5.08× 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: addon_package_live/index.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex— FileTooLong — 2531 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 143 functions. The bar is 500 significant lines; this is 2031 over it, 5.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ansible/callback_command_result_coordinator.ex elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex— FileTooLong — 2319 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 113 functions. The bar is 500 significant lines; this is 1819 over it, 4.64× 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: notifications/dispatcher.ex elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex— FileTooLong — 2304 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 190 functions. The bar is 500 significant lines; this is 1804 over it, 4.61× 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: processors/analytics_signals.ex elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex— FileTooLong — 2112 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 173 functions. The bar is 500 significant lines; this is 1612 over it, 4.22× 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: edge/agent_command_bus.ex elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex— FileTooLong — 2107 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 171 functions. The bar is 500 significant lines; this is 1607 over it, 4.21× 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: srql/catalog.ex elixir/web-ng/lib/serviceradar_web_ng_web/srql/catalog.ex— FileTooLong — 2102 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1602 over it, 4.20× 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: device_live/endpoint_inventory_components.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_components.ex— FileTooLong — 2062 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 98 functions. The bar is 500 significant lines; this is 1562 over it, 4.12× 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: src/attribution.rs rust/netprobe/src/attribution.rs— FileTooLong — 2012 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 1512 over it, 4.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: agents_live/releases.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex— FileTooLong — 1990 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 111 functions. The bar is 500 significant lines; this is 1490 over it, 3.98× 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: interface_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex— FileTooLong — 1983 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 92 functions. The bar is 500 significant lines; this is 1483 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: serviceradar_web_ng/field_survey_review.ex elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex— FileTooLong — 1919 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 147 functions. The bar is 500 significant lines; this is 1419 over it, 3.84× 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: inventory/endpoint_vulnerability_matcher.ex elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex— FileTooLong — 1910 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 119 functions. 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: query/timeseries_metrics.rs rust/srql/src/query/timeseries_metrics.rs— FileTooLong — 1882 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 69 free functions. The bar is 500 significant lines; this is 1382 over it, 3.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.
FileTooLong: device_live/anomaly_capacity_components.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex— FileTooLong — 1847 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 129 functions. The bar is 500 significant lines; this is 1347 over it, 3.69× 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: alert_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex— FileTooLong — 1833 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 100 functions. The bar is 500 significant lines; this is 1333 over it, 3.67× 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: agent_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex— FileTooLong — 1826 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 109 functions. The bar is 500 significant lines; this is 1326 over it, 3.65× 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex:721— elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex changed 33 times in last 90 days and 21 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is Config.protocol_valid_nats_subject? at line 721), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(serviceradar_core): correct identifier lookups and Dialyzer contracts (#358)”; “fix(k8s): review round 2 partial — node+role titles, clearable fire-test, stream wiring”; “fix(event-writer): bind SFLOW_RAW/NETFLOW_RAW to the flows stream (#4096)”; “fix(event_writer): a failed flow backlog drain must not kill the live pipeline”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:704— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex changed 30 times in last 90 days and 18 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Show.log_message_hero at line 704), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): format log detail show.ex”; “fix(web-ng): show collector target and error on log detail”; “fix(web-ng): reject unzoned display timestamps”; “fix(web-ng): close observability timestamp gaps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex:555— elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex changed 26 times in last 90 days and 17 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is DeviceWrites.resolve_record_active_ip at line 555), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(serviceradar_core): make integration identity admission provider-neutral (#357)”; “no-mistakes(ci): Fixed adoption across incompatible identifier scopes or conflicting hardware serials, and corrected two NetBox test setups that ingestion rejected for missing IPs. Formatting, diff checks, and direct DeviceWrites compilation pass. Full compilation encounters an unrelated Oban warning; integration tests require BuildBuddy fixture verification”; “fix(inventory): converge strong-identified sync records on hostname agreement”; “fix(inventory): scope active-IP conflict resolution by partition”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:693— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex changed 26 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is AgentConfigGenerator.prepare_direct_leaf_params at line 693), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(netbox): deliver one assignment per NetBox instance, on a query that resolves”; “fix(core): group build_snmp_oid_config clauses”; “fix(plugins): log why a plugin assignment was skipped”; “fix(notifications): address PR 4910 review findings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/feed_worker.ex elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/feed_worker.ex:585— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/feed_worker.ex changed 17 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is FeedWorker.do_run at line 585), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(vulnerability): bound feed ingestion and seed scalar distro assertions”; “fix(vulnerability): make package matching distro aware”; “fix(feeds): skip unchanged KEV advisories”; “fix(feeds): preserve advisory feed successors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/feed_worker.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex:1238— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex changed 23 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is AnomalyCapacityComponents.interface_label at line 1238), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(anomalies): confirm adjacent seasonal windows and migrate legacy state (#485)”; “fix(anomaly): arm the drift anchor on a mature window, report the drift level, exit on SIGTERM (#438)”; “fix(web-ng): read the drift payload from unmapped.anomaly on live event rows (#429)”; “fix(web-ng): sort device anomaly findings by selected sort order (#367)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:3389— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex changed 17 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is MapperResultsIngestor.explicit_topology_confidence at line 3389), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(inventory): exclude VRRP MACs from device identity”; “fix(identity): do not glue distinct hardware from mixed L2 IP+MAC”; “fix(inventory): lockstep interface PK and fail-closed link-local readers”; “fix(inventory): persist current-state interfaces and drop link-local alias evidence”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync_worker.ex elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync_worker.ex:61— elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync_worker.ex changed 15 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is NativeAddonSyncWorker.perform at line 61), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(plugins): do not re-filter fallback feed by the missing deployed tag”; “fix(plugins): first-party sync tolerates unpublished deployed release tag”; “fix(web-ng): let a verified import replace an unverified seeder placeholder”; “fix(web-ng): import first-party plugins and add-ons from GitHub Releases”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync_worker.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/event_writer/pipeline.ex elixir/serviceradar_core/lib/serviceradar/event_writer/pipeline.ex:375— elixir/serviceradar_core/lib/serviceradar/event_writer/pipeline.ex changed 21 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is Pipeline.build_batchers at line 375), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(event-writer): register :flow_attribution Broadway batcher”; “fix(netflow): address PR 4909 re-review at 0c404363”; “fix(netflow): address PR 4909 re-review at fda6e98c”; “fix(netflow): address PR 4909 re-review at 51877a6d”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/event_writer/pipeline.ex`: 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.
Repeated repair: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:384— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex changed 16 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is AgentGatewayServer.push_status at line 384), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: harden retained stream lifecycle”; “fix: scope retained delivery negotiation”; “fix: make retained status acknowledgements truthful”; “fix(sweep): enforce scalable assignment authority”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex:254— elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex changed 13 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is Producer.handle_info at line 254), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(event-writer): classify best-effort setup failures”; “fix(event-writer): bind SFLOW_RAW/NETFLOW_RAW to the flows stream (#4096)”; “fix(event_writer): a failed flow backlog drain must not kill the live pipeline”; “fix(event-writer): expire stale JetStream pull inflight (#3764)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/prefix_tags/store.ex elixir/serviceradar_core/lib/serviceradar/prefix_tags/store.ex:129— elixir/serviceradar_core/lib/serviceradar/prefix_tags/store.ex changed 15 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is Store.put_rows at line 129), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): prune inactive provider CIDR snapshots and skip unchanged trie reloads”; “fix(core): prevent prefix tag trie reload storms”; “fix(prefix-tags): address follow-up review regressions”; “fix(prefix-tags): resolve final PR review findings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/prefix_tags/store.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex:221— elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex changed 12 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Manual.create_active_manual_snapshot! at line 221), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): knock out farm01 settings/SRQL/onboarding bugs”; “revert: undo dialyzer PR #4677 churn on serviceradar_core”; “fix(core): cut dialyzer baseline by fixing URI/MapSet opacity cascades”; “fix(prefix-tags): address follow-up review regressions”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:469— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex changed 15 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Show.load_stream_page at line 469), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): restore Dialyzer quality contract and correct runtime errors (#356)”; “fix(web-ng): hook offset-less alert timestamps in the stream”; “fix(web-ng): name anomaly alerts by metric and identity”; “fix(web-ng): unique timezone picker IDs and alert stream UTC parse”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex:262— elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex changed 14 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is Loader.do_reload at line 262), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): knock out farm01 settings/SRQL/onboarding bugs”; “fix(core): prevent prefix tag trie reload storms”; “fix(prefix-tags): address follow-up review regressions”; “fix(prefix-tags): resolve final PR review findings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:74— elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex changed 12 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is JetstreamConsumer.existing_deliver_policy at line 74), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(event-writer): bind SFLOW_RAW/NETFLOW_RAW to the flows stream (#4096)”; “fix(notifications): address PR 4910 review findings”; “fix(elixir): restore mix format --check-formatted on staging”; “fix(netflow): address PR 4909 re-review at 0d70ccf0”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/cluster/startup_migrations.ex elixir/serviceradar_core/lib/serviceradar/cluster/startup_migrations.ex:1296— elixir/serviceradar_core/lib/serviceradar/cluster/startup_migrations.ex changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is StartupMigrations.admin_connection_attempts at line 1296), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(serviceradar_core): honor configured migration ledger during bootstrap (#323)”; “fix(tests): isolate the integration suite and stop masking failures”; “fix(platform): eliminate recurring farm log failures”; “fix(bootstrap): skip identity sequences in the ownership sweep”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/cluster/startup_migrations.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:285— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex changed 14 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is SweepResultsIngestor.reporter_expectation at line 285), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sweep): enforce scalable assignment authority”; “fix(sweep): require authenticated execution owners”; “fix(sweep): require authenticated execution ownership”; “fix(sweep): quarantine stale and untrusted results”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index/events_panel.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index/events_panel.ex:264— elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index/events_panel.ex changed 13 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is EventsPanel.event_axis_style at line 264), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): stop the last two Events Over Time axis labels overlapping”; “fix(web-ng): make the dashboard Events Over Time axes readable on long windows”; “fix(timezone): finalize localized UI timestamp contracts”; “fix(web-ng): replace hydrated event range state”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index/events_panel.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:154— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex changed 13 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is AnomalyCapacityData.load_first at line 154), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(anomalies): confirm adjacent seasonal windows and migrate legacy state (#485)”; “Fix device detail loading and anomaly lifecycle UX”; “fix: close anomaly flapping re-review gaps”; “Fix staging merge validation fallout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:74— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Timeseries.update at line 74), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): label a 90 day sysmon axis with months”; “fix(web-ng): use Hex permit_ecto for release build”; “fix(web-ng): address CPU chart review nits”; “fix(web-ng): make CPU core drilldown readable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:317— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Loader.validate_record! at line 317), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(vulnerability): bound feed ingestion and seed scalar distro assertions”; “fix(vulnerability): make package matching distro aware”; “fix(feeds): address advisory review findings”; “fix(feeds): canonicalize KEV advisory hashes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/sections.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/sections.ex:31— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/sections.ex changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is Sections.build_cpu_section at line 31), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): long and custom metric windows read history that exists, and say what they show”; “Fix device detail loading and anomaly lifecycle UX”; “fix(sysmon): honor high-res sample_interval + range-sized chart buckets + merge metric continuity”; “fix(web-ng): address CPU chart review nits”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/sections.ex`: 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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1055— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is ArmisUnmerge.apply_split at line 1055), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “revert: undo dialyzer PR #4677 churn on serviceradar_core”; “fix(core): dialyzer wave 2 — SPIFFE/gRPC, MapSet opacity, identity types”; “fix(core): cut dialyzer baseline by fixing URI/MapSet opacity cascades”; “fix(identity): close Armis remediation convergence gaps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex`: 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.
Repeated repair: elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:394— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is FlowData.protocol_label at line 394), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web-ng): read the throughput sparkline and device flow probes from the warehouse when flows are cut over”; “fix(srql): scope device flow queries by resolved addresses, not device_id”; “fix(web-ng): stop dropping the flow summary, and make the sparkline visible”; “fix(web-ng): keep count_distinct out of the flow summary aggregate query”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex`: 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.
TooManyFunctions: OCSF elixir/serviceradar_core/lib/serviceradar/event_writer/ocsf.ex:1— TooManyFunctions — 78 functions. The bar is 30 functions; this is 48 over it, 2.60× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: NotificationCredentialRequirement elixir/serviceradar_core/lib/serviceradar/plugins/notification_credential_requirement.ex:1— TooManyFunctions — 58 functions. The bar is 30 functions; this is 28 over it, 1.93× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Slack elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex:1— TooManyFunctions — 54 functions. The bar is 30 functions; this is 24 over it, 1.80× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: AlertActions elixir/web-ng/lib/serviceradar_web_ng/alert_actions.ex:1— TooManyFunctions — 53 functions. The bar is 30 functions; this is 23 over it, 1.77× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: DesktopMediaSessionTracker elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:1— TooManyFunctions — 52 functions. The bar is 30 functions; this is 22 over it, 1.73× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: EventHandlerRunner elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:1— TooManyFunctions — 52 functions. The bar is 30 functions; this is 22 over it, 1.73× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Decisions elixir/serviceradar_core/lib/serviceradar/inventory/remediation/decisions.ex:1— TooManyFunctions — 51 functions. The bar is 30 functions; this is 21 over it, 1.70× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: SyncIngestorQueue elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor_queue.ex:1— TooManyFunctions — 51 functions. The bar is 30 functions; this is 21 over it, 1.70× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Storage elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:1— TooManyFunctions — 50 functions. The bar is 30 functions; this is 20 over it, 1.67× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Declarative elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:1— TooManyFunctions — 49 functions. The bar is 30 functions; this is 19 over it, 1.63× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: DeviceDiscoveryIngestor elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:1— TooManyFunctions — 47 functions. The bar is 30 functions; this is 17 over it, 1.57× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Assignments elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:1— TooManyFunctions — 47 functions. The bar is 30 functions; this is 17 over it, 1.57× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: EventIngestor elixir/serviceradar_core/lib/serviceradar/camera/event_ingestor.ex:1— TooManyFunctions — 46 functions. The bar is 30 functions; this is 16 over it, 1.53× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: SecretBroker elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:1— TooManyFunctions — 46 functions. The bar is 30 functions; this is 16 over it, 1.53× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: UserAuth elixir/web-ng/lib/serviceradar_web_ng_web/user_auth.ex:1— TooManyFunctions — 46 functions. The bar is 30 functions; this is 16 over it, 1.53× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: CameraMediaSessionTracker elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:1— TooManyFunctions — 44 functions. The bar is 30 functions; this is 14 over it, 1.47× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Application elixir/serviceradar_core/lib/serviceradar/application.ex:1— TooManyFunctions — 44 functions. The bar is 30 functions; this is 14 over it, 1.47× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: StatsAggregator elixir/serviceradar_core/lib/serviceradar/core/stats_aggregator.ex:1— TooManyFunctions — 44 functions. The bar is 30 functions; this is 14 over it, 1.47× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Discord elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:1— TooManyFunctions — 43 functions. The bar is 30 functions; this is 13 over it, 1.43× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: FrameRunner elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:1— TooManyFunctions — 43 functions. The bar is 30 functions; this is 13 over it, 1.43× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Bulk elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/bulk.ex:1— TooManyFunctions — 43 functions. The bar is 30 functions; this is 13 over it, 1.43× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: Pipeline elixir/serviceradar_core/lib/serviceradar/event_writer/pipeline.ex:1— TooManyFunctions — 42 functions. The bar is 30 functions; this is 12 over it, 1.40× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: SettingsComponents elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:1— TooManyFunctions — 42 functions. The bar is 30 functions; this is 12 over it, 1.40× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: SweepCompiler elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sweep_compiler.ex:1— TooManyFunctions — 41 functions. The bar is 30 functions; this is 11 over it, 1.37× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
TooManyFunctions: FalcoDecomposition elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:1— TooManyFunctions — 41 functions. The bar is 30 functions; this is 11 over it, 1.37× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
Duplicated block (5 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:147— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:147-151 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:121-125 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 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 (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:350— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:350-354 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:848-852 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:318— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:318-322 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:213-217 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2435— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2435-2439 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1363-1367 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2465— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2465-2469 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1393-1397 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:659— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:659-663 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:199-203 — 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) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:217— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:217-221 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/launch_contract.ex:99-104 — 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) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:213— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:213-217 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex: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.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:183— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:183-187 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:212-216 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:204— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:204-208 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:241-246 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_test_plan.ex:197— elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_test_plan.ex:197-201 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:617-621 — 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) elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:360— elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:360-364 | elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:391-395 — 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) elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:164— elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:164-168 | elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex:126-130 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_worker.ex:317— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_worker.ex:317-321 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_worker.ex:348-352 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/identity/ids.ex:407— elixir/serviceradar_core/lib/serviceradar/inventory/identity/ids.ex:407-411 | elixir/serviceradar_core/lib/serviceradar/observability/service_identity.ex:59-63 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:98— elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:98-102 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:109-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.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1045— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1045-1049 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1277-1281 — 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) elixir/serviceradar_core/lib/serviceradar/notifications/seed_fingerprint.ex:57— elixir/serviceradar_core/lib/serviceradar/notifications/seed_fingerprint.ex:57-61 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:226-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.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:119— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:119-123 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:136-140 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 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 (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:277— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:277-281 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1059-1063 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:132— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:132-136 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:364-368 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/storage_token.ex:54— elixir/serviceradar_core/lib/serviceradar/plugins/storage_token.ex:54-58 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:114-118 — 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) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:86— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:86-90 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:155-159 — 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) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:347— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:347-351 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:357-361 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:92— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:92-96 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:146-150 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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.
Hotspot: elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1030— elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js changed 10 times in last 90 days, max cyclomatic complexity 91 in validateTopologyScene at line 1030. 5 of those changes were fix/bug commits, and the other 5 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.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: elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:436— elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js changed 16 times in last 90 days, max cyclomatic complexity 49 in (anonymous) at line 436. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.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: elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:5013— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex changed 37 times in last 90 days, max cyclomatic complexity 15 in Index.legacy_policy_recovery_message at line 5013. 15 of those changes were fix/bug commits, and the other 22 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex`: 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: elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx changed 15 times in last 90 days, max cyclomatic complexity 36 in Component at line 386. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx`: 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: elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1109— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex changed 20 times in last 90 days, max cyclomatic complexity 21 in AwxClient.valid_launch_args? at line 1109. 8 of those changes were fix/bug commits, and the other 12 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex`: 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: elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:49— elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js changed 7 times in last 90 days, max cyclomatic complexity 60 in renderSelectionDetails at line 49. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.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: elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:286— elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js changed 14 times in last 90 days, max cyclomatic complexity 25 in admitNodeLabelsForViewport at line 286. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.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: elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:638— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex changed 9 times in last 90 days, max cyclomatic complexity 38 in Lifecycle.validate_scope at line 638. 2 of those changes were fix/bug commits, and the other 7 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex`: 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: elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2533— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex changed 20 times in last 90 days, max cyclomatic complexity 17 in AgentCommandBus.validate_preallocated_transmit_payload at line 2533. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex`: 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: elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:395— elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js changed 5 times in last 90 days, max cyclomatic complexity 62 in validateTopologyOverview at line 395. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.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: elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1484— elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js changed 7 times in last 90 days, max cyclomatic complexity 44 in _showFlowDetails at line 1484. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/hooks/OperationsTrafficMap.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: elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:202— elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js changed 12 times in last 90 days, max cyclomatic complexity 24 in handleDetailsPanelClick at line 202. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.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: elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1083— elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js changed 13 times in last 90 days, max cyclomatic complexity 22 in autoFitViewState at line 1083. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.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: elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:441— elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex changed 13 times in last 90 days, max cyclomatic complexity 22 in Packages.create_from_upload at line 441. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex`: 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: elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:196— elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js changed 15 times in last 90 days, max cyclomatic complexity 17 in detailTopologySceneFromGeometry at line 196. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.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: elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2297— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex changed 17 times in last 90 days, max cyclomatic complexity 15 in Show.metric_display_name at line 2297. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex`: 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: elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:32— elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex changed 11 times in last 90 days, max cyclomatic complexity 23 in HardenedLaunchPlan.build at line 32. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex`: 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: elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:782— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex changed 11 times in last 90 days, max cyclomatic complexity 23 in CurrentAuthority.current_approval_snapshot at line 782. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex`: 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: elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:149— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex changed 12 times in last 90 days, max cyclomatic complexity 21 in FirstPartyImporter.import at line 149. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex`: 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: elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:309— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex changed 8 times in last 90 days, max cyclomatic complexity 28 in SecureExecutionCurrentAuthority.exact_approval_snapshot at line 309. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex`: 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: elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:234— elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex changed 12 times in last 90 days, max cyclomatic complexity 18 in MergeEngine.do_merge_devices at line 234. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex`: 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: elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:138— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex changed 11 times in last 90 days, max cyclomatic complexity 18 in SecureChildLauncher.load_launch_state at line 138. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex`: 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: elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:128— elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex changed 9 times in last 90 days, max cyclomatic complexity 22 in Targeting.validate_binding at line 128. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex`: 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: elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:175— elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js changed 9 times in last 90 days, max cyclomatic complexity 22 in assertScene at line 175. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.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: elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:614— elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex changed 13 times in last 90 days, max cyclomatic complexity 15 in Show.assign_header at line 614. 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-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 21:37:36 -05:00' --until='2026-09-23 21:37:36 -05:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex`: 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.
Duplicated block (6 lines × 2) config/manager_config/elixir/lib/serviceradar_config/manager.ex:135— config/manager_config/elixir/lib/serviceradar_config/manager.ex:135-140 | elixir/serviceradar_core/lib/serviceradar/postgres/schema_sql.ex:246-251 — 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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:987— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:987-992 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1014-1019 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:575— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:575-580 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:588-593 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:88— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:88-93 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:71-76 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:254— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:254-259 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:371-376 — 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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:503— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:503-508 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:374-379 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:484— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:484-489 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1621-1626 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1664— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1664-1669 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1441-1446 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2471— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2471-2476 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1399-1404 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:308— elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:308-313 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:357-362 — 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) elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:202— elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:202-207 | elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:220-225 — 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) elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:187— elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:187-192 | elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex:153-163 — 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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2666— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2666-2671 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:1024-1029 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:685— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:685-690 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1861-1866 — 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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:346— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:346-351 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1181-1186 — 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) elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:194— elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:194-199 | elixir/web-ng/lib/serviceradar_web_ng_web/components/layouts.ex:578-583 — 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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:38— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:38-43 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/verdict_emitter.ex:51-56 — 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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:161— elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:161-166 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:316-321 — 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 (6 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:493— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:493-498 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:512-517 — 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) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:97— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:97-102 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pubsub_sink.ex: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.
Duplicated block (6 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:266— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:266-271 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:226-231 — 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 (6 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:113— elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:113-118 | elixir/web-ng/lib/serviceradar_web_ng/ansible_repositories.ex:87-92 — 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 (6 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:234— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:234-239 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:164-169 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex` and `elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:179— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:179-184 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:201-207 — 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) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:79— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:79-84 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:142-147 — 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) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1461— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1461-1472 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/media_identity.ex:68-74 — 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) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:503— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:503-509 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:523-529 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:428— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:428-434 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:309-315 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:213— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:213-219 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex: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.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:122— elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:122-128 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:137-143 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:182— elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:182-188 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:379-385 — 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) elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:191— elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:191-197 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:236-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.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:398— elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:398-404 | elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:477-483 — 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) elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:516— elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:516-522 | elixir/web-ng/lib/serviceradar_web_ng/plugins/upload_signature.ex:132-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.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:292— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:292-298 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:1563-1569 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex` and `elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:665— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:665-671 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:731-737 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_persistence.ex:58— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_persistence.ex:58-64 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_persistence.ex:167-173 — 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) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:71— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:71-77 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:76-82 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:324— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:324-330 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:496-502 — 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) elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:222— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:222-228 | elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:280-286 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:503— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:503-509 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:550-556 — 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) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:610— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:610-616 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:649-662 — 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) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:171— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:171-177 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:222-228 — `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:306— elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:306-312 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:313-319 — 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) elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:714— elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:714-720 | elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:332-338 — 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) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:147— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:147-153 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:83-89 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex` and `elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:40— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:40-46 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:65-71 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:94— elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:94-100 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:127-133 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:446— elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:446-452 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:809-815 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:45— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:45-51 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:44-50 — 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 (9 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:232— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:232-240 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:250-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/mix/tasks/serviceradar.hardware_serial_backfill.ex:30— elixir/serviceradar_core/lib/mix/tasks/serviceradar.hardware_serial_backfill.ex:30-38 | elixir/serviceradar_core/lib/mix/tasks/serviceradar.mtr_hop_attribution_backfill.ex:39-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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:253— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:253-261 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:267-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:689— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:689-697 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1081-1089 — 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:216— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:216-224 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/lifecycle.ex:159-167 — 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:210— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:210-218 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:145-153 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1051— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1051-1059 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:591-599 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2535— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2535-2543 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1532-1540 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:136— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:136-144 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:171-179 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:119— elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:119-127 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:147-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1102— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1102-1110 | elixir/serviceradar_core/lib/serviceradar/edge/agent_release_manager.ex:1012-1020 — 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1171— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1171-1179 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1196-1204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_ssh_identity_issuer.ex:85— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_ssh_identity_issuer.ex:85-93 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery.ex:244-252 — 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1733— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1733-1741 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2576-2584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:204— elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:204-212 | elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:219-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:1907— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:1907-1915 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:1922-1930 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/dpi.ex:63— elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/dpi.ex:63-71 | elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/fingerprint.ex:82-90 — 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1202— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1202-1210 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:2070-2079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:406— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:406-414 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:373-381 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:99— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:99-107 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:84-92 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:281— elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:281-289 | elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex: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.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/monitoring/alert_generator.ex:96— elixir/serviceradar_core/lib/serviceradar/monitoring/alert_generator.ex:96-104 | elixir/serviceradar_core/lib/serviceradar/monitoring/alert_generator.ex:118-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.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2778— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2778-2786 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:3015-3023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:310— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:310-318 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:216-224 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex` and `elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:180— elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:180-188 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:665-673 — 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) elixir/palisade/lib/palisade/outbound_url_policy.ex:93— elixir/palisade/lib/palisade/outbound_url_policy.ex:93-100 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex:58-65 — 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) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:174— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:174-181 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:217-224 — 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) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:501— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:501-508 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:470-477 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 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 (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/admission/flow_lane.ex:26— elixir/serviceradar_core/lib/serviceradar/admission/flow_lane.ex:26-33 | elixir/serviceradar_core/lib/serviceradar/admission/retained_plugin_lane.ex:26-33 — 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 (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:49— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:49-56 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:46-53 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:743— elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:743-750 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:790-797 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher/ash_adapter.ex:80— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher/ash_adapter.ex:80-87 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority_ash_source.ex:89-96 — 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) elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:59— elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:59-66 | elixir/serviceradar_core/lib/serviceradar/notifications/plugin_credential_grants.ex:33-40 — 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) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:68— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:68-75 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:245-252 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:539— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:539-546 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_payload.ex:213-220 — 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 (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:418— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:418-425 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:385-392 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1056— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1056-1063 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:482-489 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:823— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:823-830 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:918-925 — 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) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:94— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:94-101 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:78-85 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:94— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:94-101 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:122-129 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:48— elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:48-55 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:72-79 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_addon_id.ex:36— elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_addon_id.ex:36-43 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_addon_assignment.ex:62-69 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/config_schema.ex:324— elixir/serviceradar_core/lib/serviceradar/plugins/config_schema.ex:324-331 | elixir/serviceradar_core/lib/serviceradar/plugins/config_schema.ex:469-476 — 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) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_ingress_supervisor.ex:18— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_ingress_supervisor.ex:18-25 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/desktop_media_ingress_supervisor.ex:18-25 — 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 (8 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:44— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:44-51 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/reference_analysis_worker.ex:43-50 — 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 (8 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:545— elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:545-552 | elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:596-603 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/auth/sso_provisioning.ex:85— elixir/web-ng/lib/serviceradar_web_ng_web/auth/sso_provisioning.ex:85-92 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/gateway_auth.ex:386-393 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:270— elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:270-277 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/camera_relay_runtime.ex:133-140 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:101— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:101-108 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:155-162 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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 (8 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:701— elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:701-708 | elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:733-740 — 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.
FunctionTooLong: RemoteAccessSSHConsole.Component elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— FunctionTooLong — Component runs 885 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 785 over it, 8.85× 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: RemoteAccessDesktopSession.Component elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:392— FunctionTooLong — Component runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× 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: scan.NewSYNScanner REDACTED:39— FunctionTooLong — NewSYNScanner runs 324 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 224 over it, 3.24× 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: srql::query::flows::filters::apply_filter REDACTED:3— FunctionTooLong — srql::query::flows::filters::apply_filter runs 304 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 204 over it, 3.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: serviceradar_fieldsurvey_sidekick::live_capture::run_capture rust/fieldsurvey-sidekick/src/live_capture.rs:26— FunctionTooLong — serviceradar_fieldsurvey_sidekick::live_capture::run_capture runs 274 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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: god_view_nif::core::utils::runtime_graph_row_from_term elixir/web-ng/native/god_view_nif/src/core/utils.rs:94— FunctionTooLong — god_view_nif::core::utils::runtime_graph_row_from_term runs 221 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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.
FunctionTooLong: DashboardBuilderCanvas.Component elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:351— FunctionTooLong — Component runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× 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: srql::query::timeseries_metrics::build_interface_profile_hour_of_week_query rust/srql/src/query/timeseries_metrics.rs:1174— FunctionTooLong — srql::query::timeseries_metrics::build_interface_profile_hour_of_week_query runs 202 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× 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: god_view_nif::core::arrow_serde::encode_snapshot_impl elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:30— FunctionTooLong — god_view_nif::core::arrow_serde::encode_snapshot_impl runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× 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: RemoteAccessApplication.Component elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:77— FunctionTooLong — Component runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× 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: srql::query::devices::filters::apply_filter rust/srql/src/query/devices/filters.rs:61— FunctionTooLong — srql::query::devices::filters::apply_filter runs 190 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× 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: srql::query::flows::stats::query::build_grouped_stats_query rust/srql/src/query/flows/stats/query.rs:72— FunctionTooLong — srql::query::flows::stats::query::build_grouped_stats_query runs 181 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: RemoteAccessDesktopSession.createRdpLauncherRuntime elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:88— FunctionTooLong — createRdpLauncherRuntime runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× 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: RemoteAccessTerminal.Component elixir/web-ng/assets/component/src/RemoteAccessTerminal.jsx:78— FunctionTooLong — Component runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× 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: serviceradar_anomaly_addon::frame::process_frame rust/anomaly-addon/src/frame.rs:249— FunctionTooLong — serviceradar_anomaly_addon::frame::process_frame runs 170 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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.
FunctionTooLong: security_findings.dashboardHtml REDACTED:48— FunctionTooLong — dashboardHtml runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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: srql::query::flows::stats::filters::build_stats_filter_clause rust/srql/src/query/flows/stats/filters.rs:197— FunctionTooLong — srql::query::flows::stats::filters::build_stats_filter_clause runs 167 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: srql::query::timeseries_metrics::build_profile_hour_of_week_query rust/srql/src/query/timeseries_metrics.rs:1659— FunctionTooLong — srql::query::timeseries_metrics::build_profile_hour_of_week_query runs 163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: srql::query::downsample::sql::build_sql rust/srql/src/query/downsample/sql.rs:52— FunctionTooLong — srql::query::downsample::sql::build_sql runs 161 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: serviceradar_netprobe::attribution::drain_ring rust/netprobe/src/attribution.rs:1755— FunctionTooLong — serviceradar_netprobe::attribution::drain_ring runs 152 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× 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: RemoteAccessDesktopSession.Launcher elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:856— FunctionTooLong — Launcher runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× 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: serviceradar_flow_collector::main rust/flow-collector/src/main.rs:47— FunctionTooLong — serviceradar_flow_collector::main runs 151 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× 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: otel::nats::stream::ensure_stream rust/otel/src/nats/stream.rs:74— FunctionTooLong — otel::nats::stream::ensure_stream runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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.
FunctionTooLong: endpoint_inventory.dashboardHtml elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:36— FunctionTooLong — dashboardHtml 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.
FunctionTooLong: srql::query::starrocks::profile_sql rust/srql/src/query/starrocks.rs:1576— FunctionTooLong — srql::query::starrocks::profile_sql runs 142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (11 lines × 2) elixir/palisade/lib/palisade/outbound_fetch.ex:84— elixir/palisade/lib/palisade/outbound_fetch.ex:84-94 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:52-62 — before extracting anything, compare `elixir/palisade/lib/palisade/outbound_fetch.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (11 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:168— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:168-179 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:350-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.
Duplicated block (11 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:159— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:159-169 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:177-187 — 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 (11 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:427— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:427-437 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:476-486 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:450— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:450-460 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:532-542 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:769— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:769-779 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:877-887 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:449— elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:449-459 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:482-492 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:623— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:623-633 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1655-1665 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:711— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:711-721 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:741-751 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:510— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:510-520 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1081-1091 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_artifact.ex:19— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_artifact.ex:19-29 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_store.ex:25-35 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_history.ex:68— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_history.ex:68-78 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:619-629 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:797— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:797-807 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:869-879 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1385— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1385-1395 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:865-875 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1304— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1304-1314 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.ex:991-1001 — 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) elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:85— elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:85-95 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:182-192 — 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) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:76— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:76-86 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:91-101 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex` and `elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/repo_url.ex:74— elixir/serviceradar_core/lib/serviceradar/plugins/repo_url.ex:74-84 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:163-173 — 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) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:517— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:517-527 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:542-552 — 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 (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1054— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1054-1064 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1077-1087 — 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 (11 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:29— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:29-39 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:59-69 — 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 (11 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:149— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:149-159 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:193-203 — `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc_signaling_manager.ex:28— elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc_signaling_manager.ex:28-38 | elixir/web-ng/lib/serviceradar_web_ng/remote_desktop_webrtc_signaling_manager.ex:31-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.
Duplicated block (11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:205— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:205-215 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:240-250 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex` and `elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 (11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:79— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:79-89 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:87-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:45— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:45-54 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:32-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.
Duplicated block (10 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:147— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:147-156 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:424-433 — 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) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:442— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:442-451 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:462-471 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:839— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:839-848 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:889-898 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:842— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:842-851 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1871-1880 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:385— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:385-394 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:769-778 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:404— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:404-413 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:462-471 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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) elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:684— elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:684-693 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:706-715 — 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) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:600— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:600-609 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1300-1309 — 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) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:66— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:66-77 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:123-132 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (10 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:551— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:551-560 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1506-1515 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (10 lines × 2) elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:42— elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:42-51 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:247-256 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:231— elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:231-240 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_data.ex:102-111 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:58— elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:58-67 | elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:72-81 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1306— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1306-1315 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:633-642 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (10 lines × 2) elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:290— elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:290-299 | elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:550-559 — 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) elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:392— elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:392-401 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex:563-572 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex` and `elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 77 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 (10 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/oban_failure_event_reporter.ex:126— elixir/serviceradar_core/lib/serviceradar/observability/oban_failure_event_reporter.ex:126-135 | elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex:96-105 — 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) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:82— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:82-91 | elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:40-49 — 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) elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:41— elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:41-50 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:12-21 — 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) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:253— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:253-262 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:207-216 — 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) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:861— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:861-870 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:888-897 — 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) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1102— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1102-1111 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1241-1250 — 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) elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:39— elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:39-48 | elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:90-99 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:79— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:79-88 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:358-367 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 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.
srql::query::flows::filters::apply_filter (cyclomatic 96) REDACTED:3— srql::query::flows::filters::apply_filter has cyclomatic complexity 96 (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.
srql::query::field_survey::field_sql (cyclomatic 94) rust/srql/src/query/field_survey.rs:391— srql::query::field_survey::field_sql has cyclomatic complexity 94 (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.
srql::query::wifi_map::field_sql (cyclomatic 91) rust/srql/src/query/wifi_map.rs:371— srql::query::wifi_map::field_sql has cyclomatic complexity 91 (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.
srql::query::flows::stats::filters::build_stats_filter_clause (cyclomatic 68) rust/srql/src/query/flows/stats/filters.rs:197— srql::query::flows::stats::filters::build_stats_filter_clause has cyclomatic complexity 68 (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.
srql::query::virtualization::filter_predicate (cyclomatic 62) rust/srql/src/query/virtualization.rs:166— srql::query::virtualization::filter_predicate 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.
srql::query::downsample::fields::series_expr (cyclomatic 62) rust/srql/src/query/downsample/fields.rs:137— srql::query::downsample::fields::series_expr 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.
srql::query::translate::translate_request (cyclomatic 60) rust/srql/src/query/translate.rs:21— srql::query::translate::translate_request has cyclomatic complexity 60 (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.
srql::query::devices::filters::apply_filter (cyclomatic 53) rust/srql/src/query/devices/filters.rs:61— srql::query::devices::filters::apply_filter has cyclomatic complexity 53 (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.
srql::query::downsample::fields::resolve_value_column (cyclomatic 45) rust/srql/src/query/downsample/fields.rs:11— srql::query::downsample::fields::resolve_value_column has cyclomatic complexity 45 (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.
srql::query::capacity_forecasts::apply_ordering (cyclomatic 40) rust/srql/src/query/capacity_forecasts.rs:268— srql::query::capacity_forecasts::apply_ordering has cyclomatic complexity 40 (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.
srql::query::starrocks::field_sql (cyclomatic 36) rust/srql/src/query/starrocks.rs:2233— srql::query::starrocks::field_sql has cyclomatic complexity 36 (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.
srql::query::flows::stats::query::build_grouped_stats_query (cyclomatic 36) rust/srql/src/query/flows/stats/query.rs:72— srql::query::flows::stats::query::build_grouped_stats_query 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.
srql::query::devices::filters::params::collect_filter_params (cyclomatic 33) rust/srql/src/query/devices/filters/params.rs:15— srql::query::devices::filters::params::collect_filter_params has cyclomatic complexity 33 (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.
srql::query::capacity_forecasts::apply_filter (cyclomatic 33) rust/srql/src/query/capacity_forecasts.rs:130— srql::query::capacity_forecasts::apply_filter has cyclomatic complexity 33 (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.
srql::query::logs::filters::apply_filter (cyclomatic 30) rust/srql/src/query/logs/filters.rs:30— srql::query::logs::filters::apply_filter has cyclomatic complexity 30 (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.
srql::query::cagg::cagg_column_for_entity (cyclomatic 28) rust/srql/src/query/cagg.rs:75— srql::query::cagg::cagg_column_for_entity has cyclomatic complexity 28 (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.
srql::query::agents::apply_single_order (cyclomatic 27) rust/srql/src/query/agents.rs:263— srql::query::agents::apply_single_order 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. This shape REPEATS in the file: one other method here (srql::query::agents::apply_secondary_order) 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.
srql::query::agents::apply_secondary_order (cyclomatic 27) rust/srql/src/query/agents.rs:325— srql::query::agents::apply_secondary_order 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. This shape REPEATS in the file: one other method here (srql::query::agents::apply_single_order) 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.
srql::parser::parse (cyclomatic 27) rust/srql/src/parser.rs:39— srql::parser::parse 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.
srql::query::virtualization::order_column (cyclomatic 26) rust/srql/src/query/virtualization.rs:507— srql::query::virtualization::order_column has cyclomatic complexity 26 (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.
srql::query::downsample::sql::build_sql (cyclomatic 24) rust/srql/src/query/downsample/sql.rs:52— srql::query::downsample::sql::build_sql 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.
srql::query::mtr_traces::apply_primary_order (cyclomatic 23) rust/srql/src/query/mtr_traces.rs:228— srql::query::mtr_traces::apply_primary_order has cyclomatic complexity 23 (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. This shape REPEATS in the file: one other method here (srql::query::mtr_traces::apply_secondary_order) 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.
srql::query::mtr_traces::apply_secondary_order (cyclomatic 23) rust/srql/src/query/mtr_traces.rs:287— srql::query::mtr_traces::apply_secondary_order has cyclomatic complexity 23 (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. This shape REPEATS in the file: one other method here (srql::query::mtr_traces::apply_primary_order) 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.
srql::query::flows::filters::apply_threat_filter (cyclomatic 23) REDACTED:454— srql::query::flows::filters::apply_threat_filter 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.
srql::query::endpoint_packages::apply_single_order (cyclomatic 23) rust/srql/src/query/endpoint_packages.rs:779— srql::query::endpoint_packages::apply_single_order has cyclomatic complexity 23 (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. This shape REPEATS in the file: one other method here (srql::query::endpoint_packages::apply_secondary_order) 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.
srql::query::flows::stats::query::build_grouped_stats_query (cognitive 61) rust/srql/src/query/flows/stats/query.rs:72— srql::query::flows::stats::query::build_grouped_stats_query has cognitive complexity 61 (threshold 15). Drivers by points: if/else 28 (38 pts), loops 9 (17 pts), match/switch 2 (5 pts), boolean chains 1 (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.
srql::parser::parse (cognitive 48) rust/srql/src/parser.rs:39— srql::parser::parse has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (42 pts), match/switch 2 (5 pts), loops 1 (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.
srql::query::flows::filters::apply_filter (cognitive 45) REDACTED:3— srql::query::flows::filters::apply_filter has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 13 (21 pts), boolean chains 2 (nesting depth added 22). 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.
srql::query::virtualization::filter_predicate (cognitive 39) rust/srql/src/query/virtualization.rs:166— srql::query::virtualization::filter_predicate has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 27 (39 pts) (nesting depth added 12). 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.
srql::query::capacity_forecasts::apply_ordering (cognitive 32) rust/srql/src/query/capacity_forecasts.rs:268— srql::query::capacity_forecasts::apply_ordering has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 20 (27 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). 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.
srql::query::logs::topn::severity_any_values (cognitive 30) rust/srql/src/query/logs/topn.rs:270— srql::query::logs::topn::severity_any_values has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (7 pts), boolean chains 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.
srql::query::downsample::fields::resolve_value_column (cognitive 29) rust/srql/src/query/downsample/fields.rs:11— srql::query::downsample::fields::resolve_value_column has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 14 (28 pts), if/else 1 (nesting depth added 14). 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.
srql::query::flows::stats::filters::build_stats_filter_clause (cognitive 28) rust/srql/src/query/flows/stats/filters.rs:197— srql::query::flows::stats::filters::build_stats_filter_clause has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 9 (16 pts), if/else 2 (6 pts), loops 2 (6 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
srql::query::devices::filters::apply_filter (cognitive 27) rust/srql/src/query/devices/filters.rs:61— srql::query::devices::filters::apply_filter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 4 (7 pts) (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.
srql::query::flows::filters::apply_threat_filter (cognitive 26) REDACTED:454— srql::query::flows::filters::apply_threat_filter has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 4 (7 pts) (nesting depth added 11). 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.
srql::query::traces::apply_ordering (cognitive 25) rust/srql/src/query/traces.rs:635— srql::query::traces::apply_ordering has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 10 (17 pts), if/else 5 (7 pts), loops 1 (nesting depth added 9). 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.
srql::query::starrocks::field_sql (cognitive 23) rust/srql/src/query/starrocks.rs:2233— srql::query::starrocks::field_sql has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, match/switch 2 (3 pts), loops 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.
srql::query::alerts::apply_ordering (cognitive 22) REDACTED:237— srql::query::alerts::apply_ordering has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 10 (17 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). 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.
srql::query::graph_cypher::rewrite_placeholders (cognitive 22) REDACTED:250— srql::query::graph_cypher::rewrite_placeholders has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
srql::query::starrocks::dataset_sql (cognitive 22) rust/srql/src/query/starrocks.rs:218— srql::query::starrocks::dataset_sql has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, 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.
srql::query::timeseries_metrics::build_stats_query_with_source (cognitive 21) rust/srql/src/query/timeseries_metrics.rs:1477— srql::query::timeseries_metrics::build_stats_query_with_source has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 5 (7 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
srql::query::downsample::sql::build_sql (cognitive 21) rust/srql/src/query/downsample/sql.rs:52— srql::query::downsample::sql::build_sql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
srql::query::mtr_hops::parse_single_agg (cognitive 20) rust/srql/src/query/mtr_hops.rs:633— srql::query::mtr_hops::parse_single_agg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 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.
srql::query::virtualization::order_column (cognitive 20) rust/srql/src/query/virtualization.rs:507— srql::query::virtualization::order_column has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 11 (20 pts) (nesting depth added 9). 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.
srql::query::otel_metrics::apply_ordering (cognitive 20) rust/srql/src/query/otel_metrics.rs:240— srql::query::otel_metrics::apply_ordering has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). 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.
srql::query::services::apply_ordering (cognitive 20) rust/srql/src/query/services.rs:491— srql::query::services::apply_ordering has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). 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.
srql::query::starrocks::order_sql (cognitive 20) rust/srql/src/query/starrocks.rs:2718— srql::query::starrocks::order_sql has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 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.
srql::query::bmp_events::apply_ordering (cognitive 20) rust/srql/src/query/bmp_events.rs:235— srql::query::bmp_events::apply_ordering has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). 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.
srql::query::cpu_metrics::build_numeric_clause (cognitive 19) rust/srql/src/query/cpu_metrics.rs:627— srql::query::cpu_metrics::build_numeric_clause has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), 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.
srql::query::logs::time::apply_ordering (cognitive 18) rust/srql/src/query/logs/time.rs:17— srql::query::logs::time::apply_ordering has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). 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.
MethodTooLong: SurveyView.body swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:75— MethodTooLong — body runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.28× 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: SettingsView.body swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:29— MethodTooLong — body runs 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.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: DetectorEngine.evaluate_inner rust/anomaly-addon/src/engine/mod.rs:1100— MethodTooLong — evaluate_inner runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Converter.convert_ipfix rust/flow-collector/src/netflow/converter.rs:265— MethodTooLong — convert_ipfix runs 220 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EntitySpec.for_entity rust/srql/src/query/field_survey.rs:160— MethodTooLong — for_entity runs 212 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× 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: EntitySpec.for_entity rust/srql/src/query/wifi_map.rs:150— MethodTooLong — for_entity runs 187 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× 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: PushLoop.handleMtrBulkRun go/pkg/agent/mtr_bulk.go:126— MethodTooLong — handleMtrBulkRun 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: Publisher.run rust/flow-collector/src/publisher.rs:103— MethodTooLong — run runs 172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ServiceRadarCollector.handle_traces rust/otel/src/lib.rs:269— MethodTooLong — handle_traces runs 172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Publisher.publish_pending rust/flow-collector/src/publisher.rs:713— MethodTooLong — publish_pending runs 167 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SYNScanner.Scan go/pkg/scan/syn_scanner_scan.go:37— MethodTooLong — Scan runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× 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: Publisher.connect_once rust/flow-collector/src/publisher.rs:972— MethodTooLong — connect_once runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: DetectorEngine.evaluate_transition_with_seasonal_key rust/anomaly-addon/src/engine/mod.rs:1475— MethodTooLong — evaluate_transition_with_seasonal_key runs 150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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: Driver.Sync go/pkg/agent/syncsources/armis/driver.go:56— MethodTooLong — Sync 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: HomeDashboardView.body swift/FieldSurvey/FieldSurvey/Views/HomeShellView.swift:28— MethodTooLong — body runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DetectorEngine.restore_checkpoint rust/anomaly-addon/src/engine/checkpoint.rs:227— MethodTooLong — restore_checkpoint runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: SidekickRelay.start swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:305— MethodTooLong — start runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× 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: RPerfTestOrchestrator.start rust/rperf-client/src/server.rs:79— MethodTooLong — start runs 127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× 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: SweepService.GetSweepResults go/pkg/agent/sweep_service.go:325— MethodTooLong — GetSweepResults runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× 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: NetprobeEbpfRuntime.start rust/netprobe/src/ebpf_runtime.rs:82— MethodTooLong — start runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.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.
MethodTooLong: QueryEngine.execute_query rust/srql/src/query/engine.rs:39— MethodTooLong — execute_query runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.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.
MethodTooLong: PushLoop.pushFlowAttribution go/pkg/agent/push_loop_flow_attribution.go:268— MethodTooLong — pushFlowAttribution runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.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: DiscoveryEngine.querySNMPL2Neighbors go/pkg/mapper/snmp_l2_query.go:29— MethodTooLong — querySNMPL2Neighbors runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: AddonConfig.into_engine_config rust/anomaly-addon/src/config.rs:489— MethodTooLong — into_engine_config runs 116 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DiscoveryEngine.querySingleUniFiAPI REDACTED:162— MethodTooLong — querySingleUniFiAPI runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.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.
Duplicated block (12 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:199— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:199-210 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:243-254 — 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) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:165— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:165-176 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:209-220 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:451— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:451-462 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:483-494 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:235— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:235-246 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_continuation_boundary.ex:45-56 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1078— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1078-1089 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:628-639 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1633— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1633-1644 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1410-1421 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:434— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:434-445 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:524-535 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:35— elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:35-46 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:67-78 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1042— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1042-1053 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1549-1560 — 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) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:767— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:767-778 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/ash_store.ex:235-246 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:199— elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:199-210 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:771-782 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:319— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:319-330 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:348-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.
Duplicated block (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1171— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1171-1182 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1473-1484 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:390— elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:390-401 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:421-432 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:93— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:93-104 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:109-120 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:698— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:698-709 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:712-723 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1477— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1477-1488 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:852-863 — 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:182— elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:182-193 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex:252-263 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex` and `elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 77 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:96— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:96-107 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:92-103 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 108 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:75— elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:75-86 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:46-57 — 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 (12 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:280— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:280-291 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:210-221 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex` and `elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 (12 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:60— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:60-71 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:59-70 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex` and `elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 (12 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:260— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:260-271 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:362-373 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_components/formatters.ex:123— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_components/formatters.ex:123-134 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:395-406 — 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 (12 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:516— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:516-533 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:539-550 — 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 (13 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:195— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:195-207 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:214-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.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1167— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1167-1179 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1235-1247 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:71— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:71-83 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:93-105 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:446— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:446-458 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1169-1181 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:583— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:583-595 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:636-648 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1196— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1196-1208 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1223-1235 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:592— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:592-604 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_vulnerability_risk.ex:555-567 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:369— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:369-381 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:341-353 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:205— elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:205-217 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_data.ex:76-88 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:107— elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:107-119 | elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:282-294 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:523— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:523-535 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:697-710 — 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:56— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:56-68 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:40-52 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:344— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:344-356 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:276-288 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/spiffe.ex:431— elixir/serviceradar_core/lib/serviceradar/spiffe.ex:431-443 | elixir/serviceradar_core/lib/serviceradar/spiffe.ex:455-467 — 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 (13 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:85— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:85-97 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/reference_analysis_worker.ex:83-95 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:102— elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:102-114 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/authorization_settings_controller.ex:61-73 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1453— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1453-1465 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1530-1542 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_controller.ex:223— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_controller.ex:223-235 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_controller.ex:398-410 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oidc_controller.ex:50— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oidc_controller.ex:50-62 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/saml_controller.ex:65-77 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:168— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:168-180 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:199-211 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:1838— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:1838-1850 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:3545-3557 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:872— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:872-884 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/index.ex:371-383 — 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:925— elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:925-937 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:1058-1070 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 136 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:84— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:84-96 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1071-1083 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 137 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 (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:90— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:90-102 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:110-122 — 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 (14 lines × 2) elixir/palisade/lib/palisade/network_address_policy.ex:62— elixir/palisade/lib/palisade/network_address_policy.ex:62-75 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:39-52 — before extracting anything, compare `elixir/palisade/lib/palisade/network_address_policy.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2262— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2262-2275 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2304-2317 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:573— elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:573-586 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:634-647 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:189— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:189-202 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:274-287 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:259— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:259-272 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:287-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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/native_descriptors.ex:72— elixir/serviceradar_core/lib/serviceradar/credentials/native_descriptors.ex:72-86 | elixir/serviceradar_core/lib/serviceradar/credentials/native_descriptors.ex:176-189 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/dashboards/manifest.ex:506— elixir/serviceradar_core/lib/serviceradar/dashboards/manifest.ex:506-519 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1884-1897 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:266— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:266-279 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:499-512 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:153— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:153-166 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:178-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.
Duplicated block (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:656— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:656-669 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1772-1785 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:432— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:432-447 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:399-412 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1106— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1106-1119 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:530-543 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:198— elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:198-211 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:400-413 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:119— elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:119-132 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:109-122 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:362— elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:362-375 | elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:409-423 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:94— elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:94-107 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:95-108 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:182— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:182-195 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:401-414 — 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 (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:80— elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:80-93 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:100-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.
Duplicated block (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:10— elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:10-23 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:10-23 — 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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1032— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1032-1045 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1208-1221 — 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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:943— elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:943-956 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:1076-1089 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 136 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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1924— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1924-1937 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2300-2313 — 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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_list.ex:114— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_list.ex:114-127 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_list.ex:146-159 — 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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/format.ex:89— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/format.ex:89-102 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/format.ex:113-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.
Duplicated block (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:126— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:126-139 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:148-161 — 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) elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex:69— elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex:69-83 | elixir/web-ng/lib/serviceradar_web_ng/edge/crypto.ex:61-75 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex` and `elixir/web-ng/lib/serviceradar_web_ng/edge/crypto.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:322— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:322-336 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:469-483 — 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) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:644— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:644-658 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1676-1690 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:30— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:30-44 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:51-65 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:295— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:295-309 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:278-292 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/registrar.ex:190— elixir/serviceradar_core/lib/serviceradar/inventory/identity/registrar.ex:190-204 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex:513-527 — 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:206— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:206-220 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:175-189 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex` and `elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:287— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:287-301 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:194-208 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex` and `elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:253— elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:253-267 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_vantage_selector.ex:248-262 — 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:272— elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:272-286 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_vantage_selector.ex:267-281 — 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/changes/prepare_policy_assignment_recovery_request.ex:42— elixir/serviceradar_core/lib/serviceradar/plugins/changes/prepare_policy_assignment_recovery_request.ex:42-56 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery.ex:198-212 — 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:168— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:168-182 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:228-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.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:482— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:482-496 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:530-544 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:198— elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:198-212 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:153-167 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 111 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 (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/prefix_tags/dns_policy_source.ex:85— elixir/serviceradar_core/lib/serviceradar/prefix_tags/dns_policy_source.ex:85-99 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/threat_intel_source.ex:79-93 — 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 (15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4414— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4414-4428 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4481-4495 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:226— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:226-240 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:270-284 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:479— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:479-493 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:700-714 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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 (15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:210— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:210-224 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:471-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.
Duplicated block (15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:203— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:203-217 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:50-64 — 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 (15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:95— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:95-109 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:241-255 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:88— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:88-102 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:129-143 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:259— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:259-273 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1433-1447 — 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) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1760— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1760-1774 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:1027-1041 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 52 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 (15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:879— elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:879-897 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:1019-1033 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 136 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.
+ 1 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×24
No test reaches this file elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js— 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 js/cli/harness/harness.js— 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 js/cli/harness/dev.js— 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 elixir/web-ng/assets/god_view_elk_scene_harness.js— 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 js/cli/templates/react-map/src/main.jsx— 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 elixir/web-ng/assets/component/src/SrqlEditor.jsx— 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 js/cli/templates/react-table/src/main.jsx— 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 elixir/web-ng/assets/component/src/JdmEditor.jsx— 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 elixir/web-ng/assets/js/theme_init.js— 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 elixir/web-ng/assets/god_view_scene_test_runner.mjs— 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 js/cli/bin/serviceradar-dashboard.js— 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 js/cli/templates/react-blank/src/main.jsx— 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 elixir/web-ng/assets/god_view_elk_scene_bundle.mjs— 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 elixir/web-ng/assets/timestamp_formatter_test_runner.mjs— 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 elixir/web-ng/assets/test-draw-uniforms.mjs— 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 elixir/web-ng/assets/js/lib/god_view/layout_methods.js— 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 elixir/web-ng/assets/test-deck-layer-2.mjs— 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 elixir/web-ng/assets/test-deck-layer.mjs— 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 elixir/web-ng/assets/test-deck-props.mjs— 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 elixir/web-ng/assets/test-luma-constant.mjs— 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 elixir/web-ng/assets/test-luma-shader.mjs— 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 elixir/web-ng/assets/test-luma.js— 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 elixir/web-ng/assets/test-luma.mjs— 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 elixir/web-ng/assets/test-time.js— 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.
TodoComment elixir/serviceradar_core/lib/serviceradar/actors/device.ex:506— # TODO: Load device-specific configuration from DB — 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 elixir/serviceradar_core/lib/serviceradar/actors/device.ex:541— # TODO: Persist events to database — 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 elixir/serviceradar_core/lib/serviceradar/edge/agent_process.ex:382— # TODO: Get from SPIFFE workload API — 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 elixir/serviceradar_core/lib/serviceradar/infrastructure/health_check_runner.ex:454— # TODO: Could be smarter about routing to the right gateway based on agent_uid — 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 elixir/serviceradar_core/lib/serviceradar/observability/metric_envelope.ex:64— # TODO(review): wire the resolver from the persistence caller — 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 go/pkg/agent/snmp/snmp_integration_test.go:120— // TODO: revisit this i don't think we're doing status with the SNMP service like we do the others. — 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 go/pkg/datasvc/core_registration.go:206— // TODO: Query SPIFFE workload API if socket is available — 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 go/pkg/edgeonboarding/spire.go:151— // TODO: Determine if checker has dedicated SPIRE agent or shares with agent/gateway — 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 go/pkg/edgeonboarding/spire.go:170— // TODO: Generate actual SPIRE server config — 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 go/pkg/edgeonboarding/spire.go:221— // TODO: Generate actual SPIRE agent config — 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 go/pkg/edgeonboarding/download.go:501— // TODO: Implement activation notification — 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 go/pkg/edgeonboarding/deployment.go:117— // TODO: Implement address resolution based on deployment type — 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 go/pkg/edgeonboarding/deployment.go:149— // TODO: Extract SPIRE addresses from package metadata — 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 go/pkg/edgeonboarding/bootstrap.go:278— // TODO: Implement rotation logic — 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 go/pkg/edgeonboarding/bootstrap.go:293— // TODO: Implement proper detection logic — 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 go/pkg/edgeonboarding/bootstrap.go:316— // TODO: Extract from package metadata — 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 go/pkg/edgeonboarding/bootstrap.go:337— // TODO: Implement rotation info retrieval — 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 go/pkg/mapper/grpc.go:575— // TODO: Pass logger to this function or make it a method — 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 go/pkg/mapper/grpc.go:579— // TODO: Pass logger to this function or make it a method — 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 go/pkg/scan/syn_scanner_bpf.go:37— // TODO: double-tag (QinQ) variant or an auxdata-aware approach — 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 go/pkg/sysmon/collector.go:105— // TODO: Make configurable — 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 rust/correlation-engine/src/main.rs:4— //! verdicts. TODO(1.2–1.7): real hydration, delta-driven ticks, snapshot — 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 rust/correlation-engine/src/context_hydrator.rs:62— /// TODO(1.2b+): a subscriber for the existing analytic subjects — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:158— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:158-163 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:176-181 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:129-134 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:239— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:239-244 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:257-262 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:232-237 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 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 × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:48— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:48-53 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:45-50 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1518-1523 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:213— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:213-218 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:280-285 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:353-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:30— elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:30-35 | elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:59-64 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:30-35 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_worker.ex:335— elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_worker.ex:335-340 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:209-214 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:56-61 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:337— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:337-342 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1060-1065 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1079-1084 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:85— elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:85-90 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/revoke_direct_leaf_access.ex:25-30 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_direct_leaf_access.ex:111-116 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:370— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:370-375 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:488-493 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:536-541 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:71— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:71-76 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/notification_callback_app_controller.ex:130-135 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:476-481 — 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.
Duplicated block (6 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/index.ex:367— elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/index.ex:367-372 | elixir/web-ng/lib/serviceradar_web_ng_web/live/bmp_live/index.ex:327-332 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:3772-3777 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:107— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:107-112 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/git_catalog_sync_worker.ex:351-356 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_pulse_worker.ex:170-175 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:228— elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:228-233 | elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:1858-1863 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/data/vulnerable_assets.ex:82-87 — 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.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:662— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:662-667 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:719-724 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1694-1699 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 × 3) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:109— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:109-114 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:126-131 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/oban_schedule.ex:43-48 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 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 × 3) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:41— elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:41-46 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_packages.ex:147-152 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_profiles.ex:33-38 — 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.
Duplicated block (6 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:43— elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:43-48 | elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:52-57 | elixir/web-ng/lib/serviceradar_web_ng/plugins/registry.ex:31-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:1213— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:1213-1218 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex:113-118 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:256-261 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:85— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:85-90 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:202-207 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:108-113 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:437— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:437-442 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/otel_metrics.ex:272-277 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/otel_traces.ex:219-224 — 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×19
Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1316— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1316-1324 | elixir/serviceradar_core/lib/serviceradar/agent_tracker.ex:191-199 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1323-1331 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:373-381 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1661— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1661-1670 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2450-2460 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1378-1388 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1438-1447 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:456— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:456-462 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:522-529 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:927-933 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:993-1000 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:467— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:467-477 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:541-552 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:938-948 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1012-1023 — 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) elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:30— elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:30-65 | elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:84-121 | elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:209-253 | elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:409-448 — 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) elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:544— elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:544-550 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:607-613 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1639-1645 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:1304-1310 — 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) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:259— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:259-284 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:329-343 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1048-1066 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1071-1085 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:38— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:38-57 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:40-63 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:41-64 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:34-53 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:62— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:62-69 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:68-81 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:69-82 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:58-65 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:81— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:81-88 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:93-107 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:94-108 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:77-84 — 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) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:96— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:96-108 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:118-137 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:119-138 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:92-104 — 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) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:124— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:124-366 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:381-516 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:531-652 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:667-759 — 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) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:166— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:166-178 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:291-303 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:151-163 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:109-121 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:297— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:297-312 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:444-466 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:550-565 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:88-103 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:580— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:580-585 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:471-476 | elixir/web-ng/lib/serviceradar_web_ng_web/live/metric_live/show.ex:398-403 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:1087-1092 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:432— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:432-460 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:635-685 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:690-717 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:722-757 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1636— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1636-1643 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:24-34 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:29-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1021-1032 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:64— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:64-91 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:70-96 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:297-324 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:349-384 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:174— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:174-182 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:147-155 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1167-1175 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:981-989 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:268— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:268-274 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:280-286 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:243-249 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:692— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:692-698 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1084-1090 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:138-144 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120-126 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:139-145 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:33-39 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:313— elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:313-319 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1257-1263 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:210-216 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:70— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:70-76 | elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:42-48 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:247-253 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:70— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:70-76 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:274-280 | elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:37-43 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1194— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1194-1200 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1334-1340 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1843-1849 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:676— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:676-682 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:710-716 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:740-746 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/notifications/action_redemption.ex:289— elixir/serviceradar_core/lib/serviceradar/notifications/action_redemption.ex:289-295 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/alert_lifecycle.ex:222-228 | elixir/web-ng/lib/serviceradar_web_ng/alert_actions.ex:410-416 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_scheduler.ex:57— elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_scheduler.ex:57-63 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_enrichment_dataset_scheduler.ex:52-58 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_scheduler.ex:73-79 — 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.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:95— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:95-101 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:109-115 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:123-129 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:58— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:58-64 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:73-79 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:250-256 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex` and `elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:110— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:110-116 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2608-2614 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_package_live/index.ex:1273-1279 — 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.
Duplicated block (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:134— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:134-140 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1121-1127 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:121-127 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 137 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 × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:34— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:34-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:63-69 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:78-84 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:373— elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:373-379 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_artifact.ex:102-108 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_store.ex:98-104 — 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.
Duplicated block (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8050— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8050-8056 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1959-1965 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:1043-1050 — 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.
Duplicated block (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/event_show.ex:37— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/event_show.ex:37-43 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/events.ex:89-95 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/history.ex:93-99 — 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.
Duplicated block (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:247— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:247-253 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1249-1255 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:202-208 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 137 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.
ClassTooLong: DashboardWasmHost REDACTED:1— ClassTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 729 over it, 2.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: Publisher rust/flow-collector/src/publisher.rs:63— ClassTooLong — 812 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 2 blocks, lines 63-1257. The bar is 400 significant lines; this is 412 over it, 2.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: SurveyView swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:17— ClassTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 347 over it, 1.87× 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: DetectorEngine rust/anomaly-addon/src/engine/mod.rs:626— ClassTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 626-1735. The bar is 400 significant lines; this is 327 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: CompositeSurveyView swift/FieldSurvey/FieldSurvey/Views/CompositeSurveyView.swift:9— ClassTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 201 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.
ClassTooLong: RealWiFiScanner swift/FieldSurvey/FieldSurvey/Network/RealWiFiScanner.swift:36— ClassTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 171 over it, 1.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.
ClassTooLong: SettingsView swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:6— ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 142 over it, 1.36× 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: structuralPreflight go/cmd/tools/ubuntu-feed-merge/structure.go:74— ClassTooLong — 533 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods, 32 blocks, lines 74-897. The bar is 400 significant lines; this is 133 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.
ClassTooLong: GatewayClient go/pkg/agentgateway/gateway_client.go:89— ClassTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods, 28 blocks, lines 89-1026. The bar is 400 significant lines; this is 109 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: SidekickRelay swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:257— ClassTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 105 over it, 1.26× 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: Tracer go/pkg/mtr/tracer.go:66— ClassTooLong — 468 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods, 33 blocks, lines 66-1047. The bar is 400 significant lines; this is 68 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.
ClassTooLong: runner go/pkg/agent/addon/manager.go:349— ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods, 36 blocks, lines 349-1244. The bar is 400 significant lines; this is 63 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: NATSStore go/pkg/datasvc/nats.go:42— ClassTooLong — 460 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods, 35 blocks, lines 42-1055. The bar is 400 significant lines; this is 60 over it, 1.15× 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: NATSAccountServer go/pkg/datasvc/nats_account_service.go:44— ClassTooLong — 442 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods, 17 blocks, lines 44-900. The bar is 400 significant lines; this is 42 over it, 1.11× 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: BaseProcessor go/pkg/sweeper/base_processor.go:45— ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods, 31 blocks, lines 45-925. The bar is 400 significant lines; this is 25 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: Converter rust/flow-collector/src/netflow/converter.rs:13— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 2 blocks, lines 13-609. The bar is 400 significant lines; this is 18 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: SignalMapView swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:8— ClassTooLong — 411 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 11 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: SidekickClient swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:637— ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 2 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.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:4— elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:4 reaches into another package with a relative path (../../js/utils/user_time) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:21— elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:21 reaches into another package with a relative path (../../js/utils/user_time) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:3— elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:3 reaches into another package with a relative path (../../js/lib/remote_desktop/control_frame.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:10— elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:10 reaches into another package with a relative path (../../js/lib/remote_desktop/renderer_state.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:11— elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:11 reaches into another package with a relative path (../../js/lib/remote_desktop/renderer_runtime.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:12— elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:12 reaches into another package with a relative path (../../js/lib/remote_desktop/webrtc_client.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/component/src/SrqlEditor.jsx:2— elixir/web-ng/assets/component/src/SrqlEditor.jsx:2 reaches into another package with a relative path (../../js/lib/srql/monaco_srql.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/DashboardBuilderCanvas.js:4— elixir/web-ng/assets/js/hooks/DashboardBuilderCanvas.js:4 reaches into another package with a relative path (../../component/src/DashboardBuilderCanvas.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/DashboardPanelChart.js:4— elixir/web-ng/assets/js/hooks/DashboardPanelChart.js:4 reaches into another package with a relative path (../../component/src/DashboardPanelChart.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:4— elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:4 reaches into another package with a relative path (../../component/src/RemoteAccessApplication.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:4— elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:4 reaches into another package with a relative path (../../component/src/RemoteAccessDesktopSession.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:6— elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:6 reaches into another package with a relative path (../../component/src/RemoteAccessSSHConsole.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:4— elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:4 reaches into another package with a relative path (../../component/src/RemoteAccessTCPText.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:6— elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:6 reaches into another package with a relative path (../../component/src/RemoteAccessTerminal.jsx) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:6— elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:6 reaches into another package with a relative path (../../component/src/RemoteConsoleTerminal.jsx) — import the package by name instead.
Boundary violation [package:third-party-deep-import] elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:1— elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:1 imports elkjs/lib/elk.bundled.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:third-party-deep-import] js/cli/src/validation.ts:93— js/cli/src/validation.ts:93 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.
TooManyMethods: PushLoop go/pkg/agent/push_loop.go:89— TooManyMethods — 216 methods, declared across 30 files: agent/push_loop_addons.go (30), agent/control_stream.go (29), agent/push_loop_state.go (23), agent/app_tcp_route.go (20), +26 more file(s). The bar is 30 methods; this is 186 over it, 7.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: DiscoveryEngine go/pkg/mapper/types.go:31— TooManyMethods — 189 methods, declared across 42 files: mapper/discovery_dedup.go (12), mapper/snmp_l2_bridge.go (12), mapper/discovery_devices.go (11), REDACTED (9), +38 more file(s). The bar is 30 methods; this is 159 over it, 6.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: PluginManager go/pkg/agent/plugin_runtime.go:114— TooManyMethods — 77 methods, declared across 8 files: agent/plugin_runtime_manager.go (46), agent/plugin_runtime_wazero.go (14), REDACTED (6), agent/plugin_runtime_notify.go (4), +4 more file(s). The bar is 30 methods; this is 47 over it, 2.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: pluginExecution go/pkg/agent/plugin_runtime_execution.go:32— TooManyMethods — 71 methods, declared across 11 files: REDACTED (20), agent/plugin_runtime_execution.go (14), agent/plugin_runtime_host_authority.go (11), agent/plugin_runtime_artifact.go (9), +7 more file(s). The bar is 30 methods; this is 41 over it, 2.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: NetworkSweeper go/pkg/sweeper/sweeper.go:29— TooManyMethods — 53 methods, declared across 13 files: sweeper/sweeper_run.go (9), sweeper/sweeper_aggregators.go (6), sweeper/sweeper_banner_grab.go (6), sweeper/sweeper_lifecycle.go (6), +9 more file(s). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Client go/pkg/agent/netprobe/client.go:100— TooManyMethods — 45 methods, declared across 2 files: netprobe/client.go (38), netprobe/capture_session.go (7). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: SYNScanner go/pkg/scan/syn_scanner_types.go:52— TooManyMethods — 40 methods, declared across 16 files: REDACTED (6), scan/syn_scanner_mappings.go (5), scan/syn_scanner_packet_build.go (4), scan/syn_scanner_batch.go (3), +12 more file(s). The bar is 30 methods; this is 10 over it, 1.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: runner go/pkg/agent/addon/manager.go:349— TooManyMethods — 38 methods, declared across 2 files: addon/manager.go (35), addon/artifacts.go (3). The bar is 30 methods; this is 8 over it, 1.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: RealWiFiScanner swift/FieldSurvey/FieldSurvey/Network/RealWiFiScanner.swift:36— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 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.
TooManyMethods: Coordinator swift/FieldSurvey/FieldSurvey/Views/CompositeSurveyView.swift:169— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 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.
TooManyMethods: ArrowKeyedEncoding swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowEncoder.swift:171— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× 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: NATSStore go/pkg/datasvc/nats.go:42— 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: DetectorEngine rust/anomaly-addon/src/engine/mod.rs:626— TooManyMethods — 34 methods, declared across 3 files: engine/mod.rs (30), engine/checkpoint.rs (2), engine/counter.rs (2). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Tracer go/pkg/mtr/tracer.go:66— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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: EdgeWrite rust/dgraph-topology/src/types/writes.rs:355— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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: structuralPreflight go/cmd/tools/ubuntu-feed-merge/structure.go:74— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 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.
serviceradar_netprobe::mdns::parse_mdns_payload (cognitive 42) rust/netprobe/src/mdns.rs:213— serviceradar_netprobe::mdns::parse_mdns_payload has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (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.
serviceradar_netprobe::attribution::drain_ring (cognitive 40) rust/netprobe/src/attribution.rs:1755— serviceradar_netprobe::attribution::drain_ring has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_netprobe::server::handle_client (cognitive 30) rust/netprobe/src/server.rs:205— serviceradar_netprobe::server::handle_client has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 4 (9 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.
serviceradar_netprobe::capture::runner::run (cognitive 24) rust/netprobe/src/capture/runner.rs:125— serviceradar_netprobe::capture::runner::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (3 pts), 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.
serviceradar_netprobe::census::runtime::segment_scope_for (cognitive 23) rust/netprobe/src/census.rs:1426— serviceradar_netprobe::census::runtime::segment_scope_for has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 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.
serviceradar_netprobe::kernel_layout::parse_inet_sock_set_state_layout (cognitive 21) rust/netprobe/src/kernel_layout.rs:212— serviceradar_netprobe::kernel_layout::parse_inet_sock_set_state_layout has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_netprobe::mdns::read_dns_name (cognitive 21) rust/netprobe/src/mdns.rs:143— serviceradar_netprobe::mdns::read_dns_name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), 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.
serviceradar_netprobe::p0f_corpus::parse (cognitive 20) rust/netprobe/src/p0f_corpus.rs:179— serviceradar_netprobe::p0f_corpus::parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 pts), boolean chains 1, 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.
serviceradar_netprobe::kernel_layout::parse_btf (cognitive 19) rust/netprobe/src/kernel_layout.rs:359— serviceradar_netprobe::kernel_layout::parse_btf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (4 pts), match/switch 2 (3 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.
serviceradar_netprobe::fingerprint::recog_observations (cognitive 18) rust/netprobe/src/fingerprint.rs:168— serviceradar_netprobe::fingerprint::recog_observations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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.
serviceradar_netprobe::ebpf_runtime::is_default_route_interface (cognitive 18) rust/netprobe/src/ebpf_runtime.rs:692— serviceradar_netprobe::ebpf_runtime::is_default_route_interface has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_netprobe::attribution::socket_owners (cognitive 18) rust/netprobe/src/attribution.rs:2756— serviceradar_netprobe::attribution::socket_owners has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
serviceradar_netprobe::ja4::parse_tls_client_hello (cognitive 17) rust/netprobe/src/ja4.rs:61— serviceradar_netprobe::ja4::parse_tls_client_hello has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
serviceradar_netprobe::fingerprint::dns_version_bind_banner (cognitive 16) rust/netprobe/src/fingerprint.rs:312— serviceradar_netprobe::fingerprint::dns_version_bind_banner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 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.
serviceradar_netprobe::dpi::tls_client_hello_has_sni (cognitive 16) rust/netprobe/src/dpi.rs:282— serviceradar_netprobe::dpi::tls_client_hello_has_sni has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, 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.
TooManyFields: CmdConfig go/pkg/cli/types.go:11— TooManyFields — 108 stored fields. The bar is 30 stored fields; this is 78 over it, 3.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PushLoop go/pkg/agent/push_loop.go:89— TooManyFields — 67 stored fields beside 216 methods. The bar is 30 stored fields; this is 37 over it, 2.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: FlowRow rust/srql/src/query/flows/row.rs:8— TooManyFields — 49 stored fields beside 1 method. The bar is 30 stored fields; this is 19 over it, 1.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: SeriesCheckpoint rust/anomaly-addon/src/engine/checkpoint.rs:18— TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: SeriesState rust/anomaly-addon/src/engine/state.rs:26— TooManyFields — 45 stored fields beside 1 method. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: DeviceRow rust/srql/src/models/inventory.rs:117— TooManyFields — 45 stored fields beside 1 method. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: FlowRowLegacy rust/srql/src/query/flows/row.rs:66— TooManyFields — 45 stored fields beside 1 method. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PluginManager go/pkg/agent/plugin_runtime.go:114— TooManyFields — 42 stored fields beside 77 methods. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: SYNScanner go/pkg/scan/syn_scanner_types.go:52— TooManyFields — 40 stored fields beside 40 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: OCSFDevice go/pkg/models/ocsf_device.go:129— TooManyFields — 38 stored fields beside 4 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: EdgeOnboardingPackage go/pkg/models/edge_onboarding.go:69— TooManyFields — 34 stored fields. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AddonConfig rust/anomaly-addon/src/config.rs:52— TooManyFields — 33 stored fields beside 3 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Client go/pkg/agent/netprobe/client.go:100— TooManyFields — 32 stored fields beside 45 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: device REDACTED:28— TooManyFields — 32 stored fields beside 10 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AlertRow rust/srql/src/models/events.rs:293— TooManyFields — 32 stored fields beside 1 method. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (8 lines × 3) elixir/palisade/lib/palisade/outbound_fetch.ex:72— elixir/palisade/lib/palisade/outbound_fetch.ex:72-79 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:40-47 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/outbound_fetch.ex:40-47 — before extracting anything, compare `elixir/palisade/lib/palisade/outbound_fetch.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (8 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:163— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:163-170 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:181-188 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:207-214 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 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 (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1165— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1165-1172 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1233-1240 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1350-1357 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1173— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1173-1180 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1310-1317 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:637-644 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:129— elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:129-136 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_baseline_freshness_worker.ex:116-123 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:630-637 — 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.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:146— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:146-153 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:169-176 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:193-200 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:38— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:38-45 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:45-52 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:35-42 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:64— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:64-71 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:87-94 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:78-85 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9138— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9138-9148 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9363-9370 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9617-9624 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:747— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:747-754 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1245-1252 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1265-1272 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:341— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:341-348 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:314-321 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:312-319 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 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 (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:90— elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:90-97 | elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:119-126 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/severity.ex:71-78 — 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.
Duplicated block (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:211— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:211-218 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:265-272 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:272-279 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/camera_multiview.ex:243— elixir/web-ng/lib/serviceradar_web_ng_web/camera_multiview.ex:243-250 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/camera_relay_runtime.ex:84-91 | elixir/web-ng/lib/serviceradar_web_ng_web/live/topology_live/god_view_camera_relay.ex:185-192 — 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.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/authored_dashboard_export_controller.ex:104— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/authored_dashboard_export_controller.ex:104-111 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_components.ex:414-421 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:1111-1118 — 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.
Duplicated block (5 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/plugin_metrics_publisher.ex:64— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/plugin_metrics_publisher.ex:64-68 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:103-107 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:220-224 — 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.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:288— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:288-293 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:453-457 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1176-1180 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:259— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:259-263 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:340-344 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:584-588 — 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.
Duplicated block (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/log_components.ex:132— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/log_components.ex:132-136 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7852-7856 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1908-1912 — 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.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/northbound_bridge.ex:59— elixir/serviceradar_core/lib/serviceradar/automation/ansible/northbound_bridge.ex:59-63 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:155-159 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:88-92 — 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.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:613— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:613-617 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:655-659 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1170-1174 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/northbound/action_redaction.ex:141— elixir/serviceradar_core/lib/serviceradar/automation/northbound/action_redaction.ex:141-145 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:234-238 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:265-269 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_parser.ex:118— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_parser.ex:118-122 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex:427-431 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:380-384 — 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.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/notifications/validations/provider_action_key_declared.ex:125— elixir/serviceradar_core/lib/serviceradar/notifications/validations/provider_action_key_declared.ex:125-129 | elixir/serviceradar_core/lib/serviceradar/notifications/validations/provider_package_approved.ex:91-95 | elixir/serviceradar_core/lib/serviceradar/notifications/validations/provider_transport_contract.ex:52-56 — 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.
Duplicated block (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1149— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1149-1153 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:3907-3911 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1678-1682 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1162— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1162-1166 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:3920-3924 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1691-1695 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile_srql_target_resolver.ex:43— elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile_srql_target_resolver.ex:43-47 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/srql_target_resolver.ex:91-95 | elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/srql_target_resolver.ex:66-70 — 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.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:992— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:992-996 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:1004-1008 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:154-158 — 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.
Duplicated block (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:54— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:54-58 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:112-116 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:159-163 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18 lines × 2) elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:422— elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:422-439 | elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:450-467 — 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 (18 lines × 2) elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex:123— elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex:123-140 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:912-929 — 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 (18 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:75— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:75-92 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:63-80 — 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 (18 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:267— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:267-284 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:1541-1558 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex` and `elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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 (18 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:118— elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:118-135 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:153-170 — 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 (18 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:139— elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:139-156 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:155-172 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:608— elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:608-625 | elixir/web-ng/lib/serviceradar_web_ng/temp_archive.ex:46-63 — 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1174— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1174-1191 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1199-1216 — 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5718— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5718-5735 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5752-5769 — 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:30— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:30-47 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:62-79 — 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:361— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:361-378 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex:61-78 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1233— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1233-1250 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1273-1290 — 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:376— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:376-393 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:402-419 — 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 × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle_ash_actions.ex:140— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle_ash_actions.ex:140-149 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/mutation_lifecycle_ash_actions.ex:89-98 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_lifecycle_ash_actions.ex:177-186 — 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.
Duplicated block (10 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/retention_worker.ex:235— elixir/serviceradar_core/lib/serviceradar/automation/ansible/retention_worker.ex:235-244 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_watchdog.ex:176-185 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/schedule_evaluator_worker.ex:275-284 — 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.
Duplicated block (10 lines × 3) elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:662— elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:662-671 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:725-734 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:775-784 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target_resolver.ex:169— elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target_resolver.ex:169-178 | elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target_resolver.ex:200-209 | elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target_resolver.ex:243-252 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:27— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:27-36 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_file_transfer_controller.ex:33-42 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_file_transfer_controller.ex:65-74 — 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.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:880— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:880-889 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:902-911 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:1054-1063 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:187— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:187-196 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:271-280 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:732-741 — 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.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:102— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:102-111 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1089-1098 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:99-108 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 137 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 × 3) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_settings_runtime.ex:15— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_settings_runtime.ex:15-24 | elixir/serviceradar_core/lib/serviceradar/observability/bmp_settings_runtime.ex:25-34 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_settings_runtime.ex:20-29 — 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.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1172— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1172-1181 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:3930-3939 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1701-1710 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:1942— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:1942-1951 | elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:436-445 | elixir/web-ng/lib/serviceradar_web_ng_web/live/node_live/show.ex:495-504 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1835— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1835-1853 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1071-1089 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1402— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1402-1420 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:376-394 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:145— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:145-163 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:118-136 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:230— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:230-248 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:198-216 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:306— elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:306-324 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex:436-454 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex` and `elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 77 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:143— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:143-161 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:204-222 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 70 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/registry/agent_registry.ex:142— elixir/serviceradar_core/lib/serviceradar/registry/agent_registry.ex:142-160 | elixir/serviceradar_core/lib/serviceradar/registry/gateway_registry.ex:134-152 — 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 (19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:45— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:45-63 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:271-289 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:491— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:491-509 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:962-980 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/job_live/index.ex:127— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/job_live/index.ex:127-145 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/job_live/show.ex:83-101 — 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.
serviceradar_fieldsurvey_sidekick::radio::parse_iw_list_frequencies_mhz (cognitive 27) rust/fieldsurvey-sidekick/src/radio.rs:519— serviceradar_fieldsurvey_sidekick::radio::parse_iw_list_frequencies_mhz has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 1, loops 1 (nesting depth added 17). 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.
serviceradar_fieldsurvey_sidekick::api::streams::stream_spectrum (cognitive 25) rust/fieldsurvey-sidekick/src/api/streams.rs:113— serviceradar_fieldsurvey_sidekick::api::streams::stream_spectrum has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 2 (5 pts), boolean chains 2, 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.
serviceradar_fieldsurvey_sidekick::capture::parse_radiotap (cognitive 24) rust/fieldsurvey-sidekick/src/capture.rs:24— serviceradar_fieldsurvey_sidekick::capture::parse_radiotap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_fieldsurvey_sidekick::api::streams::stream_observations (cognitive 22) rust/fieldsurvey-sidekick/src/api/streams.rs:14— serviceradar_fieldsurvey_sidekick::api::streams::stream_observations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_fieldsurvey_sidekick::live_capture::run_capture (cognitive 20) rust/fieldsurvey-sidekick/src/live_capture.rs:26— serviceradar_fieldsurvey_sidekick::live_capture::run_capture has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 2, loops 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. This shape REPEATS in the file: one other method here (serviceradar_fieldsurvey_sidekick::live_capture::run_capture::process_block) 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.
serviceradar_fieldsurvey_sidekick::radio::parse_iw_list_modes (cognitive 17) rust/fieldsurvey-sidekick/src/radio.rs:480— serviceradar_fieldsurvey_sidekick::radio::parse_iw_list_modes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 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.
serviceradar_fieldsurvey_sidekick::api::streams::stream_spectrum_summaries (cognitive 17) rust/fieldsurvey-sidekick/src/api/streams.rs:210— serviceradar_fieldsurvey_sidekick::api::streams::stream_spectrum_summaries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (5 pts), boolean chains 1, 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.
serviceradar_fieldsurvey_sidekick::live_capture::run_capture::process_block (cognitive 16) rust/fieldsurvey-sidekick/src/live_capture.rs:337— serviceradar_fieldsurvey_sidekick::live_capture::run_capture::process_block has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 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. This shape REPEATS in the file: one other method here (serviceradar_fieldsurvey_sidekick::live_capture::run_capture) 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.
Duplicated block (11 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:125— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:125-135 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex:129-139 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_pulse_worker.ex:187-197 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (11 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery_worker.ex:32— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery_worker.ex:32-42 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/lifecycle_seed_worker.ex:40-50 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery_worker.ex:32-42 — 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.
Duplicated block (11 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140— elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140-150 | elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex:142-152 | elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:182-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 all 3 call sites, so a change lands once.
Duplicated block (11 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:475— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:475-485 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_payload.ex:19-29 | elixir/web-ng/lib/serviceradar_web_ng/remote_access_desktop_targets.ex:234-244 — 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.
Duplicated block (11 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:420— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:420-430 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:462-472 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:1470-1480 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:287— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:287-297 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:306-316 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:325-335 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:76— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:76-86 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:68-78 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1063-1073 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (11 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1194— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1194-1204 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:3857-3867 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1350-1360 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4420— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4420-4428 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4487-4495 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4521-4529 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:81— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:81-89 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:360-368 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex:60-68 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 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 (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:365— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:365-373 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:420-428 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex:65-73 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:259— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:259-267 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:361-369 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:52-60 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 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 (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:470— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:470-478 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:478-486 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:369-377 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:95— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:95-103 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_forwarder.ex:109-117 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/remote_capture_forwarder.ex:98-107 — 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.
Duplicated block (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:190— elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:190-198 | elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/show.ex:87-95 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index.ex:371-379 — 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.
Duplicated block (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1661— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1661-1665 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2450-2454 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1378-1382 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1438-1442 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:467— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:467-471 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:541-545 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:938-942 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1012-1016 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (5 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:443— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:443-447 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:671-675 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:703-707 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:731-735 — 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.
Duplicated block (5 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:448— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:448-452 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:676-680 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:708-712 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:736-740 — 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.
Duplicated block (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/camera/event_ingestor.ex:36— elixir/serviceradar_core/lib/serviceradar/camera/event_ingestor.ex:36-40 | elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:43-47 | elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:64-68 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:62-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:80— elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:80-84 | elixir/serviceradar_core/lib/serviceradar/inventory/device_identifier_gc_worker.ex:53-57 | elixir/serviceradar_core/lib/serviceradar/jobs/schedule_health_worker.ex:38-42 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:31-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/notifications/continuation_worker.ex:110— elixir/serviceradar_core/lib/serviceradar/notifications/continuation_worker.ex:110-114 | elixir/serviceradar_core/lib/serviceradar/notifications/delivery_retention_worker.ex:135-139 | elixir/serviceradar_core/lib/serviceradar/notifications/receipt_worker.ex:94-98 | elixir/serviceradar_core/lib/serviceradar/notifications/silence_expiry_worker.ex:86-90 — 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.
serviceradar_netprobe::kernel_layout::parse_btf (cyclomatic 20) rust/netprobe/src/kernel_layout.rs:359— serviceradar_netprobe::kernel_layout::parse_btf 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.
serviceradar_netprobe::mdns::parse_mdns_payload (cyclomatic 20) rust/netprobe/src/mdns.rs:213— serviceradar_netprobe::mdns::parse_mdns_payload 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.
serviceradar_netprobe::attribution::drain_ring (cyclomatic 20) rust/netprobe/src/attribution.rs:1755— serviceradar_netprobe::attribution::drain_ring 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.
serviceradar_netprobe::fingerprint::recog_observations (cyclomatic 19) rust/netprobe/src/fingerprint.rs:168— serviceradar_netprobe::fingerprint::recog_observations 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. This is NOT this file's highest cyclomatic complexity: serviceradar_netprobe::fingerprint::signal_name (cyclomatic 24) 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 function is counted neither in this dimension's figures nor in its score.
serviceradar_netprobe::ja4::parse_tls_client_hello (cyclomatic 19) rust/netprobe/src/ja4.rs:61— serviceradar_netprobe::ja4::parse_tls_client_hello 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.
serviceradar_netprobe::server::handle_client (cyclomatic 17) rust/netprobe/src/server.rs:205— serviceradar_netprobe::server::handle_client 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.
Duplicated block (12 lines × 3) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:162— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:162-173 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:204-215 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:159-170 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (12 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:95— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:95-106 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:212-223 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:118-129 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:525— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:525-536 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:533-544 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:424-435 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics.ex:125— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics.ex:125-136 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics.ex:144-155 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics.ex:159-170 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:141— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:141-152 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:168-179 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:186-197 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:762— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:762-773 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1097-1108 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1113-1124 — 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.
serviceradar_netprobe_ebpf::observe_mdns (cognitive 161) rust/netprobe/ebpf/src/lib.rs:2500— serviceradar_netprobe_ebpf::observe_mdns has cognitive complexity 161 (threshold 15). Drivers by points: if/else 90 (127 pts), boolean chains 33, match/switch 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_netprobe_ebpf::observe_l2_device (cognitive 52) rust/netprobe/ebpf/src/lib.rs:2334— serviceradar_netprobe_ebpf::observe_l2_device has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (47 pts), boolean chains 4, match/switch 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.
serviceradar_netprobe_ebpf::parse_tcp_options_from_tc (cognitive 24) rust/netprobe/ebpf/src/lib.rs:2022— serviceradar_netprobe_ebpf::parse_tcp_options_from_tc has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, 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.
serviceradar_netprobe_ebpf::emit_inet_sock_set_state (cognitive 21) rust/netprobe/ebpf/src/lib.rs:762— serviceradar_netprobe_ebpf::emit_inet_sock_set_state has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 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.
serviceradar_netprobe_ebpf::emit_ipv4_tcp_syn_signature_from_tc (cognitive 17) rust/netprobe/ebpf/src/lib.rs:1792— serviceradar_netprobe_ebpf::emit_ipv4_tcp_syn_signature_from_tc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16 (17 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.
god_view_nif::core::layout::layout_nodes_layered (cognitive 74) elixir/web-ng/native/god_view_nif/src/core/layout.rs:362— god_view_nif::core::layout::layout_nodes_layered has cognitive complexity 74 (threshold 15). Drivers by points: loops 15 (36 pts), if/else 13 (35 pts), boolean chains 3 (nesting depth added 43). 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.
god_view_nif::core::causality::evaluate_causal_states_with_reasons_impl (cognitive 38) elixir/web-ng/native/god_view_nif/src/core/causality.rs:83— god_view_nif::core::causality::evaluate_causal_states_with_reasons_impl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (30 pts), loops 5 (6 pts), boolean chains 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.
god_view_nif::core::layout::count_crossings_between_layers (cognitive 28) elixir/web-ng/native/god_view_nif/src/core/layout.rs:185— god_view_nif::core::layout::count_crossings_between_layers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (8 pts), boolean chains 6 (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.
god_view_nif::core::telemetry::select_metric_backed_interface (cognitive 21) elixir/web-ng/native/god_view_nif/src/core/telemetry.rs:78— god_view_nif::core::telemetry::select_metric_backed_interface has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (4 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.
god_view_nif::core::causality::betweenness_scores (cognitive 18) elixir/web-ng/native/god_view_nif/src/core/causality.rs:21— god_view_nif::core::causality::betweenness_scores has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 3 (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.
Publisher::run (cognitive 54) rust/flow-collector/src/publisher.rs:103— Publisher::run has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (35 pts), match/switch 4 (16 pts), boolean chains 2, loops 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.
Publisher::publish_pending (cognitive 46) rust/flow-collector/src/publisher.rs:713— Publisher::publish_pending has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 7 (18 pts), loops 4 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Publisher::connect_once (cognitive 46) rust/flow-collector/src/publisher.rs:972— Publisher::connect_once has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 5 (10 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Publisher::drain_retries_until_empty (cognitive 43) rust/flow-collector/src/publisher.rs:510— Publisher::drain_retries_until_empty has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (39 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Publisher::handle_publish_pass (cognitive 17) rust/flow-collector/src/publisher.rs:362— Publisher::handle_publish_pass has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 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.
Duplicated block (20 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2123— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2123-2142 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2501-2520 — 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 (20 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex:449— elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex:449-468 | elixir/serviceradar_core/lib/serviceradar/nats/supervisor.ex:133-152 — 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 (20 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:118— elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:118-137 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:119-138 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 (20 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/sankey.ex:107— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/sankey.ex:107-126 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/sankey.ex:132-151 — 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 (20 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:227— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:227-246 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:968-987 — 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 (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:85— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:85-100 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex:85-100 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:296— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:296-311 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:444-459 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (16 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:245— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:245-260 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:175-190 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex` and `elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 (16 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/view.ex:12— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/view.ex:12-27 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/view.ex:11-39 — 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 (16 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/components.ex:346— elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/components.ex:346-361 | elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/index.ex:392-407 — 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–11 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:128— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:128-137 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:2060-2070 — 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–11 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:306— elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:306-315 | elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:352-362 — 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–11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:331— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:331-341 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:314-323 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (10–11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:343— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:343-353 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:325-334 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (10–11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4488— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4488-4498 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4522-4531 — 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 × 4) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:81— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:81-88 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:93-100 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:94-101 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:77-84 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (8 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:24— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:24-31 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:181-188 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:268-275 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:91-98 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 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 (8 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:174— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:174-181 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:147-154 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1167-1174 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:981-988 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (8 lines × 4) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:137— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:137-144 | elixir/serviceradar_core/lib/serviceradar/integrations/validations/composite_export.ex:100-107 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/generic_webhook.ex:506-513 | elixir/serviceradar_core/lib/serviceradar/outbound_mail/runtime_config.ex:159-166 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (8 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:151— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:151-158 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:126-133 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1144-1151 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:131-138 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (6 lines × 4) elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:545— elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:545-550 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:608-613 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1640-1645 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:1305-1310 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 × 4) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:103— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:103-108 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:121-126 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:122-127 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:99-104 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:580— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:580-585 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:471-476 | elixir/web-ng/lib/serviceradar_web_ng_web/live/metric_live/show.ex:398-403 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:1087-1092 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 4) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:39— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:39-44 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex:39-44 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/git_catalog_sync_worker.ex:50-55 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_pulse_worker.ex:50-55 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 × 4) elixir/web-ng/lib/serviceradar_web_ng_web/components/observability/signal_display_components.ex:334— elixir/web-ng/lib/serviceradar_web_ng_web/components/observability/signal_display_components.ex:334-339 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2216-2221 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7840-7845 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1896-1901 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
AC3 · Page structure· Page without a main landmark · ×4
Page without a main landmark elixir/web-ng/lib/serviceradar_web_ng_web/components/layouts/root.html.heex: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 openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.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 openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.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 openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
serviceradar_netprobe_ebpf::observe_mdns (cyclomatic 124) rust/netprobe/ebpf/src/lib.rs:2500— serviceradar_netprobe_ebpf::observe_mdns has cyclomatic complexity 124 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
serviceradar_netprobe_ebpf::observe_l2_device (cyclomatic 33) rust/netprobe/ebpf/src/lib.rs:2334— serviceradar_netprobe_ebpf::observe_l2_device 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.
serviceradar_netprobe_ebpf::emit_inet_sock_set_state (cyclomatic 17) rust/netprobe/ebpf/src/lib.rs:762— serviceradar_netprobe_ebpf::emit_inet_sock_set_state 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.
serviceradar_netprobe_ebpf::emit_ipv4_tcp_syn_signature_from_tc (cyclomatic 17) rust/netprobe/ebpf/src/lib.rs:1792— serviceradar_netprobe_ebpf::emit_ipv4_tcp_syn_signature_from_tc 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.
DetectorEngine::evaluate_inner (cyclomatic 35) rust/anomaly-addon/src/engine/mod.rs:1100— DetectorEngine::evaluate_inner 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.
DetectorEngine::apply_metric_class_override (cyclomatic 21) rust/anomaly-addon/src/engine/mod.rs:948— DetectorEngine::apply_metric_class_override 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.
DetectorEngine::evaluate_transition_with_seasonal_key (cyclomatic 20) rust/anomaly-addon/src/engine/mod.rs:1475— DetectorEngine::evaluate_transition_with_seasonal_key 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.
DetectorEngine::restore_checkpoint (cyclomatic 17) rust/anomaly-addon/src/engine/checkpoint.rs:227— DetectorEngine::restore_checkpoint 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.
Publisher::publish_pending (cyclomatic 29) rust/flow-collector/src/publisher.rs:713— Publisher::publish_pending has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Publisher::connect_once (cyclomatic 25) rust/flow-collector/src/publisher.rs:972— Publisher::connect_once 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.
Publisher::run (cyclomatic 22) rust/flow-collector/src/publisher.rs:103— Publisher::run 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.
Publisher::drain_retries_until_empty (cyclomatic 21) rust/flow-collector/src/publisher.rs:510— Publisher::drain_retries_until_empty 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.
DetectorEngine::evaluate_inner (cognitive 67) rust/anomaly-addon/src/engine/mod.rs:1100— DetectorEngine::evaluate_inner has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (57 pts), boolean chains 6, match/switch 3 (4 pts) (nesting depth added 30). 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.
DetectorEngine::evaluate_transition_with_seasonal_key (cognitive 41) rust/anomaly-addon/src/engine/mod.rs:1475— DetectorEngine::evaluate_transition_with_seasonal_key has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 6 (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.
DetectorEngine::restore_checkpoint (cognitive 31) rust/anomaly-addon/src/engine/checkpoint.rs:227— DetectorEngine::restore_checkpoint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 3, loops 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.
DetectorEngine::apply_metric_class_override (cognitive 20) rust/anomaly-addon/src/engine/mod.rs:948— DetectorEngine::apply_metric_class_override has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, 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.
serviceradar_anomaly_addon::frame::process_frame (cognitive 46) rust/anomaly-addon/src/frame.rs:249— serviceradar_anomaly_addon::frame::process_frame has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 5 (6 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_anomaly_addon::engine::apply_drift_lifecycle (cognitive 23) rust/anomaly-addon/src/engine/mod.rs:478— serviceradar_anomaly_addon::engine::apply_drift_lifecycle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 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.
serviceradar_anomaly_addon::frame::apply_emission_budget (cognitive 19) rust/anomaly-addon/src/frame.rs:616— serviceradar_anomaly_addon::frame::apply_emission_budget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4, 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.
serviceradar_anomaly_addon::frame::compact_latest_by_series (cognitive 16) rust/anomaly-addon/src/frame.rs:570— serviceradar_anomaly_addon::frame::compact_latest_by_series has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 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.
Change coupling: engine.rs ↔ REDACTED rust/srql/src/query/engine.rs— `rust/srql/src/query/engine.rs` and `rust/srql/src/query/viz/mod.rs` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `076af47e` feat(srql): add in:mtr_hops SRQL entity with stats aggregations; `69850f53` feat(graph): read topology from Dgraph when GRAPH_READ=dgraph; `d23a1d08` feat(capacity): forecast disk usage per mount point (#415) — run `git show` on any of them.
Change coupling: sweep_service.go ↔ sweeper.go go/pkg/agent/sweep_service.go— `go/pkg/agent/sweep_service.go` and `go/pkg/sweeper/sweeper.go` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `e3553dff` Surface banner grab sweep metrics; `0ab273de` Bridge banner grab matches through netprobe; `be9f3522` feat: label sweep scanner metrics by path — run `git show` on any of them.
Change coupling: attribution.rs ↔ config.rs rust/netprobe/src/attribution.rs— `rust/netprobe/src/attribution.rs` and `rust/netprobe/src/config.rs` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c06f3ef9` Decouple workload identity from netprobe; `03fd589c` Add node-local workload identity attribution; `956525e4` Stop netprobe attribution cache resends by default — run `git show` on any of them.
Change coupling: SidekickRelay.swift ↔ SettingsView.swift swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift— `swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift` and `swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `fdb4b64f` Preserve FieldSurvey session attribution uploads; `1b03487f` Stabilize FieldSurvey streaming and heatmap rendering; `579a3c95` Harden FieldSurvey streaming and stabilize heatmaps — run `git show` on any of them.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (5 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/flow_attribution/correlation.ex:54— elixir/serviceradar_core/lib/serviceradar/flow_attribution/correlation.ex:54-73 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_settings.ex:260-273 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:51-103 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:606-642 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:648-708 — These 5 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 5 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 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:132— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:132-162 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:150-174 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:189-216 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:190-223 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:146-171 — These 5 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 5 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 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:179— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:179-202 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:191-214 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:233-256 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:240-263 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:188-211 — These 5 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 5 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 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1649— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1649-1663 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:54-69 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:46-61 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1040-1055 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:71-79 — These 5 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 5 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 5 times.
Duplicated block (23 lines × 2) elixir/palisade/lib/palisade/network_address_policy.ex:100— elixir/palisade/lib/palisade/network_address_policy.ex:100-122 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:95-117 — before extracting anything, compare `elixir/palisade/lib/palisade/network_address_policy.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 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 (23 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:510— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:510-532 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:311-333 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (23 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:960— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:960-982 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:193-215 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oidc_controller.ex:223— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oidc_controller.ex:223-245 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/saml_controller.ex:681-703 — 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) elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:218— elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:218-239 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rule_matcher.ex:148-169 — 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 (22 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:238— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:238-259 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:260-281 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 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 (22 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:33— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:33-54 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:36-57 — before extracting anything, compare `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 (22 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:417— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:417-438 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:514-535 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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 (17–18 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:931— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:931-948 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:969-985 — 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–18 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:456— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:456-472 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:552-569 — 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–18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:395— elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:395-411 | elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:438-455 — 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–18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:201— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:201-217 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:308-325 — 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) elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:86— elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:86-102 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:213-229 — 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 (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:201— elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:201-217 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:245-261 — 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) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:417— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:417-433 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:562-578 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/template_browser.ex:46— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/template_browser.ex:46-62 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/template_browser.ex:80-96 — 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.
god_view_nif::core::layout::layout_nodes_layered (cyclomatic 31) elixir/web-ng/native/god_view_nif/src/core/layout.rs:362— god_view_nif::core::layout::layout_nodes_layered has cyclomatic complexity 31 (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.
god_view_nif::core::causality::evaluate_causal_states_with_reasons_impl (cyclomatic 21) elixir/web-ng/native/god_view_nif/src/core/causality.rs:83— god_view_nif::core::causality::evaluate_causal_states_with_reasons_impl 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.
god_view_nif::core::layout::count_crossings_between_layers (cyclomatic 19) elixir/web-ng/native/god_view_nif/src/core/layout.rs:185— god_view_nif::core::layout::count_crossings_between_layers 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.
serviceradar_rdp_adapter::protocol::validation::validate_open_payload (cyclomatic 21) rust/rdp-adapter/src/protocol/validation.rs:8— serviceradar_rdp_adapter::protocol::validation::validate_open_payload 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.
serviceradar_rdp_adapter::protocol::validation::validate_credential_grant (cyclomatic 20) rust/rdp-adapter/src/protocol/validation.rs:260— serviceradar_rdp_adapter::protocol::validation::validate_credential_grant 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.
serviceradar_rdp_adapter::runtime::process_frame (cyclomatic 19) rust/rdp-adapter/src/runtime.rs:166— serviceradar_rdp_adapter::runtime::process_frame 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.
Config::validate (cognitive 54) rust/flow-collector/src/config.rs:350— Config::validate has cognitive complexity 54 (threshold 15). Drivers by points: if/else 28 (41 pts), loops 4 (7 pts), boolean chains 6 (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.
Config::validate (cognitive 26) rust/trapd/src/config.rs:100— Config::validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 2 (4 pts), boolean chains 3 (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.
Config::validate (cognitive 17) rust/rperf-client/src/config.rs:114— Config::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 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.
serviceradar_flow_collector::publisher::ensure_flows_stream (cognitive 51) rust/flow-collector/src/publisher.rs:2168— serviceradar_flow_collector::publisher::ensure_flows_stream has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 6, loops 3 (6 pts), match/switch 1 (nesting depth added 24). 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.
serviceradar_flow_collector::main (cognitive 34) rust/flow-collector/src/main.rs:47— serviceradar_flow_collector::main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 5 (10 pts), loops 5 (8 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.
serviceradar_flow_collector::publisher::pattern_covers_pattern (cognitive 16) rust/flow-collector/src/publisher.rs:2403— serviceradar_flow_collector::publisher::pattern_covers_pattern has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (5 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.
otel::nats::stream::ensure_stream (cognitive 48) rust/otel/src/nats/stream.rs:74— otel::nats::stream::ensure_stream has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 2 (6 pts), match/switch 3 (6 pts) (nesting depth added 28). 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.
otel::http_server::handle_otlp (cognitive 21) rust/otel/src/http_server.rs:250— otel::http_server::handle_otlp has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 11 (18 pts), if/else 3 (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.
otel::agent_forward::spool::eviction::count_unacked_records (cognitive 18) rust/otel/src/agent_forward/spool/eviction.rs:123— otel::agent_forward::spool::eviction::count_unacked_records has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 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.
serviceradar_anomaly_core::rpca::jacobi_svd (cognitive 39) rust/anomaly-core/src/rpca.rs:26— serviceradar_anomaly_core::rpca::jacobi_svd has cognitive complexity 39 (threshold 15). Drivers by points: loops 8 (22 pts), if/else 9 (17 pts) (nesting depth added 22). 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.
serviceradar_anomaly_core::rpca::rpca (cognitive 17) rust/anomaly-core/src/rpca.rs:123— serviceradar_anomaly_core::rpca::rpca has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
serviceradar_anomaly_core::seasonal::synthetic_baseline (cognitive 16) rust/anomaly-core/src/seasonal.rs:84— serviceradar_anomaly_core::seasonal::synthetic_baseline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (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.
serviceradar_rdp_adapter::runtime::process_frame (cognitive 29) rust/rdp-adapter/src/runtime.rs:166— serviceradar_rdp_adapter::runtime::process_frame has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 6 (11 pts), boolean chains 1 (nesting depth added 14). 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.
serviceradar_rdp_adapter::protocol::validation::validate_credential_grant (cognitive 21) rust/rdp-adapter/src/protocol/validation.rs:260— serviceradar_rdp_adapter::protocol::validation::validate_credential_grant has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, 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.
serviceradar_rdp_adapter::protocol::validation::validate_open_payload (cognitive 20) rust/rdp-adapter/src/protocol/validation.rs:8— serviceradar_rdp_adapter::protocol::validation::validate_open_payload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 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.
Duplicated block (26–27 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:311— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:311-336 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:786-812 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (26–27 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1240— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1240-1266 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1293-1318 — 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 (26–27 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:96— elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:96-122 | elixir/web-ng/lib/serviceradar_web_ng/remote_desktop_webrtc.ex:155-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.
Duplicated block (24 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1675— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1675-1698 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1094-1117 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (24 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:219— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:219-242 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:259-282 — 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 (24 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:212— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:212-235 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:234-257 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 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 (21 lines × 2) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:197— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:197-217 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:469-489 — 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 (21 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:264— elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:264-284 | elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:299-319 — 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 (21 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1113— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1113-1133 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1252-1272 — 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 (14 lines × 3) elixir/palisade/lib/palisade/outbound_fetch.ex:104— elixir/palisade/lib/palisade/outbound_fetch.ex:104-117 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:72-85 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/outbound_fetch.ex:72-85 — before extracting anything, compare `elixir/palisade/lib/palisade/outbound_fetch.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (14 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:161— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:161-174 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:195-208 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:229-242 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9292— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9292-9305 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9316-9329 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9462-9475 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:135— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:135-147 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:180-192 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:229-241 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:500— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:500-512 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:597-609 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:648-660 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:1167— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:1167-1179 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:1191-1203 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:1211-1223 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:77— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:77-86 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:121-130 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:93-102 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:144-153 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:193-202 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:271— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:271-280 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:55-64 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:98-107 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:149-158 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:198-207 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 5) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:119— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:119-128 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:137-146 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:176-185 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:177-186 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:133-142 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 (24 lines × 2 locations) elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:401— elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:401 · REDACTED:805 — 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 (24 lines × 2 locations) REDACTED:104— REDACTED:104 · js/cli/harness/harness.js:193 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (24 lines × 2 locations) elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:36— elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:36 · elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2 locations) REDACTED:471— REDACTED:471 · REDACTED:498 — 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 (16 lines × 2 locations) elixir/web-ng/assets/js/utils/window_events.js:26— elixir/web-ng/assets/js/utils/window_events.js:26 · elixir/web-ng/assets/js/utils/window_events.js: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 (16 lines × 2 locations) js/cli/harness/dev.js:284— js/cli/harness/dev.js:284 · js/cli/harness/harness.js:233 — 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.
Converter::convert_ipfix (cyclomatic 80) rust/flow-collector/src/netflow/converter.rs:265— Converter::convert_ipfix has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Converter::convert_v9 (cyclomatic 46) rust/flow-collector/src/netflow/converter.rs:103— Converter::convert_v9 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.
Config::validate (cyclomatic 39) rust/flow-collector/src/config.rs:350— Config::validate has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Config::validate (cyclomatic 20) rust/trapd/src/config.rs:100— Config::validate 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.
_draw (cyclomatic 32) elixir/web-ng/assets/js/hooks/charts/NetflowTalkersIcicle.js:120— _draw has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 22 function items inside it that branch (colorFor, (anonymous), (anonymous), …). 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.
_draw (cyclomatic 32) elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:85— _draw has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 belong to 33 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.
serviceradar_flow_collector::publisher::ensure_flows_stream (cyclomatic 29) rust/flow-collector/src/publisher.rs:2168— serviceradar_flow_collector::publisher::ensure_flows_stream has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
serviceradar_flow_collector::main (cyclomatic 23) rust/flow-collector/src/main.rs:47— serviceradar_flow_collector::main has cyclomatic complexity 23 (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.
serviceradar_fieldsurvey_sidekick::live_capture::run_capture (cyclomatic 23) rust/fieldsurvey-sidekick/src/live_capture.rs:26— serviceradar_fieldsurvey_sidekick::live_capture::run_capture has cyclomatic complexity 23 (threshold 15). Of this number, 13 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.
serviceradar_fieldsurvey_sidekick::capture::parse_radiotap (cyclomatic 16) rust/fieldsurvey-sidekick/src/capture.rs:24— serviceradar_fieldsurvey_sidekick::capture::parse_radiotap 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.
otel::http_server::handle_otlp (cyclomatic 20) rust/otel/src/http_server.rs:250— otel::http_server::handle_otlp 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.
otel::nats::stream::ensure_stream (cyclomatic 19) rust/otel/src/nats/stream.rs:74— otel::nats::stream::ensure_stream 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.
serviceradar_anomaly_disposition::bin::disposition-backtest::parse_args (cyclomatic 19) rust/anomaly-disposition/src/bin/disposition-backtest.rs:44— serviceradar_anomaly_disposition::bin::disposition-backtest::parse_args has cyclomatic complexity 19 (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.
serviceradar_anomaly_disposition::disposition::peak_profile::evaluate_peak_profile (cyclomatic 18) rust/anomaly-disposition/src/disposition/peak_profile/mod.rs:88— serviceradar_anomaly_disposition::disposition::peak_profile::evaluate_peak_profile 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.
Unbounded dependency requirement: postgrex — Runtime dependency `:postgrex` is declared `">= 0.0.0"` in elixir/serviceradar_core/mix.exs, which has no upper bound — every future MAJOR release of `:postgrex` satisfies it, so the next unlocked resolve can pull a breaking change. Use `~>` (e.g. `"~> 1.0"`) to bound the requirement to a compatible range.
Unbounded dependency requirement: postgrex — Runtime dependency `:postgrex` is declared `">= 0.0.0"` in elixir/web-ng/mix.exs, which has no upper bound — every future MAJOR release of `:postgrex` satisfies it, so the next unlocked resolve can pull a breaking change. Use `~>` (e.g. `"~> 1.0"`) to bound the requirement to a compatible range.
Converter::convert_ipfix (cognitive 142) rust/flow-collector/src/netflow/converter.rs:265— Converter::convert_ipfix has cognitive complexity 142 (threshold 15). Drivers by points: if/else 21 (126 pts), loops 3 (8 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Converter::convert_v9 (cognitive 69) rust/flow-collector/src/netflow/converter.rs:103— Converter::convert_v9 has cognitive complexity 69 (threshold 15). Drivers by points: if/else 9 (54 pts), loops 3 (8 pts), match/switch 2 (7 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_config_validator::evaluate (cognitive 47) config/manager_validator/rust/src/lib.rs:178— serviceradar_config_validator::evaluate has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 10 (18 pts), boolean chains 1 (nesting depth added 21). 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.
serviceradar_config_validator::text::flatten (cognitive 24) config/manager_validator/rust/src/text.rs:59— serviceradar_config_validator::text::flatten has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 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.
OtelCollectorAddon::configure (cognitive 32) rust/otel-addon/src/addon.rs:368— OtelCollectorAddon::configure has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 6 (11 pts), boolean chains 3 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OtelCollectorAddon::relay_otlp (cognitive 16) rust/otel-addon/src/addon.rs:581— OtelCollectorAddon::relay_otlp has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 2 (6 pts), loops 2 (nesting depth added 8). 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.
correlation_engine::god_view::evaluate_correlation_states (cognitive 30) rust/correlation-engine/src/god_view.rs:96— correlation_engine::god_view::evaluate_correlation_states has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 3 (4 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.
correlation_engine::context_hydrator::parse_topology_edges (cognitive 18) rust/correlation-engine/src/context_hydrator.rs:275— correlation_engine::context_hydrator::parse_topology_edges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 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.
serviceradar_trapd::main (cognitive 26) rust/trapd/src/main.rs:75— serviceradar_trapd::main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 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.
serviceradar_trapd::spiffe::load_server_credentials (cognitive 16) rust/trapd/src/spiffe.rs:28— serviceradar_trapd::spiffe::load_server_credentials has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (4 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.
network_config_downparser::apply_command (cognitive 23) rust/network-config-downparser/src/lib.rs:124— network_config_downparser::apply_command has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (22 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.
network_config_downparser::parse (cognitive 17) rust/network-config-downparser/src/lib.rs:40— network_config_downparser::parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 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.
D22 · Internal API Consistency· Inconsistent return types for equivalent operations · ×2
Inconsistent return types for equivalent operations: ArrowArrayHolderImpl and ImportArrayHolder return [Data] directly, while ChunkedArrayHolder returns Result<[Data], ArrowError>. This forces consumers to handle errors differently depending on which holder type they are interacting with, despite the operation (getting buffer data) being conceptually the same. — Standardize the return type to Result<[Data], ArrowError> (or a similar error-handling wrapper) across all holder types, or ensure the non-error-returning variants never fail and document this clearly. (signatures: ArrowArrayHolderImpl.getBufferData: () -> [Data] | ImportArrayHolder.getBufferData: () -> [Data] | ChunkedArrayHolder.getBufferData: () -> Result<[Data], ArrowError>)
Inconsistent return types for equivalent operations: Similar to getBufferData, the size retrieval method returns [Int] directly in some holders but Result<[Int], ArrowError> in ChunkedArrayHolder. — Standardize the return type to Result<[Int], ArrowError> across all holder types. (signatures: ArrowArrayHolderImpl.getBufferDataSizes: () -> [Int] | ImportArrayHolder.getBufferDataSizes: () -> [Int] | ChunkedArrayHolder.getBufferDataSizes: () -> Result<[Int], ArrowError>)
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:132— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:132-146 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:167-181 — 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) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1237— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1237-1252 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1257-1272 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (10 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:98— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:98-107 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:56-65 | elixir/serviceradar_core/lib/serviceradar/identity/cli_auth_cleanup_worker.ex:87-96 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:90-99 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:40-49 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_worker.ex:53-62 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_legacy_assignment_recovery_worker.ex:95-104 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_dispatch_worker.ex:70-79 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:36-45 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_monitor_worker.ex:77-86 — These 10 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 10 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 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:361— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:361-381 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:479-496 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:527-544 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:179-187 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1064-1072 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1098-1106 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1115-1123 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1196-1204 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1408-1416 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:2015-2023 — These 10 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 10 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 10 times.
Duplicated block (39 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:592— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:592-630 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:407-445 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (39 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/bmp_settings.ex:126— elixir/serviceradar_core/lib/serviceradar/observability/bmp_settings.ex:126-164 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_settings.ex:112-193 — 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 (33 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:903— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:903-935 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:943-975 — 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 (33 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1069— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1069-1101 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:493-525 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (32 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:39— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:39-70 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:285-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.
Duplicated block (32 lines × 2) elixir/serviceradar_core/lib/serviceradar/dashboards/paper_trail_mixin.ex:5— elixir/serviceradar_core/lib/serviceradar/dashboards/paper_trail_mixin.ex:5-36 | elixir/serviceradar_core/lib/serviceradar/security/paper_trail_mixin.ex:5-36 — 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 (26 lines × 2) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:250— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:250-275 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:479-504 — 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 (26 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/preset_rule_resource.ex:117— elixir/serviceradar_core/lib/serviceradar/observability/preset_rule_resource.ex:117-142 | elixir/serviceradar_core/lib/serviceradar/observability/zen_preset_resource.ex:111-136 — 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 (19–22 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:365— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:365-386 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:280-298 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex` as WHOLE FILES: this scan already matched 9 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.
Duplicated block (19–22 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:194— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:194-215 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:451-469 — 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 (19–20 lines × 2) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:913— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:913-932 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:945-963 — 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 (19–20 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:768— elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:768-787 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:825-843 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 136 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 (19 lines × 3) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:201— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:201-219 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:309-327 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:473-491 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:82— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:82-100 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:126-144 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:168-186 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:364— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:364-380 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:396-412 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:428-444 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:342— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:342-358 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/providers/alien_vault_otx.ex:264-280 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/stix_indicator.ex:101-117 — 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.
Duplicated block (16–17 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1364— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1364-1379 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:843-859 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 236 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 (16–17 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex:390— elixir/web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex:390-406 | elixir/web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex:452-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:66— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:66-81 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:116-131 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:145-160 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:479— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:479-494 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:487-502 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:378-393 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14–15 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:525— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:525-539 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:396-409 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 (14–15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:942— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:942-955 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:972-986 — 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 (11–15 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:65— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:65-79 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:86-96 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (11–15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:26— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:26-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:99-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 (12–13 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/source.ex:70— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/source.ex:70-81 | elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/source.ex:85-97 — 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–13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:99— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:99-111 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:128-139 — 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 (11–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/core/result_processor.ex:256— elixir/serviceradar_core/lib/serviceradar/core/result_processor.ex:256-267 | elixir/serviceradar_core/lib/serviceradar/results_router.ex:806-816 — 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–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:478— elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:478-489 | elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:533-543 — 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–12 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:211— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:211-222 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:244-253 — 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–12 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:73— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:73-84 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:189-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:423— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:423-432 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:499-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.
Duplicated block (9–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:51— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:51-60 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:67-75 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex` and `elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 (9 lines × 4) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1316— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1316-1324 | elixir/serviceradar_core/lib/serviceradar/agent_tracker.ex:191-199 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1323-1331 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:373-381 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (9 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:26— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:26-34 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:43-51 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:80-88 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:107-115 — 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.
Duplicated block (8–9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:215— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:215-222 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:244-252 — 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–9 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/authorization_settings_controller.ex:40— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/authorization_settings_controller.ex:40-47 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/bmp_settings_controller.ex:35-43 — 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–8 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:194— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:194-201 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:213-220 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:148-154 — 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.
Duplicated block (7–8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:287— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:287-294 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:309-315 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:330-336 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2046— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2046-2052 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2132-2139 — 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–8 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:295— elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:295-302 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:336-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.
Duplicated block (5 lines × 5) elixir/serviceradar_core/lib/serviceradar/flow_attribution/correlation.ex:66— elixir/serviceradar_core/lib/serviceradar/flow_attribution/correlation.ex:66-73 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_settings.ex:269-273 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:99-103 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:638-642 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:704-708 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:43— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:43-47 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:80-84 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:107-111 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:111-119 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:409-417 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:113— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:113-119 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:89-95 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:108-114 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:76-82 — before extracting anything, compare `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/index.ex:426— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/index.ex:426-432 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/show.ex:653-659 | elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:2002-2008 | elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:466-472 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 2 locations) elixir/web-ng/assets/js/hooks/JdmEditorHook.js:91— elixir/web-ng/assets/js/hooks/JdmEditorHook.js:91 · elixir/web-ng/assets/js/hooks/JdmEditorHook.js:143 — 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 (23 lines × 2 locations) js/cli/src/validation.ts:158— js/cli/src/validation.ts:158 · js/cli/src/validation.ts:252 — 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 with local edits (19 matched lines × 2 locations) · ×2
Duplicated block with local edits (19 matched lines × 2 locations) elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:24— elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:24 · elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:105 — the two spans are one implementation copied and then locally edited — 218 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (19 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:64— elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:64 · elixir/web-ng/assets/js/hooks/charts/NetflowTalkersIcicle.js:102 — the two spans are one implementation copied and then locally edited — 92 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 (16 matched lines × 2 locations) · ×2
Duplicated block with local edits (16 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:8— elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:8 · elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:77 — the two spans are one implementation copied and then locally edited — 87 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (16 matched lines × 2 locations) elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:87— elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:87 · elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:128 — the two spans are one implementation copied and then locally edited — 268 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (15 matched lines × 2 locations) · ×2
Duplicated block with local edits (15 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/SRQLInput.js:48— elixir/web-ng/assets/js/hooks/SRQLInput.js:48 · elixir/web-ng/assets/js/hooks/SRQLInput.js:93 — the two spans are one implementation copied and then locally edited — 156 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (15 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:274— elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:274 · elixir/web-ng/assets/js/hooks/charts/NetflowTrafficTooltip.js:128 — the two spans are one implementation copied and then locally edited — 136 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (14 lines × 2 locations) elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:551— elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:551 · elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:687 — 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 (14 lines × 2 locations) elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:81— elixir/web-ng/assets/js/hooks/RemoteAccessSSHConsole.js:81 · elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:34 — 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.
REDACTED contrast colour pair in CSS (3.1:1) elixir/web-ng/assets/css/app.css:6322— `[data-theme="light"] .sr-mtr-radial` sets color: #059669 on background-color: #e2e8f0 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 37 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
RemoteAccessSSHConsole.Component (cyclomatic 152) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— RemoteAccessSSHConsole.Component has cyclomatic complexity 152 (threshold 15). Of this number, 83 points are the body's own statements and 69 belong to 20 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.
_renderSvgOverlay (cyclomatic 140) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1546— _renderSvgOverlay has cyclomatic complexity 140 (threshold 15). Of this number, 17 points are the body's own statements and 123 belong to 32 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.
_draw (cyclomatic 133) elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:25— _draw has cyclomatic complexity 133 (threshold 15). Of this number, 53 points are the body's own statements and 80 belong to 33 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.
layout_elk_scene.validateTopologyScene (cyclomatic 92) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1030— layout_elk_scene.validateTopologyScene has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
renderSelectionDetails (cyclomatic 85) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:49— renderSelectionDetails has cyclomatic complexity 85 (threshold 15). Of this number, 60 points are the body's own statements and 25 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.
buildTopologySceneEdgeData (cyclomatic 80) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:403— buildTopologySceneEdgeData has cyclomatic complexity 80 (threshold 15). Most of this is not in the body itself: 10 of the 80 points are its own statements and the rest belongs to 30 function items inside it that branch ((anonymous), (anonymous)::metadataNumber, classBucketForEdge, …). 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.
buildTransportAndEffectLayers (cyclomatic 68) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:9— buildTransportAndEffectLayers has cyclomatic complexity 68 (threshold 15). Of this number, 24 points are the body's own statements and 44 belong to 45 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.
RemoteAccessDesktopSession.Component (cyclomatic 62) elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:392— RemoteAccessDesktopSession.Component has cyclomatic complexity 62 (threshold 15). Most of this is not in the body itself: 14 of the 62 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 432, 681, 628, …). 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.
layout_elk_radial_overview.validateTopologyOverview (cyclomatic 62) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:395— layout_elk_radial_overview.validateTopologyOverview has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
aggregateVisibleEdges (cyclomatic 59) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:624— aggregateVisibleEdges has cyclomatic complexity 59 (threshold 15). Of this number, 29 points are the body's own statements and 30 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
god_view_acceptance_geometry_observer.acceptanceGeometrySnapshot (cyclomatic 58) elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:169— god_view_acceptance_geometry_observer.acceptanceGeometrySnapshot has cyclomatic complexity 58 (threshold 15). Of this number, 20 points are the body's own statements and 38 belong to 9 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.
validator.field (cyclomatic 57) config/manager_validator/go/validate.go:74— validator.field has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.parseProxmoxProviderRef (cyclomatic 49) REDACTED:560— main.parseProxmoxProviderRef has cyclomatic complexity 49 (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.
browserModuleApi (cyclomatic 49) REDACTED:516— browserModuleApi has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 4 of the 49 points are its own statements and the rest belongs to 34 function items inside it that branch (arrowBytes, pushSrqlQuery, pageFrame, …). 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.
buildPacketFlowInstances (cyclomatic 45) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:20— buildPacketFlowInstances has cyclomatic complexity 45 (threshold 15). Of this number, 39 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.
RemoteAccessDesktopSession.createRdpLauncherRuntime (cyclomatic 44) elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:88— RemoteAccessDesktopSession.createRdpLauncherRuntime has cyclomatic complexity 44 (threshold 15). Of this number, 33 points are the body's own statements and 11 belong to 4 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.
_showFlowDetails (cyclomatic 44) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1484— _showFlowDetails has cyclomatic complexity 44 (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.
SurveyView.body (cyclomatic 43) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:75— SurveyView.body has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteAccessApplication.Component (cyclomatic 43) elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:77— RemoteAccessApplication.Component has cyclomatic complexity 43 (threshold 15). Of this number, 30 points are the body's own statements and 13 belong to 4 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.
OperationsTrafficMap.normalizeTrafficLinks (cyclomatic 43) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:209— OperationsTrafficMap.normalizeTrafficLinks has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 211, 285). 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.
buildVisibleGraphData (cyclomatic 42) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:140— buildVisibleGraphData 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.
bindChart (cyclomatic 42) elixir/web-ng/assets/js/hooks/charts/TimeseriesCombinedChart.js:14— bindChart has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 14 function items inside it that branch (formatValue, showTooltip::(anonymous), formatBytes, …). 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.
validator.evaluate (cyclomatic 41) config/manager_validator/go/validate.go:256— validator.evaluate 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.
RemoteAccessTerminal.Component (cyclomatic 40) elixir/web-ng/assets/component/src/RemoteAccessTerminal.jsx:78— RemoteAccessTerminal.Component has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 5 of the 40 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 217, 101, 259, …). 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.
admitNodeLabelsForViewport (cyclomatic 40) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:286— admitNodeLabelsForViewport has cyclomatic complexity 40 (threshold 15). Of this number, 25 points are the body's own statements and 15 belong to 9 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.
Lifecycle.validate_scope (cyclomatic 38) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:638— Lifecycle.validate_scope has cyclomatic complexity 38 (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.
serviceradar_config_validator::evaluate (cyclomatic 38) config/manager_validator/rust/src/lib.rs:178— serviceradar_config_validator::evaluate has cyclomatic complexity 38 (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.
handleSnapshot (cyclomatic 36) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:77— handleSnapshot has cyclomatic complexity 36 (threshold 15). Of this number, 34 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.
SYNScanner.runRingReader (cyclomatic 35) REDACTED:130— SYNScanner.runRingReader 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.
harness.instantiateDashboardWasm (cyclomatic 35) js/cli/harness/harness.js:266— harness.instantiateDashboardWasm has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 274, 270, 290, …). 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.
Context.grant_matches? (cyclomatic 34) elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:228— Context.grant_matches? has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
getNodeTooltip (cyclomatic 34) elixir/web-ng/assets/js/lib/god_view/rendering_tooltip_methods.js:75— getNodeTooltip 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.
bindChart (cyclomatic 34) elixir/web-ng/assets/js/hooks/charts/TimeseriesChart.js:15— bindChart has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 11 of the 34 points are its own statements and the rest belongs to 10 function items inside it that branch (formatValue, formatBytes, formatHz, …). 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.
runConfig.normalize (cyclomatic 33) go/cmd/tools/mapper-baseline/main.go:336— runConfig.normalize 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.
edgeonboarding.EnrollAgentFromToken (cyclomatic 33) REDACTED:79— edgeonboarding.EnrollAgentFromToken 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.
importsFor (cyclomatic 33) REDACTED:924— importsFor has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 30 function items inside it that branch (framePayloadBytes, emitRenderModel, encodedFrame, …). 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.
serviceradar_rdp_connector_probe::probe::connector::validate_service_radar_open_request (cyclomatic 32) rust/rdp-connector-probe/src/probe/connector.rs:1— serviceradar_rdp_connector_probe::probe::connector::validate_service_radar_open_request has cyclomatic complexity 32 (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.
layout_elk_radial_overview.decodeElkRadialOverview (cyclomatic 32) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:307— layout_elk_radial_overview.decodeElkRadialOverview has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 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.
login.runDeviceCodeFlow (cyclomatic 32) js/cli/src/auth/login.ts:62— login.runDeviceCodeFlow 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.
_applyBrandBasemapTint (cyclomatic 32) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:192— _applyBrandBasemapTint has cyclomatic complexity 32 (threshold 15). Of this number, 30 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.
main.projectAWXSurveyField (cyclomatic 31) go/cmd/wasm-plugins/awx/main.go:2842— main.projectAWXSurveyField has cyclomatic complexity 31 (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.
SettingsView.body (cyclomatic 31) swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:29— SettingsView.body has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemoteAccessTCPText.Component (cyclomatic 31) elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:48— RemoteAccessTCPText.Component 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, 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.
publish.publishCommand (cyclomatic 31) js/cli/src/dashboard/publish.ts:19— publish.publishCommand has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
apply.applyCommand (cyclomatic 31) js/cli/src/plugin/apply.ts:70— apply.applyCommand has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
createContext (cyclomatic 31) js/cli/harness/dev.js:30— createContext has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 10 function items inside it that branch (swapFixture, loadFrames, mount, …). 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.
decodeArrowGraph (cyclomatic 31) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_decode_methods.js:17— decodeArrowGraph has cyclomatic complexity 31 (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.
Ubuntu.validate_fingerprint (cyclomatic 30) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:854— Ubuntu.validate_fingerprint has cyclomatic complexity 30 (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.
main.runBGPSimulator (cyclomatic 30) go/cmd/faker/bgp_sim.go:42— main.runBGPSimulator 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Config.Validate (cyclomatic 30) go/cmd/faker/main.go:414— Config.Validate 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.
main.projectPreparedPass (cyclomatic 30) go/cmd/tools/ubuntu-feed-merge/main.go:1146— main.projectPreparedPass 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.
agent.proxmoxInventoryPathAllowed (cyclomatic 30) go/pkg/agent/plugin_runtime_host_authority.go:953— agent.proxmoxInventoryPathAllowed has cyclomatic complexity 30 (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.
edgeonboarding.EnrollCollectorFromToken (cyclomatic 30) REDACTED:64— edgeonboarding.EnrollCollectorFromToken has cyclomatic complexity 30 (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.
resourceDefinition.save (cyclomatic 30) go/pkg/terraformprovider/attributes.go:108— resourceDefinition.save 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.
RPerfRunner.runTest (cyclomatic 30) swift/RPerfClient/Sources/RPerfClient/RPerfClient.swift:75— RPerfRunner.runTest 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.
LiveAwxLaunchPreflight.membership_request_host (cyclomatic 29) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:383— LiveAwxLaunchPreflight.membership_request_host 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.
main.parseRunConfig (cyclomatic 29) go/cmd/tools/mapper-baseline/main.go:183— main.parseRunConfig 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.
main.validateOSVAffected (cyclomatic 29) go/cmd/tools/ubuntu-feed-merge/projector.go:691— main.validateOSVAffected has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pluginExecution.hostHTTPRequest (cyclomatic 29) REDACTED:103— pluginExecution.hostHTTPRequest 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.
cli.RunEdgePackageDownload (cyclomatic 29) go/pkg/cli/edge_onboarding.go:469— cli.RunEdgePackageDownload 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.
god_view_acceptance_geometry_observer.renderedRouteStrokeWidth (cyclomatic 29) elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:133— god_view_acceptance_geometry_observer.renderedRouteStrokeWidth has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 136, 138, 135). 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.
layout_topology_state_methods.detailTopologySceneFromGeometry (cyclomatic 29) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:196— layout_topology_state_methods.detailTopologySceneFromGeometry has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 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.
buildNodeAndLabelLayers (cyclomatic 29) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:380— buildNodeAndLabelLayers has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 belong to 28 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.
SecureExecutionCurrentAuthority.exact_approval_snapshot (cyclomatic 28) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:309— SecureExecutionCurrentAuthority.exact_approval_snapshot 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.
main.buildLaunchBody (cyclomatic 28) go/cmd/wasm-plugins/awx/main.go:1221— main.buildLaunchBody 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.
Collector.Collect (cyclomatic 28) REDACTED:30— Collector.Collect has cyclomatic complexity 28 (threshold 15). Of this number, 25 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.
agent.validateProxmoxConsoleBindingTargetIDs (cyclomatic 28) go/pkg/agent/plugin_runtime_host_authority.go:376— agent.validateProxmoxConsoleBindingTargetIDs has cyclomatic complexity 28 (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.
pluginExecution.hostWebSocketConnect (cyclomatic 28) REDACTED:353— pluginExecution.hostWebSocketConnect 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.
PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks (cyclomatic 28) go/pkg/agent/push_loop_addons.go:334— PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks 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.
remoteaccess.validateDesktopFrame (cyclomatic 28) go/pkg/agent/remoteaccess/desktop_frame.go:124— remoteaccess.validateDesktopFrame 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.
Driver.Sync (cyclomatic 28) go/pkg/agent/syncsources/armis/driver.go:56— Driver.Sync 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.
DiscoveryEngine.querySNMPL2Neighbors (cyclomatic 28) go/pkg/mapper/snmp_l2_query.go:29— DiscoveryEngine.querySNMPL2Neighbors has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 53, 102, 118). 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.
Tracer.matchProbeResponse (cyclomatic 28) go/pkg/mtr/tracer.go:597— Tracer.matchProbeResponse has cyclomatic complexity 28 (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.
configurationResource.ModifyPlan (cyclomatic 28) go/pkg/terraformprovider/resource.go:43— configurationResource.ModifyPlan 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.
ArrowType.fromCDataFormatId (cyclomatic 28) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:412— ArrowType.fromCDataFormatId 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.
DashboardBuilderCanvas.MiniVisual (cyclomatic 28) elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:227— DashboardBuilderCanvas.MiniVisual 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, 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.
handlePick (cyclomatic 28) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:329— handlePick has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
agent.parseMtrCheckConfig (cyclomatic 27) go/pkg/agent/mtr_checker.go:328— agent.parseMtrCheckConfig 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.
MultiSweepService.UpdateSweepGroupsContext (cyclomatic 27) go/pkg/agent/multi_sweep_service.go:223— MultiSweepService.UpdateSweepGroupsContext has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
k8sinventory.matchSliceTargets (cyclomatic 27) go/pkg/k8sinventory/build.go:351— k8sinventory.matchSliceTargets 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.
ArrowArrayBuilders.loadBuilder (cyclomatic 27) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:207— ArrowArrayBuilders.loadBuilder 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.
ArrowUnkeyedDecoding.decode (cyclomatic 27) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowDecoder.swift:154— ArrowUnkeyedDecoding.decode has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ArrowType.cDataFormatId (cyclomatic 27) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:345— ArrowType.cDataFormatId 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.
expandableEndpointClusterId (cyclomatic 27) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:219— expandableEndpointClusterId has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
focusClusterNeighborhood (cyclomatic 27) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1173— focusClusterNeighborhood has cyclomatic complexity 27 (threshold 15). Of this number, 19 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.
Ubuntu.validate_assertion_kind (cyclomatic 26) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:673— Ubuntu.validate_assertion_kind 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.
RemoteAccessStreamHandler.handle_in (cyclomatic 26) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:145— RemoteAccessStreamHandler.handle_in 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.
main.normalizeCallbackCredentialType (cyclomatic 26) go/cmd/wasm-plugins/awx/main.go:605— main.normalizeCallbackCredentialType 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.
agent.validateProxmoxPublicParams (cyclomatic 26) go/pkg/agent/plugin_runtime_host_authority.go:461— agent.validateProxmoxPublicParams 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 one function literal inside it that branches (line 487). 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.
pluginExecution.trustedProxmoxConsoleSSHConfig (cyclomatic 26) go/pkg/agent/plugin_runtime_host_authority.go:2008— pluginExecution.trustedProxmoxConsoleSSHConfig 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.
pluginExecution.authorizeCredentialBrokerHTTPRequestBody (cyclomatic 26) go/pkg/agent/plugin_runtime_http_body_policy.go:30— pluginExecution.authorizeCredentialBrokerHTTPRequestBody 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.
agentgateway.reassembleConfigChunks (cyclomatic 26) go/pkg/agentgateway/gateway_client.go:655— agentgateway.reassembleConfigChunks 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.
ArrowArrayBuilders.isValidBuilderType (cyclomatic 26) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:240— ArrowArrayBuilders.isValidBuilderType 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.
ArrowArrayBuilders.loadBuilder (cyclomatic 26) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:274— ArrowArrayBuilders.loadBuilder has cyclomatic complexity 26 (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.
NetflowGridChart.gridPanelAtPointer (cyclomatic 26) elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:70— NetflowGridChart.gridPanelAtPointer 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.
dev.devCommandHmr (cyclomatic 26) js/cli/src/dashboard/dev.ts:51— dev.devCommandHmr has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, 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.
edgeEnabledByTopologyLayer (cyclomatic 26) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_topology_methods.js:143— edgeEnabledByTopologyLayer 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.
clusterEdges (cyclomatic 26) elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:167— clusterEdges has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to one function literal inside it that branches (line 170). 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.
ControllerProvenance.exact_command_payload (cyclomatic 25) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:577— ControllerProvenance.exact_command_payload 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.
main.normalizeLaunchPreflightAddress (cyclomatic 25) go/cmd/wasm-plugins/awx/launch_preflight.go:560— main.normalizeLaunchPreflightAddress 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.
agent.validCallbackURL (cyclomatic 25) go/pkg/agent/awx_callback_credential.go:508— agent.validCallbackURL 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 is NOT this file's highest cyclomatic complexity: agent.validateAWXCallbackCredentialBinding (cyclomatic 28) 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 function is counted neither in this dimension's figures nor in its score.
agent.intLikeFromAny (cyclomatic 25) go/pkg/agent/metric_envelope.go:855— agent.intLikeFromAny has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
agent.validatePluginHostAuthorityBinding (cyclomatic 25) go/pkg/agent/plugin_runtime_host_authority.go:244— agent.validatePluginHostAuthorityBinding 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.
agent.buildSweepResultsChunks (cyclomatic 25) go/pkg/agent/push_loop_sweep_results.go:181— agent.buildSweepResultsChunks 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.
PushLoop.handleMtrBulkRun (cyclomatic 25) go/pkg/agent/mtr_bulk.go:126— PushLoop.handleMtrBulkRun has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 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.
CoreServiceConfig.Validate (cyclomatic 25) REDACTED:400— CoreServiceConfig.Validate 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.
layout_elk_scene.decodeElkScene (cyclomatic 25) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:632— layout_elk_scene.decodeElkScene has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 691, 638, 726, …). 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.
publish.errorHint (cyclomatic 25) js/cli/src/dashboard/publish.ts:183— publish.errorHint has cyclomatic complexity 25 (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.
mounted (cyclomatic 25) elixir/web-ng/assets/js/hooks/SpatialSurveyMap.js:2— mounted has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 16 function items inside it that branch (initDeck, setEmptyState, resizeDeck, …). 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.
renderSvgFallback (cyclomatic 25) REDACTED:1722— renderSvgFallback has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 9 function items inside it that branch (labelFor, (anonymous), (anonymous)::(anonymous), …). 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.
selectNodeLabels (cyclomatic 25) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:180— selectNodeLabels has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 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.
Context.new (cyclomatic 24) elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:79— Context.new 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.
EndpointVulnerabilityAdjudicator.trusted_assertion_provenance? (cyclomatic 24) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:671— EndpointVulnerabilityAdjudicator.trusted_assertion_provenance? 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.
main.reviewedAWXSurveyVariable (cyclomatic 24) go/cmd/wasm-plugins/awx/main.go:2923— main.reviewedAWXSurveyVariable 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.
main.streamAxisRTSP (cyclomatic 24) go/cmd/wasm-plugins/axis/rtsp_stream.go:12— main.streamAxisRTSP 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.
main.streamProxmoxAPIConsole (cyclomatic 24) REDACTED:319— main.streamProxmoxAPIConsole 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.
main.ensureCanonicalPURLSize (cyclomatic 24) go/cmd/tools/ubuntu-feed-merge/projector.go:1617— main.ensureCanonicalPURLSize has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1619). 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.
runner.runOnce (cyclomatic 24) go/pkg/agent/addon/manager.go:510— runner.runOnce 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.
agent.validatePluginActionGrantAllow (cyclomatic 24) go/pkg/agent/plugin_runtime_actions.go:326— agent.validatePluginActionGrantAllow 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.
agent.validateCredentialBrokerRequestBodyPolicy (cyclomatic 24) go/pkg/agent/plugin_runtime_actions.go:377— agent.validateCredentialBrokerRequestBodyPolicy 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.
agent.newConsoleSpecAuthorityState (cyclomatic 24) go/pkg/agent/plugin_runtime_host_authority.go:1513— agent.newConsoleSpecAuthorityState 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.
agent.parseSystemdUnitStatusOutputForUnit (cyclomatic 24) go/pkg/agent/push_loop_capabilities.go:719— agent.parseSystemdUnitStatusOutputForUnit has cyclomatic complexity 24 (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.
otlpRelayPump.run (cyclomatic 24) go/pkg/agent/addon_otlp_relay.go:344— otlpRelayPump.run 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PushLoop.handleAdhocScan (cyclomatic 24) go/pkg/agent/adhoc_scan.go:128— PushLoop.handleAdhocScan has cyclomatic complexity 24 (threshold 15). Of this number, 18 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.
PushLoop.pushStatus (cyclomatic 24) go/pkg/agent/push_loop.go:507— PushLoop.pushStatus 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.
PushLoop.applyConfigResponseWithSequence (cyclomatic 24) go/pkg/agent/push_loop_config.go:131— PushLoop.applyConfigResponseWithSequence 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.
endpointinventory.validateConfig (cyclomatic 24) go/pkg/endpointinventory/config.go:281— endpointinventory.validateConfig 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.
DiscoveryEngine.runDiscoveryJob (cyclomatic 24) go/pkg/mapper/discovery_run.go:25— DiscoveryEngine.runDiscoveryJob 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.
NetworkSweeper.runSweep (cyclomatic 24) go/pkg/sweeper/sweeper_run.go:102— NetworkSweeper.runSweep has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 4 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.
serviceradar_anomaly_addon::frame::process_frame (cyclomatic 24) rust/anomaly-addon/src/frame.rs:249— serviceradar_anomaly_addon::frame::process_frame 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.
OperationsTrafficMap.topologySchematicLinks (cyclomatic 24) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:143— OperationsTrafficMap.topologySchematicLinks has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 173, 147, 161, …). 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.
buildMtrPathEdgeData (cyclomatic 24) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:359— buildMtrPathEdgeData has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 369, 403). 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.
handleDetailsPanelClick (cyclomatic 24) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:202— handleDetailsPanelClick 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.
AwxLaunchPreflightAttestation.verify_evidence (cyclomatic 23) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:229— AwxLaunchPreflightAttestation.verify_evidence 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.
HardenedLaunchPlan.build (cyclomatic 23) elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:32— HardenedLaunchPlan.build 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.
CurrentAuthority.current_approval_snapshot (cyclomatic 23) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:782— CurrentAuthority.current_approval_snapshot 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.
check_extension_abi.main (cyclomatic 23) docker/images/check_extension_abi.py:191— check_extension_abi.main 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.
main.projectAWXTemplate (cyclomatic 23) go/cmd/wasm-plugins/awx/main.go:2630— main.projectAWXTemplate has cyclomatic complexity 23 (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.
main.run (cyclomatic 23) REDACTED:140— main.run 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.
main.validateManifestInventory (cyclomatic 23) go/cmd/tools/ubuntu-feed-merge/main.go:1060— main.validateManifestInventory has cyclomatic complexity 23 (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: main.validateLimits (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
pluginExecution.proxmoxHostAuthorityForHTTPRequest (cyclomatic 23) go/pkg/agent/plugin_runtime_host_authority.go:1016— pluginExecution.proxmoxHostAuthorityForHTTPRequest 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.
PushLoop.collectAllStatusesSeparated (cyclomatic 23) go/pkg/agent/push_loop_status.go:492— PushLoop.collectAllStatusesSeparated 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.
armis.buildMetadata (cyclomatic 23) go/pkg/agent/syncsources/armis/update.go:58— armis.buildMetadata 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.
mapper.applyTopologyEvidenceClass (cyclomatic 23) go/pkg/mapper/discovery_topology_evidence.go:23— mapper.applyTopologyEvidenceClass has cyclomatic complexity 23 (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.
Tracer.sendProbes (cyclomatic 23) go/pkg/mtr/tracer.go:327— Tracer.sendProbes 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.
layout_topology_state_methods.overviewTopologySceneFromGeometry (cyclomatic 23) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:283— layout_topology_state_methods.overviewTopologySceneFromGeometry has cyclomatic complexity 23 (threshold 15). Of this number, 15 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.
rendering_graph_view_methods.managedRouteSeparationConstraint (cyclomatic 23) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:473— rendering_graph_view_methods.managedRouteSeparationConstraint has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 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.
mounted (cyclomatic 23) elixir/web-ng/assets/js/hooks/SRQLTimeCookie.js:2— mounted has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 13 function items inside it that branch (extractTimeToken, maybeRestore, cookieGet, …). 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.
draw (cyclomatic 23) elixir/web-ng/assets/js/hooks/charts/FlowDonut.js:34— draw has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 5 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.
CallbackCommandContract.broker_matches? (cyclomatic 22) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:419— CallbackCommandContract.broker_matches? 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.
LiveAwxLaunchPreflight.validate_controller_security_snapshot (cyclomatic 22) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:304— LiveAwxLaunchPreflight.validate_controller_security_snapshot 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.
CurrentAuthority.rebuild (cyclomatic 22) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:141— CurrentAuthority.rebuild 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.
CurrentAuthority.current_policy_snapshot (cyclomatic 22) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:826— CurrentAuthority.current_policy_snapshot 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.
Packages.create_from_upload (cyclomatic 22) elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:441— Packages.create_from_upload 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.
Config.Validate (cyclomatic 22) go/cmd/wasm-plugins/opentext-nom/config.go:272— Config.Validate 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.
main.enrichGuests (cyclomatic 22) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:285— main.enrichGuests 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.
main.validateWindowsPackages (cyclomatic 22) build/release/platform_artifacts.go:221— main.validateWindowsPackages 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.
auditFrameWriter.Write (cyclomatic 22) go/cmd/tools/ubuntu-feed-merge/main.go:1356— auditFrameWriter.Write 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. This is NOT this file's highest cyclomatic complexity: main.validateLimits (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
agent.canonicalAWXControllerOrigin (cyclomatic 22) go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:324— agent.canonicalAWXControllerOrigin 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.
awxCallbackCredentialMemoryInput.consumeInputs (cyclomatic 22) go/pkg/agent/awx_callback_credential.go:342— awxCallbackCredentialMemoryInput.consumeInputs 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. This is NOT this file's highest cyclomatic complexity: agent.validateAWXCallbackCredentialBinding (cyclomatic 28) 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 function is counted neither in this dimension's figures nor in its score.
remoteaccess.NormalizeDesktopCredentialGrantAt (cyclomatic 22) go/pkg/agent/remoteaccess/desktop_credential.go:79— remoteaccess.NormalizeDesktopCredentialGrantAt 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.
models.filterRecursively (cyclomatic 22) go/pkg/models/utils.go:58— models.filterRecursively 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.
apiClient.request (cyclomatic 22) go/pkg/terraformprovider/client.go:102— apiClient.request 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.
Coordinator.monitorFrameLiveness (cyclomatic 22) swift/FieldSurvey/FieldSurvey/Views/CompositeSurveyView.swift:428— Coordinator.monitorFrameLiveness 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.
Parser::parse_primitive (cyclomatic 22) rust/netprobe/src/capture/filter.rs:390— Parser::parse_primitive has cyclomatic complexity 22 (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.
DashboardBuilderCanvas.Component (cyclomatic 22) elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:351— DashboardBuilderCanvas.Component has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 505, 364, 411, …). 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.
god_view_elk_scene_acceptance.playwright.assertScene (cyclomatic 22) elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:175— god_view_elk_scene_acceptance.playwright.assertScene has cyclomatic complexity 22 (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.
rendering_label_collision.admitTopologyLabels (cyclomatic 22) elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js:482— rendering_label_collision.admitTopologyLabels has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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.
security_findings.dashboardHtml (cyclomatic 22) REDACTED:48— security_findings.dashboardHtml has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 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.
validation.validateSampleFrames (cyclomatic 22) js/cli/src/validation.ts:161— validation.validateSampleFrames 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.
autoFitViewState (cyclomatic 22) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1083— autoFitViewState 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.
requestTopologyProfileLayout (cyclomatic 22) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:479— requestTopologyProfileLayout has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 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.
_draw (cyclomatic 22) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:115— _draw has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 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.
draw (cyclomatic 22) elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:140— draw 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.
AwxClient.valid_launch_args? (cyclomatic 21) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1109— AwxClient.valid_launch_args? 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.
AwxLaunchPreflightAttestation.verify_persisted_internal (cyclomatic 21) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:327— AwxLaunchPreflightAttestation.verify_persisted_internal 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.
Lifecycle.prepare_draft (cyclomatic 21) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:442— Lifecycle.prepare_draft 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.
Ubuntu.validate_product_fields (cyclomatic 21) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:343— Ubuntu.validate_product_fields 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.
AddonFleet.build_row (cyclomatic 21) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.ex:375— AddonFleet.build_row 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.
FirstPartyImporter.import (cyclomatic 21) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:149— FirstPartyImporter.import 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.
main.listRecentJobsBounded (cyclomatic 21) go/cmd/wasm-plugins/awx/main.go:1545— main.listRecentJobsBounded 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 is NOT this file's highest cyclomatic complexity: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.validateVEXStatement (cyclomatic 21) go/cmd/tools/ubuntu-feed-merge/projector.go:851— main.validateVEXStatement 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.
agent.marshalSweepMetricEnvelopeFromMap (cyclomatic 21) go/pkg/agent/metric_envelope.go:418— agent.marshalSweepMetricEnvelopeFromMap 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.
cameraRelayManager.runSession (cyclomatic 21) go/pkg/agent/camera_relay.go:259— cameraRelayManager.runSession has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 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.
cli.RunSpireJoinToken (cyclomatic 21) go/pkg/cli/spire.go:44— cli.RunSpireJoinToken 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.
Server.UploadObject (cyclomatic 21) go/pkg/datasvc/server.go:270— Server.UploadObject has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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.
endpointinventory.applyDefaults (cyclomatic 21) go/pkg/endpointinventory/config.go:126— endpointinventory.applyDefaults 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.
k8sinventory.endpointsFromGateway (cyclomatic 21) go/pkg/k8sinventory/build.go:174— k8sinventory.endpointsFromGateway 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.
k8sinventory.LoadConfigFromEnv (cyclomatic 21) go/pkg/k8sinventory/config.go:76— k8sinventory.LoadConfigFromEnv 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.
ServiceRadarCollector::handle_traces (cyclomatic 21) rust/otel/src/lib.rs:269— ServiceRadarCollector::handle_traces 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.
acceptance_geometry_assertions.transportLayerRouteIdViolations (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:26— acceptance_geometry_assertions.transportLayerRouteIdViolations has cyclomatic complexity 21 (threshold 15). Of this number, 19 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.
layout_elk_scene.decodedManifolds (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:533— layout_elk_scene.decodedManifolds 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 2 function literals inside it that branch (lines 538, 580). 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.
rendering_style_edge_particle_methods.packetFlowStamp (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:3— rendering_style_edge_particle_methods.packetFlowStamp has cyclomatic complexity 21 (threshold 15). Of this number, 19 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.
OperationsTrafficMap.endpointNodes (cyclomatic 21) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:792— OperationsTrafficMap.endpointNodes 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.
harness.browserModuleApi (cyclomatic 21) js/cli/harness/harness.js:95— harness.browserModuleApi 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 10 function literals inside it that branch (lines 106, 151, 100, …). 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.
connectWebRtc (cyclomatic 21) elixir/web-ng/assets/js/hooks/CameraRelayStatusStream.js:338— connectWebRtc has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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.
computeTraversalMask (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/rendering_graph_bitmap_methods.js:76— computeTraversalMask 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.
AwxLaunchContract.validate_template (cyclomatic 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:612— AwxLaunchContract.validate_template 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.
LiveAwxLaunchPreflight.attest (cyclomatic 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:110— LiveAwxLaunchPreflight.attest 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.
EndpointVulnerabilityMatcher.load_fixed_vex_version_scopes (cyclomatic 20) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:841— EndpointVulnerabilityMatcher.load_fixed_vex_version_scopes 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.
AddonRolloutView.fleet_health (cyclomatic 20) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_rollout_view.ex:170— AddonRolloutView.fleet_health 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.
RemoteAccessStreamHandler.credential_broker_opts (cyclomatic 20) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:461— RemoteAccessStreamHandler.credential_broker_opts 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.
main.launchPreflightJSONWithoutNumbers (cyclomatic 20) go/cmd/wasm-plugins/awx/launch_preflight.go:849— main.launchPreflightJSONWithoutNumbers 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. This is NOT this file's highest cyclomatic complexity: main.projectLaunchPreflightTemplate (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.validatedJobEventPairs (cyclomatic 20) go/cmd/wasm-plugins/awx/main.go:1883— main.validatedJobEventPairs 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. This is NOT this file's highest cyclomatic complexity: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.runProxmoxCheck (cyclomatic 20) go/cmd/wasm-plugins/proxmox/check.go:32— main.runProxmoxCheck 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.
builder.build (cyclomatic 20) build/packaging/agent/macos/package.go:201— builder.build 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.
main.validateMacOSPackage (cyclomatic 20) build/release/platform_artifacts.go:180— main.validateMacOSPackage 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.
main.writeCanonicalJSON (cyclomatic 20) build/release/publish_packages.go:1282— main.writeCanonicalJSON 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.
main.projectOSV (cyclomatic 20) go/cmd/tools/ubuntu-feed-merge/projector.go:1004— main.projectOSV 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.
agent.InstallAddonSystemdUnits (cyclomatic 20) go/pkg/agent/addon_systemd.go:161— agent.InstallAddonSystemdUnits has cyclomatic complexity 20 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
agent.applyCredentialBrokerFormInjection (cyclomatic 20) go/pkg/agent/plugin_runtime_actions.go:508— agent.applyCredentialBrokerFormInjection 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.
agent.writeCanonicalJSON (cyclomatic 20) go/pkg/agent/push_loop_status_signature.go:210— agent.writeCanonicalJSON 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.
pluginExecution.proxmoxHostAuthorityForWebSocket (cyclomatic 20) go/pkg/agent/plugin_runtime_host_authority.go:1921— pluginExecution.proxmoxHostAuthorityForWebSocket 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.
SNMPCollector.processValue (cyclomatic 20) go/pkg/agent/snmp/collector.go:316— SNMPCollector.processValue 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.
endpointinventory.FinalizeFullScan (cyclomatic 20) go/pkg/endpointinventory/cache_commit.go:204— endpointinventory.FinalizeFullScan 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 one function literal inside it that branches (line 219). 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.
mapper.buildSNMPL2LinksFromNeighbors (cyclomatic 20) go/pkg/mapper/snmp_l2_query.go:218— mapper.buildSNMPL2LinksFromNeighbors 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.
DiscoveryEngine.enrichSNMPVLANFingerprint (cyclomatic 20) go/pkg/mapper/snmp_fingerprint.go:74— DiscoveryEngine.enrichSNMPVLANFingerprint has cyclomatic complexity 20 (threshold 15). Of this number, 12 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.
SidekickRelay.start (cyclomatic 20) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:305— SidekickRelay.start 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.
SidekickRelay.startRadioRelay (cyclomatic 20) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:557— SidekickRelay.startRadioRelay 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.
layout_elk_scene.elkManifoldBindings (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:174— layout_elk_scene.elkManifoldBindings 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.
rendering_scene_view.focusScene (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:394— rendering_scene_view.focusScene has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 418, 402, 414, …). 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.
doctor.doctorCommand (cyclomatic 20) js/cli/src/doctor.ts:34— doctor.doctorCommand 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.
manifest.manifestErrors (cyclomatic 20) js/cli/src/plugin/manifest.ts:89— manifest.manifestErrors 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.
_initOrUpdate (cyclomatic 20) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:50— _initOrUpdate has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 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.
stateReasonForNode (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:20— stateReasonForNode 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.
nodeTypeHeroIcon (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:263— nodeTypeHeroIcon 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.
selectManagedDensityForScale (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:682— selectManagedDensityForScale 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.
createDeckInstance (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:577— createDeckInstance 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 8 function items inside it that branch (onError, onViewStateChange::applyViewState, onViewStateChange, …). 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.
_draw (cyclomatic 20) elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:142— _draw has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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.
SecureExecutionCurrentAuthority.current_principal (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:96— SecureExecutionCurrentAuthority.current_principal 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.
AwxCleanup.build_plan (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:84— AwxCleanup.build_plan 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.
CleanupReconciler.handle_command_result (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:46— CleanupReconciler.handle_command_result 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.
Ubuntu.validate_provenance (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:194— Ubuntu.validate_provenance 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.
Ubuntu.validate_assertion (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:628— Ubuntu.validate_assertion 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.
EndpointVulnerabilityAdjudicator.version_scope_product? (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:483— EndpointVulnerabilityAdjudicator.version_scope_product? 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.
Manifest.validate_producer_schedule (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1422— Manifest.validate_producer_schedule has cyclomatic complexity 19 (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.
RuntimeGraph.canonical_edge_to_runtime_row (cyclomatic 19) elixir/web-ng/lib/serviceradar_web_ng/topology/runtime_graph.ex:248— RuntimeGraph.canonical_edge_to_runtime_row 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.
main.runFetchLaunchPreflight (cyclomatic 19) go/cmd/wasm-plugins/awx/launch_preflight.go:224— main.runFetchLaunchPreflight 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. This is NOT this file's highest cyclomatic complexity: main.projectLaunchPreflightTemplate (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.projectAWXSurveyChoices (cyclomatic 19) go/cmd/wasm-plugins/awx/main.go:3006— main.projectAWXSurveyChoices 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, separate the cases: extract each independent 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: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.streamProtectRTSP (cyclomatic 19) go/cmd/wasm-plugins/unifi-protect/rtsp_stream.go:31— main.streamProtectRTSP 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.
builder.verifyPayload (cyclomatic 19) build/packaging/agent/macos/package.go:370— builder.verifyPayload 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.
builder.buildArch (cyclomatic 19) build/packaging/agent/windows/package.go:153— builder.buildArch 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.
BGPSimulationConfig.UnmarshalJSON (cyclomatic 19) go/cmd/faker/main.go:270— BGPSimulationConfig.UnmarshalJSON 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.
agent.systemdAddonUnitStatusWithReader (cyclomatic 19) go/pkg/agent/push_loop_capabilities.go:580— agent.systemdAddonUnitStatusWithReader 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.
agent.stageAgentRelease (cyclomatic 19) REDACTED:232— agent.stageAgentRelease 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.
pluginExecution.applyCredentialBrokerOAuth2Bearer (cyclomatic 19) go/pkg/agent/plugin_runtime_oauth.go:85— pluginExecution.applyCredentialBrokerOAuth2Bearer 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.
PushLoop.applyBumblebeeConfig (cyclomatic 19) go/pkg/agent/push_loop_config.go:458— PushLoop.applyBumblebeeConfig 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.
PushLoop.pushNetprobeResults (cyclomatic 19) go/pkg/agent/push_loop_mapper_netprobe.go:95— PushLoop.pushNetprobeResults 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.
GatewayClient.Connect (cyclomatic 19) go/pkg/agentgateway/gateway_client.go:144— GatewayClient.Connect 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.
Bootstrapper.loadPackageFromArchive (cyclomatic 19) go/pkg/edgeonboarding/download.go:222— Bootstrapper.loadPackageFromArchive 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.
UniFiUplink.parentPortIndex (cyclomatic 19) go/pkg/mapper/ubnt_normalizers.go:82— UniFiUplink.parentPortIndex 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.
Tracer.Run (cyclomatic 19) go/pkg/mtr/tracer.go:210— Tracer.Run has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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.
scalibrinventory.applyDefaults (cyclomatic 19) go/pkg/scalibrinventory/config.go:64— scalibrinventory.applyDefaults 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.
SurveySetupPhaseView.body (cyclomatic 19) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1032— SurveySetupPhaseView.body 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.
SessionLibraryView.uploadSavedArtifacts (cyclomatic 19) swift/FieldSurvey/FieldSurvey/Views/HomeShellView.swift:495— SessionLibraryView.uploadSavedArtifacts 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.
OtelCollectorAddon::configure (cyclomatic 19) rust/otel-addon/src/addon.rs:368— OtelCollectorAddon::configure 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.
tokenizer.inferSlot (cyclomatic 19) elixir/web-ng/assets/js/lib/srql/tokenizer.js:284— tokenizer.inferSlot 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.
SrqlEditor.Component (cyclomatic 19) elixir/web-ng/assets/component/src/SrqlEditor.jsx:4— SrqlEditor.Component has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 47, 15, 56, …). 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.
acceptance_geometry_assertions.groupGeometryViolations (cyclomatic 19) elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:371— acceptance_geometry_assertions.groupGeometryViolations has cyclomatic complexity 19 (threshold 15). Of this number, 16 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.
dev.watchProjectForValidation (cyclomatic 19) js/cli/src/dashboard/dev.ts:362— dev.watchProjectForValidation has cyclomatic complexity 19 (threshold 15). Of this number, 15 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.
_rangeOptions (cyclomatic 19) elixir/web-ng/assets/js/hooks/charts/NetflowTrafficTooltip.js:113— _rangeOptions has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (viewPoint, continuationXForEvent, formatStatus, …). 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.
AutomationResultSanitizer.job (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:368— AutomationResultSanitizer.job 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.
AwxBindingReview.normalize_request (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_binding_review.ex:65— AwxBindingReview.normalize_request 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.
SecureChildLauncher.load_launch_state (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:138— SecureChildLauncher.load_launch_state 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.
AshStore.validate_cleanup_reconciliation (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:932— AshStore.validate_cleanup_reconciliation 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.
UbuntuAdapter.validate_inventory (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/ubuntu_adapter.ex:134— UbuntuAdapter.validate_inventory 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.
EndpointVulnerabilityAdjudicator.version_scope_parent_context? (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:529— EndpointVulnerabilityAdjudicator.version_scope_parent_context? 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.
MergeEngine.do_merge_devices (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:234— MergeEngine.do_merge_devices 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.
ensure_k8s_node_alerts.main (cyclomatic 18) REDACTED:28— ensure_k8s_node_alerts.main 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.
Config.applyDefaults (cyclomatic 18) go/cmd/wasm-plugins/alienvault-otx/main.go:775— Config.applyDefaults 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.
otxJSONScanner.readString (cyclomatic 18) go/cmd/wasm-plugins/alienvault-otx/main.go:1319— otxJSONScanner.readString 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.
main.listAWXPathBounded (cyclomatic 18) go/cmd/wasm-plugins/awx/main.go:2377— main.listAWXPathBounded 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 is NOT this file's highest cyclomatic complexity: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.awxSurveyVariableTokens (cyclomatic 18) go/cmd/wasm-plugins/awx/main.go:2967— main.awxSurveyVariableTokens 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, 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: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
Query.UnmarshalJSON (cyclomatic 18) go/cmd/wasm-plugins/opentext-nom/config.go:67— Query.UnmarshalJSON 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.
main.run_check (cyclomatic 18) go/cmd/wasm-plugins/unifi-protect/main.go:14— main.run_check 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 one function literal inside it that branches (line 15). 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.
options.validate (cyclomatic 18) build/packaging/agent/macos/package.go:148— options.validate 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.
agent.trustedProxmoxSSHTimeout (cyclomatic 18) go/pkg/agent/plugin_runtime_host_authority.go:2128— agent.trustedProxmoxSSHTimeout has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2136). 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.
controlPlaneAutomationLaunchEnvelopeResolver.Resolve (cyclomatic 18) go/pkg/agent/automation_launch_envelope_resolver.go:136— controlPlaneAutomationLaunchEnvelopeResolver.Resolve 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.
PluginManager.credentialBrokerCacheDecision (cyclomatic 18) REDACTED:500— PluginManager.credentialBrokerCacheDecision 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.
PushLoop.controlStreamLoop (cyclomatic 18) go/pkg/agent/control_stream.go:229— PushLoop.controlStreamLoop 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 is NOT this file's highest cyclomatic complexity: PushLoop.handleCommand (cyclomatic 20) 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 function is counted neither in this dimension's figures nor in its score.
PushLoop.pushFlowAttribution (cyclomatic 18) go/pkg/agent/push_loop_flow_attribution.go:268— PushLoop.pushFlowAttribution has cyclomatic complexity 18 (threshold 15). Of this number, 16 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.
PushLoop.pushSweepResults (cyclomatic 18) go/pkg/agent/push_loop_sweep_results.go:28— PushLoop.pushSweepResults 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.
cli.RunEdgePackageList (cyclomatic 18) go/pkg/cli/edge_onboarding.go:310— cli.RunEdgePackageList 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.
edgeonboarding.extractBundle (cyclomatic 18) REDACTED:223— edgeonboarding.extractBundle 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.
archiveMetadataFile.toModel (cyclomatic 18) go/pkg/edgeonboarding/download.go:320— archiveMetadataFile.toModel 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.
endpointinventory.ApplyRuntimeProfile (cyclomatic 18) go/pkg/endpointinventory/config.go:226— endpointinventory.ApplyRuntimeProfile 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.
k8sinventory.RouteFromUnstructured (cyclomatic 18) go/pkg/k8sinventory/gateway_unstructured.go:57— k8sinventory.RouteFromUnstructured 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.
DiscoveryEngine.handleUniFiDiscoveryPhase (cyclomatic 18) go/pkg/mapper/discovery_unifi_phase.go:62— DiscoveryEngine.handleUniFiDiscoveryPhase 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.
DiscoveryEngine.enrichSNMPBridgeFingerprint (cyclomatic 18) go/pkg/mapper/snmp_fingerprint.go:31— DiscoveryEngine.enrichSNMPBridgeFingerprint has cyclomatic complexity 18 (threshold 15). Of this number, 16 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.
DiscoveryEngine.observedFDBMappedNeighbors (cyclomatic 18) go/pkg/mapper/snmp_l2_observed.go:160— DiscoveryEngine.observedFDBMappedNeighbors 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.
CA.SignUserCertificate (cyclomatic 18) go/pkg/remoteaccess/sshca/sshca.go:173— CA.SignUserCertificate 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.
sysmon.firstUsableIPv4 (cyclomatic 18) go/pkg/sysmon/host.go:64— sysmon.firstUsableIPv4 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.
correlation_engine::god_view::evaluate_correlation_states (cyclomatic 18) rust/correlation-engine/src/god_view.rs:96— correlation_engine::god_view::evaluate_correlation_states 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.
network_config_downparser::apply_command (cyclomatic 18) rust/network-config-downparser/src/lib.rs:124— network_config_downparser::apply_command 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.
renderer_runtime.createWebCodecsDesktopVideoRenderTarget (cyclomatic 18) elixir/web-ng/assets/js/lib/remote_desktop/renderer_runtime.js:114— renderer_runtime.createWebCodecsDesktopVideoRenderTarget has cyclomatic complexity 18 (threshold 15). 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, 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.
god_view_elk_scene_acceptance.playwright.assertFocusedNeighborhood (cyclomatic 18) elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:61— god_view_elk_scene_acceptance.playwright.assertFocusedNeighborhood has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
layout_elk_scene.buildElkSceneGraph (cyclomatic 18) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:333— layout_elk_scene.buildElkSceneGraph has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 352, 385, 403, …). 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.
rendering_graph_data_methods.deterministicRelationPresentation (cyclomatic 18) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:96— rendering_graph_data_methods.deterministicRelationPresentation has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 111, 97). 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.
PacketFlowLayer.getBounds (cyclomatic 18) elixir/web-ng/assets/js/lib/deckgl/PacketFlowLayer.js:142— PacketFlowLayer.getBounds 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.
DashboardWasmHost.buildSrqlQuery (cyclomatic 18) REDACTED:104— DashboardWasmHost.buildSrqlQuery 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.
RemoteAccessDesktopSession.parseProps (cyclomatic 18) elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:9— RemoteAccessDesktopSession.parseProps 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.
NetflowStackedAreaChart.renderTotalOverlays (cyclomatic 18) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:436— NetflowStackedAreaChart.renderTotalOverlays has cyclomatic complexity 18 (threshold 15). Of this number, 11 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.
harness.buildSrqlQuery (cyclomatic 18) js/cli/harness/harness.js:193— harness.buildSrqlQuery 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.
status.statusCommand (cyclomatic 18) js/cli/src/plugin/status.ts:9— status.statusCommand 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.
buildCandidates (cyclomatic 18) elixir/web-ng/assets/js/hooks/SRQLInput.js:233— buildCandidates has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs 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.
updateBrowserModuleHost (cyclomatic 18) REDACTED:332— updateBrowserModuleHost 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.
isBlockedIPv4 (cyclomatic 18) elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js:810— isBlockedIPv4 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.
canonicalSemanticRelationId (cyclomatic 18) elixir/web-ng/assets/js/lib/god_view/topology_relation_identity.js:17— canonicalSemanticRelationId 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.
_draw (cyclomatic 18) elixir/web-ng/assets/js/hooks/charts/NetflowLineSeriesChart.js:45— _draw has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 19 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.
AwxMembershipReconciler.upsert_membership (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:546— AwxMembershipReconciler.upsert_membership 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.
SshCaBundleResponse.retirement_proof (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:332— SshCaBundleResponse.retirement_proof 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.
AgentCommandBus.validate_preallocated_transmit_payload (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2533— AgentCommandBus.validate_preallocated_transmit_payload 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.
ProxmoxConsoleSessions.reauthorize_session (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:471— ProxmoxConsoleSessions.reauthorize_session 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.
Ubuntu.prepare_products (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:301— Ubuntu.prepare_products 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.
ProxmoxHostAuthority.canonical_origin (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:429— ProxmoxHostAuthority.canonical_origin 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.
main.consumeLaunchPreflightJSONValue (cyclomatic 17) go/cmd/wasm-plugins/awx/launch_preflight.go:1229— main.consumeLaunchPreflightJSONValue 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 is NOT this file's highest cyclomatic complexity: main.projectLaunchPreflightTemplate (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.isProbablyIP (cyclomatic 17) go/cmd/wasm-plugins/awx/main.go:3794— main.isProbablyIP 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. This is NOT this file's highest cyclomatic complexity: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.listDevices (cyclomatic 17) go/cmd/wasm-plugins/netbox/main.go:326— main.listDevices 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.
main.valueBool (cyclomatic 17) REDACTED:515— main.valueBool 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.
main.rawPluginInputsValid (cyclomatic 17) go/cmd/wasm-plugins/proxmox/config_raw_parse.go:80— main.rawPluginInputsValid 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.
main.main (cyclomatic 17) go/cmd/data-services/main.go:66— main.main 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.prepareOne (cyclomatic 17) go/cmd/tools/ubuntu-feed-merge/main.go:478— main.prepareOne 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 is NOT this file's highest cyclomatic complexity: main.validateLimits (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
main.parseOSVWithLimits (cyclomatic 17) go/cmd/tools/ubuntu-feed-merge/projector.go:634— main.parseOSVWithLimits 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.
agent.newRTSPCameraRelayStream (cyclomatic 17) REDACTED:80— agent.newRTSPCameraRelayStream 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, 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.
agent.newDesktopMediaGatewaySender (cyclomatic 17) go/pkg/agent/desktop_media_sender.go:87— agent.newDesktopMediaGatewaySender 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.
agent.dialProxmoxConsoleSSH (cyclomatic 17) go/pkg/agent/proxmox_console_ssh.go:267— agent.dialProxmoxConsoleSSH has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
agent.extractReleaseArchive (cyclomatic 17) REDACTED:872— agent.extractReleaseArchive 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.
Client.readLoop (cyclomatic 17) go/pkg/agent/netprobe/client.go:559— Client.readLoop 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.
consoleSpecAuthorityState.mergeSubjectProviderRef (cyclomatic 17) go/pkg/agent/plugin_runtime_host_authority.go:1588— consoleSpecAuthorityState.mergeSubjectProviderRef 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.
remoteaccess.ValidateDesktopMediaFrame (cyclomatic 17) go/pkg/agent/remoteaccess/desktop_media_frame.go:267— remoteaccess.ValidateDesktopMediaFrame 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.
remoteaccess.validateDesktopTarget (cyclomatic 17) go/pkg/agent/remoteaccess/desktop_target.go:166— remoteaccess.validateDesktopTarget 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.
armis.normalizeMetadataFieldName (cyclomatic 17) go/pkg/agent/syncsources/armis/metadata_fields.go:202— armis.normalizeMetadataFieldName 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.
cli.runDeviceCodeFlowWithClock (cyclomatic 17) go/pkg/cli/auth.go:404— cli.runDeviceCodeFlowWithClock 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.
Runner.Run (cyclomatic 17) go/pkg/endpointinventory/collect.go:77— Runner.Run 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.
mapper.mergeInterface (cyclomatic 17) go/pkg/mapper/interface_dedup.go:144— mapper.mergeInterface 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.
DiscoveryEngine.getInt32FromPDU (cyclomatic 17) go/pkg/mapper/snmp_interface_pdu.go:53— DiscoveryEngine.getInt32FromPDU 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.
DiscoveryEngine.queryInterfaces (cyclomatic 17) go/pkg/mapper/snmp_interfaces.go:30— DiscoveryEngine.queryInterfaces 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.
models.ExtractSafeConfigMetadata (cyclomatic 17) go/pkg/models/utils.go:200— models.ExtractSafeConfigMetadata 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.
OCSFDevice.ToJSONFields (cyclomatic 17) go/pkg/models/ocsf_device.go:376— OCSFDevice.ToJSONFields 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 is NOT this file's highest cyclomatic complexity: models.getDeviceTypeName (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 function is counted neither in this dimension's figures nor in its score.
scan.getLocalIPAndInterfaceWithTarget (cyclomatic 17) go/pkg/scan/syn_scanner_interfaces.go:28— scan.getLocalIPAndInterfaceWithTarget 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.
SYNScanner.processTCPFinalResult (cyclomatic 17) go/pkg/scan/syn_scanner_reply_results.go:32— SYNScanner.processTCPFinalResult 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.
Service.enrichPodCorrelation (cyclomatic 17) go/pkg/trivysidecar/service.go:185— Service.enrichPodCorrelation 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.
SignalCoverageInterpolator.coverageGrid (cyclomatic 17) swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:13— SignalCoverageInterpolator.coverageGrid 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.
SidekickRelay.startSpectrumRelay (cyclomatic 17) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:668— SidekickRelay.startSpectrumRelay 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.
SubnetScanner.resolve (cyclomatic 17) swift/FieldSurvey/FieldSurvey/Network/SubnetScanner.swift:218— SubnetScanner.resolve 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.
renderer_state.normalizeDesktopPolicySnapshot (cyclomatic 17) elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js:37— renderer_state.normalizeDesktopPolicySnapshot 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.
layout_elk_radial_overview.indexElkLayout (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:252— layout_elk_radial_overview.indexElkLayout 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.
chart_range_selection.timestampValue (cyclomatic 17) elixir/web-ng/assets/js/hooks/charts/chart_range_selection.js:11— chart_range_selection.timestampValue 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.
attachTimeTooltip (cyclomatic 17) elixir/web-ng/assets/js/netflow_charts/util.js:110— attachTimeTooltip has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 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.
_syncMarkers (cyclomatic 17) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:247— _syncMarkers 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.
deckLayer (cyclomatic 17) REDACTED:1243— deckLayer has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fitVisualSpecs (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:198— fitVisualSpecs has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 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.
nodeLabelPriority (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:142— nodeLabelPriority 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.
buildVisibleGraphData::expandedMemberEdge (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:183— buildVisibleGraphData::expandedMemberEdge 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.
expandedMemberTrunkClusterId (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:599— expandedMemberTrunkClusterId 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.
resizeCanvas (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:412— resizeCanvas has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs 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.
AwxLaunchPreflightAttestation.verify_binding (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:171— AwxLaunchPreflightAttestation.verify_binding 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.
HardenedLaunchPlan.validate_preflight_attestation (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:284— HardenedLaunchPlan.validate_preflight_attestation 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.
SecureExecutionCurrentAuthority.authorize_attempt (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:49— SecureExecutionCurrentAuthority.authorize_attempt 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.
CurrentAuthority.current_authority (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:83— CurrentAuthority.current_authority 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. This is NOT this file's highest cyclomatic complexity: CurrentAuthority.current_binding (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 function is counted neither in this dimension's figures nor in its score.
CurrentAuthority.current_principal (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:205— CurrentAuthority.current_principal 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. This is NOT this file's highest cyclomatic complexity: CurrentAuthority.current_binding (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 function is counted neither in this dimension's figures nor in its score.
EndpointVulnerabilityAdjudicator.exact_product? (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:429— EndpointVulnerabilityAdjudicator.exact_product? 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.
EndpointVulnerabilityAdjudicator.trusted_assertion_provenance? (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:649— EndpointVulnerabilityAdjudicator.trusted_assertion_provenance? 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.
MediaFrameEnvelope.frame_fields (cyclomatic 16) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/media_frame_envelope.ex:53— MediaFrameEnvelope.frame_fields 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.
ReleaseSourceImporter.import (cyclomatic 16) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:62— ReleaseSourceImporter.import 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.
main.extractLaunchPreflightJSONAnsibleHost (cyclomatic 16) go/cmd/wasm-plugins/awx/launch_preflight.go:1166— main.extractLaunchPreflightJSONAnsibleHost 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: main.projectLaunchPreflightTemplate (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.runFetchJobHostSummaries (cyclomatic 16) go/cmd/wasm-plugins/awx/main.go:1687— main.runFetchJobHostSummaries 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: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
main.literalAWXHostToken (cyclomatic 16) go/cmd/wasm-plugins/awx/main.go:2192— main.literalAWXHostToken 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 is NOT this file's highest cyclomatic complexity: main.dispatch (cyclomatic 22) 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 function is counted neither in this dimension's figures nor in its score.
localOAuthBroker.Handle (cyclomatic 16) REDACTED:76— localOAuthBroker.Handle 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.
main.interfacesFromGuestConfig (cyclomatic 16) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:417— main.interfacesFromGuestConfig 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.
main.preparePackageArtifacts (cyclomatic 16) build/release/platform_artifacts.go:118— main.preparePackageArtifacts 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.
main.ensureRelease (cyclomatic 16) build/release/publish_packages.go:608— main.ensureRelease 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.
runfileResolver.resolve (cyclomatic 16) build/release/publish_packages.go:1106— runfileResolver.resolve 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.
main.loadConfig (cyclomatic 16) REDACTED:257— main.loadConfig 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.
main.mergeRunGroup (cyclomatic 16) go/cmd/tools/ubuntu-feed-merge/main.go:708— main.mergeRunGroup has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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. This is NOT this file's highest cyclomatic complexity: main.validateLimits (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
main.run (cyclomatic 16) go/cmd/tools/ubuntu-feed-merge/main.go:1476— main.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. This is NOT this file's highest cyclomatic complexity: main.validateLimits (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
runReader.next (cyclomatic 16) go/cmd/tools/ubuntu-feed-merge/main.go:854— runReader.next 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. This is NOT this file's highest cyclomatic complexity: main.validateLimits (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
runner.drainArtifactStream (cyclomatic 16) go/pkg/agent/addon/artifacts.go:112— runner.drainArtifactStream 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
metricFeedLifecycle.runStream (cyclomatic 16) go/pkg/agent/addon/metric_feed.go:213— metricFeedLifecycle.runStream has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. 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.
agent.stageAddonArtifactWithClient (cyclomatic 16) go/pkg/agent/addon_activation.go:181— agent.stageAddonArtifactWithClient 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.
agent.extractAddonTarball (cyclomatic 16) go/pkg/agent/addon_activation.go:611— agent.extractAddonTarball 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.
agent.awxInventoryCredentialBinding (cyclomatic 16) go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:260— agent.awxInventoryCredentialBinding 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.
agent.validatePluginHostAuthorityGrant (cyclomatic 16) go/pkg/agent/plugin_runtime_host_authority.go:305— agent.validatePluginHostAuthorityGrant 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.
agent.consumeUniqueJSONValue (cyclomatic 16) go/pkg/agent/plugin_runtime_host_authority.go:853— agent.consumeUniqueJSONValue 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.
agent.buildNetprobeResultsPayloads (cyclomatic 16) go/pkg/agent/push_loop_mapper_netprobe.go:256— agent.buildNetprobeResultsPayloads 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pluginExecution.protectProxmoxConsoleProxyResponse (cyclomatic 16) go/pkg/agent/plugin_runtime_host_authority.go:1737— pluginExecution.protectProxmoxConsoleProxyResponse 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.
PushLoop.handlePluginRunAction (cyclomatic 16) go/pkg/agent/control_stream.go:656— PushLoop.handlePluginRunAction 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: PushLoop.handleCommand (cyclomatic 20) 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 function is counted neither in this dimension's figures nor in its score.
remoteaccess.validateSSHConfig (cyclomatic 16) REDACTED:354— remoteaccess.validateSSHConfig 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.
remoteaccess.validateSSHOpenPayloadScope (cyclomatic 16) go/pkg/agent/remoteaccess/ssh_open.go:113— remoteaccess.validateSSHOpenPayloadScope 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.
Server.Stop (cyclomatic 16) go/pkg/agent/server.go:602— Server.Stop 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.
bumblebee.StageCatalogAssignment (cyclomatic 16) go/pkg/bumblebee/catalog.go:76— bumblebee.StageCatalogAssignment 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.
cli.parseEdgePackageCreateFlags (cyclomatic 16) go/pkg/cli/cli.go:633— cli.parseEdgePackageCreateFlags 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.
NATSAccountServer.getResolverConn (cyclomatic 16) go/pkg/datasvc/nats_account_service.go:183— NATSAccountServer.getResolverConn 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
db.NewCNPGPool (cyclomatic 16) go/pkg/db/cnpg_pool.go:152— db.NewCNPGPool 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.
Bootstrapper.generateGatewayConfig (cyclomatic 16) go/pkg/edgeonboarding/config.go:106— Bootstrapper.generateGatewayConfig 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.
mapper.parseIPToPhysicalSuffix (cyclomatic 16) go/pkg/mapper/snmp_l2_identity.go:171— mapper.parseIPToPhysicalSuffix 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.
DiscoveryEngine.querySingleUniFiAPI (cyclomatic 16) REDACTED:162— DiscoveryEngine.querySingleUniFiAPI 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.
Runner.Run (cyclomatic 16) go/pkg/scalibrinventory/adapter.go:119— Runner.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.
scan.scanStreamBatched (cyclomatic 16) go/pkg/scan/syn_scanner_stream.go:41— scan.scanStreamBatched 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 literal inside it that branches (line 60). 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.
SYNScanner.runRetryQueue (cyclomatic 16) go/pkg/scan/syn_scanner_retries.go:90— SYNScanner.runRetryQueue 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.
NetworkSweeper.generateTargetsBatched (cyclomatic 16) go/pkg/sweeper/sweeper_target_generation.go:158— NetworkSweeper.generateTargetsBatched 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terraformprovider.newAPIClient (cyclomatic 16) go/pkg/terraformprovider/client.go:68— terraformprovider.newAPIClient 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.
trivysidecar.LoadConfigFromEnv (cyclomatic 16) go/pkg/trivysidecar/config.go:58— trivysidecar.LoadConfigFromEnv 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.
serviceradar_trapd::main (cyclomatic 16) rust/trapd/src/main.rs:75— serviceradar_trapd::main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DashboardPanelChart.gaugeDatum (cyclomatic 16) elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:354— DashboardPanelChart.gaugeDatum 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.
RemoteAccessDesktopSession.Launcher (cyclomatic 16) elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:856— RemoteAccessDesktopSession.Launcher has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 900, 875, 948). 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.
topology_overview_projection.attachedEndpointNodes (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:283— topology_overview_projection.attachedEndpointNodes 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.
rendering_scene_view.glyphVisualSpecs (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:142— rendering_scene_view.glyphVisualSpecs 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 2 function literals inside it that branch (lines 144, 143). 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.
ensure_k8s_alerts.ensureK8sAlertsCommand (cyclomatic 16) js/cli/src/notifications/ensure_k8s_alerts.ts:29— ensure_k8s_alerts.ensureK8sAlertsCommand 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, 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.
hintValues (cyclomatic 16) elixir/web-ng/assets/js/hooks/SRQLInput.js:480— hintValues 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.
boot (cyclomatic 16) REDACTED:385— boot 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.
handleHover (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/rendering_tooltip_methods.js:195— handleHover 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.
humanizeCausalReason (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:88— humanizeCausalReason 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.
handlePanMove (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:122— handlePanMove 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.
No dependency lockfile committed (third_party/hex_vendored/boombox/mix.exs) — third_party/hex_vendored/boombox/mix.exs declares 31 dependencies but no lockfile (REDACTED or rebar.lock) is committed beside it, so `mix deps.get` resolves versions afresh on every machine and every CI run — two builds of this commit are not guaranteed to be the same build. Commit the lockfile.
No dependency lockfile committed (third_party/hex_vendored/opentelemetry_oban/mix.exs) — third_party/hex_vendored/opentelemetry_oban/mix.exs declares 9 dependencies but no lockfile (REDACTED or rebar.lock) is committed beside it, so `mix deps.get` resolves versions afresh on every machine and every CI run — two builds of this commit are not guaranteed to be the same build. Commit the lockfile.
RemoteAccessSSHConsole.Component (cognitive 192) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— RemoteAccessSSHConsole.Component has cognitive complexity 192 (threshold 15). Drivers by points: if/else 66 (84 pts), ternaries 35 (62 pts), boolean chains 38, error handling 6 (7 pts), loops 1 (nesting depth added 46). Of this number, 106 points are the body's own statements and 86 belong to 20 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.
layout_elk_scene.validateTopologyScene (cognitive 153) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1030— layout_elk_scene.validateTopologyScene has cognitive complexity 153 (threshold 15). Drivers by points: if/else 34 (78 pts), ternaries 14 (29 pts), loops 16 (24 pts), boolean chains 22 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_renderSvgOverlay (cognitive 142) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1546— _renderSvgOverlay has cognitive complexity 142 (threshold 15). Drivers by points: ternaries 33 (55 pts), if/else 32 (50 pts), boolean chains 37 (nesting depth added 40). Of this number, 22 points are the body's own statements and 120 belong to 32 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.
buildVisibleGraphData (cognitive 135) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:140— buildVisibleGraphData has cognitive complexity 135 (threshold 15). Drivers by points: boolean chains 76, if/else 24 (30 pts), ternaries 21 (23 pts), loops 3 (6 pts) (nesting depth added 11). Of this number, 45 points are the body's own statements and 90 belong to 24 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.
_draw (cognitive 126) elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:25— _draw has cognitive complexity 126 (threshold 15). Drivers by points: boolean chains 60, if/else 24 (35 pts), ternaries 12, loops 7 (9 pts), other 6, error handling 4 (nesting depth added 13). Of this number, 56 points are the body's own statements and 70 belong to 33 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.
Driver.Sync (cognitive 85) go/pkg/agent/syncsources/armis/driver.go:56— Driver.Sync has cognitive complexity 85 (threshold 15). Drivers by points: if/else 24 (77 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 56). 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.
SurveyView.body (cognitive 83) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:75— SurveyView.body has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 21 (46 pts), if/else 20 (35 pts), boolean chains 1, match/switch 1 (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.
buildTopologySceneEdgeData (cognitive 82) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:403— buildTopologySceneEdgeData has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 40, ternaries 24 (29 pts), if/else 8, other 3, loops 2 (nesting depth added 5). Most of this is not in the body itself: 9 of the 82 points are its own statements and the rest belongs to 30 function items inside it that branch ((anonymous), (anonymous)::metadataNumber, classBucketForEdge, …). 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.
layout_elk_radial_overview.validateTopologyOverview (cognitive 81) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:395— layout_elk_radial_overview.validateTopologyOverview has cognitive complexity 81 (threshold 15). Drivers by points: if/else 23 (48 pts), boolean chains 16, loops 10 (14 pts), ternaries 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.runBGPSimulator (cognitive 74) go/cmd/faker/bgp_sim.go:42— main.runBGPSimulator has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (59 pts), loops 4 (13 pts), match/switch 1 (2 pts) (nesting depth added 45). Of this number, 72 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.
renderSelectionDetails (cognitive 74) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:49— renderSelectionDetails has cognitive complexity 74 (threshold 15). Drivers by points: boolean chains 33, ternaries 33, if/else 8. Of this number, 53 points are the body's own statements and 21 belong to 3 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.
SYNScanner.runRingReader (cognitive 73) REDACTED:130— SYNScanner.runRingReader has cognitive complexity 73 (threshold 15). Drivers by points: if/else 19 (55 pts), boolean chains 8, loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidekickRelay.startRadioRelay (cognitive 72) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:557— SidekickRelay.startRadioRelay has cognitive complexity 72 (threshold 15). Drivers by points: if/else 12 (53 pts), error handling 4 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildPacketFlowInstances (cognitive 66) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:20— buildPacketFlowInstances has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 14 (29 pts), if/else 10 (18 pts), boolean chains 17, loops 2 (nesting depth added 23). Of this number, 57 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteAccessDesktopSession.Component (cognitive 65) elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:392— RemoteAccessDesktopSession.Component has cognitive complexity 65 (threshold 15). Drivers by points: if/else 36 (40 pts), boolean chains 12, ternaries 11 (12 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 14 of the 65 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 432, 681, 639, …). 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.
buildTransportAndEffectLayers (cognitive 65) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:9— buildTransportAndEffectLayers has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 31, ternaries 28, other 4, if/else 2. Of this number, 23 points are the body's own statements and 42 belong to 45 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.
RemoteAccessStreamHandler.handle_in (cognitive 64) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:145— RemoteAccessStreamHandler.handle_in has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (40 pts), match/switch 9 (24 pts) (nesting depth added 41). 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.
k8sinventory.endpointsFromGateway (cognitive 62) go/pkg/k8sinventory/build.go:174— k8sinventory.endpointsFromGateway has cognitive complexity 62 (threshold 15). Drivers by points: if/else 8 (36 pts), loops 6 (21 pts), boolean chains 5 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Collector.Collect (cognitive 61) REDACTED:30— Collector.Collect has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (50 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 35). Of this number, 59 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.
ServiceRadarCollector::handle_traces (cognitive 59) rust/otel/src/lib.rs:269— ServiceRadarCollector::handle_traces has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 6 (15 pts), match/switch 2 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
k8sinventory.matchSliceTargets (cognitive 58) go/pkg/k8sinventory/build.go:351— k8sinventory.matchSliceTargets has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 7 (18 pts), boolean chains 7 (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.
SidekickRelay.startSpectrumRelay (cognitive 58) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:668— SidekickRelay.startSpectrumRelay has cognitive complexity 58 (threshold 15). Drivers by points: if/else 8 (39 pts), error handling 3 (10 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validator.field (cognitive 55) config/manager_validator/go/validate.go:74— validator.field has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (54 pts), match/switch 1 (nesting depth added 27). 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.
PushLoop.collectAllStatusesSeparated (cognitive 55) go/pkg/agent/push_loop_status.go:492— PushLoop.collectAllStatusesSeparated has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (51 pts), boolean chains 3, loops 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.
RPerfRunner.runTest (cognitive 55) swift/RPerfClient/Sources/RPerfClient/RPerfClient.swift:75— RPerfRunner.runTest has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 8 (13 pts), ternaries 3 (7 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tracer.sendProbes (cognitive 53) go/pkg/mtr/tracer.go:327— Tracer.sendProbes has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (44 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validator.evaluate (cognitive 52) config/manager_validator/go/validate.go:256— validator.evaluate has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (45 pts), boolean chains 6, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resourceDefinition.save (cognitive 50) go/pkg/terraformprovider/attributes.go:108— resourceDefinition.save has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (38 pts), boolean chains 5, loops 2 (5 pts), match/switch 1 (2 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.
browserModuleApi (cognitive 50) REDACTED:516— browserModuleApi has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 17, ternaries 6, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 3 of the 50 points are its own statements and the rest belongs to 34 function items inside it that branch (pushSrqlQuery, arrowBytes, pageFrame, …). 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.
Config.Validate (cognitive 49) go/cmd/faker/main.go:414— Config.Validate has cognitive complexity 49 (threshold 15). Drivers by points: if/else 28 (47 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
god_view_acceptance_geometry_observer.acceptanceGeometrySnapshot (cognitive 49) elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:169— god_view_acceptance_geometry_observer.acceptanceGeometrySnapshot has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 36, ternaries 9 (10 pts), if/else 3 (nesting depth added 1). Of this number, 18 points are the body's own statements and 31 belong to 9 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.
apply.applyCommand (cognitive 49) js/cli/src/plugin/apply.ts:70— apply.applyCommand has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 4 (11 pts), boolean chains 6, loops 5 (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.
main.run (cognitive 47) REDACTED:140— main.run has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 4 (10 pts) (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.
agent.parseMtrCheckConfig (cognitive 47) go/pkg/agent/mtr_checker.go:328— agent.parseMtrCheckConfig has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 5 (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.
Client.readLoop (cognitive 47) go/pkg/agent/netprobe/client.go:559— Client.readLoop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 3 (12 pts), loops 2 (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.
login.runDeviceCodeFlow (cognitive 47) js/cli/src/auth/login.ts:62— login.runDeviceCodeFlow has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 9, error handling 3 (5 pts), ternaries 1 (3 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.
decodeArrowGraph (cognitive 47) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_decode_methods.js:17— decodeArrowGraph has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 19, if/else 4 (9 pts), ternaries 3 (9 pts), error handling 2 (8 pts), loops 1, other 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidekickRelay.start (cognitive 46) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:305— SidekickRelay.start has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (37 pts), error handling 3 (6 pts), loops 1 (2 pts), boolean chains 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.
auditFrameWriter.Write (cognitive 45) go/cmd/tools/ubuntu-feed-merge/main.go:1356— auditFrameWriter.Write has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 4, match/switch 1 (3 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.
RemoteAccessApplication.Component (cognitive 45) elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:77— RemoteAccessApplication.Component has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 15, ternaries 9 (10 pts), loops 1 (2 pts), error handling 1 (nesting depth added 4). Of this number, 32 points are the body's own statements and 13 belong to 4 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.
main.parseProxmoxProviderRef (cognitive 44) REDACTED:560— main.parseProxmoxProviderRef has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 15, match/switch 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.
DiscoveryEngine.runDiscoveryJob (cognitive 44) go/pkg/mapper/discovery_run.go:25— DiscoveryEngine.runDiscoveryJob has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 2 (4 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.
runner.drainArtifactStream (cognitive 43) go/pkg/agent/addon/artifacts.go:112— runner.drainArtifactStream has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (40 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 29). Of this number, 42 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.
otlpRelayPump.run (cognitive 43) go/pkg/agent/addon_otlp_relay.go:344— otlpRelayPump.run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 23). Of this number, 35 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.
edgeonboarding.EnrollAgentFromToken (cognitive 43) REDACTED:79— edgeonboarding.EnrollAgentFromToken has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29 (40 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.
_showFlowDetails (cognitive 43) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1484— _showFlowDetails has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 22, ternaries 19, if/else 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.
main.runProxmoxCheck (cognitive 42) go/cmd/wasm-plugins/proxmox/check.go:32— main.runProxmoxCheck has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runConfig.normalize (cognitive 42) go/cmd/tools/mapper-baseline/main.go:336— runConfig.normalize has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (36 pts), loops 3, match/switch 2, 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.
PushLoop.handleMtrBulkRun (cognitive 42) go/pkg/agent/mtr_bulk.go:126— PushLoop.handleMtrBulkRun has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 19). Of this number, 24 points are the body's own statements and 18 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.
RemoteAccessDesktopSession.createRdpLauncherRuntime (cognitive 42) elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:88— RemoteAccessDesktopSession.createRdpLauncherRuntime has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 10, error handling 7, ternaries 3 (4 pts) (nesting depth added 2). Of this number, 30 points are the body's own statements and 12 belong to 4 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.
rendering_graph_view_methods.managedRouteSeparationConstraint (cognitive 42) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:473— rendering_graph_view_methods.managedRouteSeparationConstraint has cognitive complexity 42 (threshold 15). Drivers by points: if/else 4 (17 pts), loops 4 (10 pts), boolean chains 9, ternaries 2 (6 pts) (nesting depth added 23). Of this number, 34 points are the body's own statements and 8 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.
models.filterRecursively (cognitive 41) go/pkg/models/utils.go:58— models.filterRecursively has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admitNodeLabelsForViewport (cognitive 41) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:286— admitNodeLabelsForViewport has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 22, ternaries 10 (11 pts), if/else 5 (7 pts), loops 1 (nesting depth added 3). Of this number, 26 points are the body's own statements and 15 belong to 9 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.
main.projectPreparedPass (cognitive 40) go/cmd/tools/ubuntu-feed-merge/main.go:1146— main.projectPreparedPass has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 11, match/switch 1 (2 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.
MultiSweepService.UpdateSweepGroupsContext (cognitive 40) go/pkg/agent/multi_sweep_service.go:223— MultiSweepService.UpdateSweepGroupsContext has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 9 (10 pts), boolean chains 1 (nesting depth added 14). Of this number, 37 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks (cognitive 40) go/pkg/agent/push_loop_addons.go:334— PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 2, loops 2, match/switch 1 (2 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.
OperationsTrafficMap.normalizeTrafficLinks (cognitive 39) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:209— OperationsTrafficMap.normalizeTrafficLinks has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 29, ternaries 8 (9 pts), if/else 1 (nesting depth added 1). Most of this is not in the body itself: 0 of the 39 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 211, 285). 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.
Lifecycle.validate_scope (cognitive 38) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:638— Lifecycle.validate_scope has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22, boolean chains 15, 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.
main.streamAxisRTSP (cognitive 38) go/cmd/wasm-plugins/axis/rtsp_stream.go:12— main.streamAxisRTSP has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 1, 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.
main.enrichGuests (cognitive 38) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:285— main.enrichGuests has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 5, loops 2 (4 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.
main.projectOSV (cognitive 38) go/cmd/tools/ubuntu-feed-merge/projector.go:1004— main.projectOSV has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 3 (5 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.
agentgateway.reassembleConfigChunks (cognitive 38) go/pkg/agentgateway/gateway_client.go:655— agentgateway.reassembleConfigChunks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 2, 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.
k8sinventory.RouteFromUnstructured (cognitive 38) go/pkg/k8sinventory/gateway_unstructured.go:57— k8sinventory.RouteFromUnstructured has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 4 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiscoveryEngine.handleUniFiDiscoveryPhase (cognitive 38) go/pkg/mapper/discovery_unifi_phase.go:62— DiscoveryEngine.handleUniFiDiscoveryPhase has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 4 (8 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.
rendering_label_collision.admitTopologyLabels (cognitive 38) elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js:482— rendering_label_collision.admitTopologyLabels has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 8, loops 3 (6 pts), ternaries 3 (4 pts) (nesting depth added 17). Of this number, 35 points are the body's own statements and 3 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.
_applyBrandBasemapTint (cognitive 38) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:192— _applyBrandBasemapTint has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 10, ternaries 2 (5 pts), error handling 1, loops 1 (nesting depth added 11). Of this number, 36 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.
handleSnapshot (cognitive 38) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:77— handleSnapshot has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 15, ternaries 3, error handling 2, other 1 (nesting depth added 3). Of this number, 35 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
agent.validateProxmoxPublicParams (cognitive 37) go/pkg/agent/plugin_runtime_host_authority.go:461— agent.validateProxmoxPublicParams has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, loops 3 (5 pts), match/switch 2 (4 pts) (nesting depth added 16). Most of this is not in the body itself: 11 of the 37 points are its own statements and the rest belongs to one function literal inside it that branches (line 487). 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.
_draw (cognitive 37) elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:85— _draw has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 13, error handling 2, loops 1 (2 pts), ternaries 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 15 belong to 33 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.
main.buildLaunchBody (cognitive 36) go/cmd/wasm-plugins/awx/main.go:1221— main.buildLaunchBody has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (33 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.
agent.marshalSweepMetricEnvelopeFromMap (cognitive 36) go/pkg/agent/metric_envelope.go:418— agent.marshalSweepMetricEnvelopeFromMap has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 4 (6 pts), boolean chains 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.
cli.RunEdgePackageDownload (cognitive 36) go/pkg/cli/edge_onboarding.go:469— cli.RunEdgePackageDownload has cognitive complexity 36 (threshold 15). Drivers by points: if/else 28 (34 pts), boolean chains 2 (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.
RemoteAccessTerminal.Component (cognitive 36) elixir/web-ng/assets/component/src/RemoteAccessTerminal.jsx:78— RemoteAccessTerminal.Component has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 10, ternaries 7 (9 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 36 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 217, 101, 259, …). 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.
main.consumeLaunchPreflightJSONValue (cognitive 35) go/cmd/wasm-plugins/awx/launch_preflight.go:1229— main.consumeLaunchPreflightJSONValue has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 2 (6 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.listRecentJobsBounded (cognitive 35) go/cmd/wasm-plugins/awx/main.go:1545— main.listRecentJobsBounded has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 5, loops 2 (3 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.
main.validateOSVAffected (cognitive 35) go/cmd/tools/ubuntu-feed-merge/projector.go:691— main.validateOSVAffected has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 7, loops 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.
Server.UploadObject (cognitive 35) go/pkg/datasvc/server.go:270— Server.UploadObject has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 2, loops 1 (nesting depth added 14). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 288). 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.
god_view_elk_scene_acceptance.playwright.assertScene (cognitive 35) elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:175— god_view_elk_scene_acceptance.playwright.assertScene has cognitive complexity 35 (threshold 15). Drivers by points: loops 14 (22 pts), if/else 3 (9 pts), boolean chains 4 (nesting depth added 14). 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.
getNodeTooltip (cognitive 35) elixir/web-ng/assets/js/lib/god_view/rendering_tooltip_methods.js:75— getNodeTooltip has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 13, if/else 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.
DiscoveryEngine.querySingleUniFiAPI (cognitive 34) REDACTED:162— DiscoveryEngine.querySingleUniFiAPI has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 19). 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.
SettingsView.body (cognitive 34) swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:29— SettingsView.body has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11, ternaries 8 (10 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.
OperationsTrafficMap.endpointNodes (cognitive 34) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:792— OperationsTrafficMap.endpointNodes has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 5 (14 pts), boolean chains 9, if/else 3 (8 pts), loops 2 (3 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.
handlePick (cognitive 34) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:329— handlePick has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 11, ternaries 7 (10 pts) (nesting depth added 7). Of this number, 33 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.
aggregateVisibleEdges (cognitive 34) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:624— aggregateVisibleEdges has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 25, if/else 13 (19 pts), ternaries 11 (18 pts), 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.
bindChart (cognitive 34) elixir/web-ng/assets/js/hooks/charts/TimeseriesCombinedChart.js:14— bindChart has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18, boolean chains 13, match/switch 1, other 1, ternaries 1. Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 14 function items inside it that branch (showTooltip::(anonymous), formatValue, formatBytes, …). 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.
Context.grant_matches? (cognitive 33) elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:228— Context.grant_matches? has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 33. 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.
main.streamProxmoxAPIConsole (cognitive 33) REDACTED:319— main.streamProxmoxAPIConsole has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 3, 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.
main.streamProtectRTSP (cognitive 33) go/cmd/wasm-plugins/unifi-protect/rtsp_stream.go:31— main.streamProtectRTSP has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 1, loops 1 (nesting depth added 16). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runner.runOnce (cognitive 33) go/pkg/agent/addon/manager.go:510— runner.runOnce has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (31 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.
agent.buildSweepResultsChunks (cognitive 33) go/pkg/agent/push_loop_sweep_results.go:181— agent.buildSweepResultsChunks has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 7 (10 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cameraRelayManager.runSession (cognitive 33) go/pkg/agent/camera_relay.go:259— cameraRelayManager.runSession has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 15). Of this number, 22 points are the body's own statements and 11 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.
pluginExecution.hostWebSocketConnect (cognitive 33) REDACTED:353— pluginExecution.hostWebSocketConnect has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 5 (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.
PushLoop.pushFlowAttribution (cognitive 33) go/pkg/agent/push_loop_flow_attribution.go:268— PushLoop.pushFlowAttribution has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 1, loops 1 (nesting depth added 16). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushLoop.pushSweepResults (cognitive 33) go/pkg/agent/push_loop_sweep_results.go:28— PushLoop.pushSweepResults has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2 (3 pts), boolean chains 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.
models.ExtractSafeConfigMetadata (cognitive 33) go/pkg/models/utils.go:200— models.ExtractSafeConfigMetadata has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (6 pts), match/switch 1 (3 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.
SYNScanner.runRetryQueue (cognitive 33) go/pkg/scan/syn_scanner_retries.go:90— SYNScanner.runRetryQueue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
layout_elk_radial_overview.decodeElkRadialOverview (cognitive 33) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:307— layout_elk_radial_overview.decodeElkRadialOverview has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 12, loops 3, ternaries 1 (3 pts) (nesting depth added 8). Of this number, 24 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.
harness.instantiateDashboardWasm (cognitive 33) js/cli/harness/harness.js:266— harness.instantiateDashboardWasm has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, if/else 12, ternaries 6, loops 1 (2 pts) (nesting depth added 1). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 274, 290, 270, …). 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.
handleDetailsPanelClick (cognitive 33) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:202— handleDetailsPanelClick has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, error handling 1 (3 pts), ternaries 1 (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.
CleanupReconciler.handle_command_result (cognitive 32) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:46— CleanupReconciler.handle_command_result has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 6, match/switch 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.
main.main (cognitive 32) go/cmd/data-services/main.go:66— main.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 1 (nesting depth added 12). Of this number, 31 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.
DiscoveryEngine.observedFDBMappedNeighbors (cognitive 32) go/pkg/mapper/snmp_l2_observed.go:160— DiscoveryEngine.observedFDBMappedNeighbors has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (8 pts), boolean chains 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.
CoreServiceConfig.Validate (cognitive 32) REDACTED:400— CoreServiceConfig.Validate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 5 (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.
acceptance_geometry_assertions.groupGeometryViolations (cognitive 32) elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:371— acceptance_geometry_assertions.groupGeometryViolations has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5 (8 pts), boolean chains 5, ternaries 2 (nesting depth added 14). 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.
main.newRunfileResolver (cognitive 31) build/release/publish_packages.go:1028— main.newRunfileResolver has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
main.writeCanonicalJSON (cognitive 31) build/release/publish_packages.go:1282— main.writeCanonicalJSON has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 17). 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.
agent.writeCanonicalJSON (cognitive 31) go/pkg/agent/push_loop_status_signature.go:210— agent.writeCanonicalJSON has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 17). 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.
agent.extractReleaseArchive (cognitive 31) REDACTED:872— agent.extractReleaseArchive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pluginExecution.hostHTTPRequest (cognitive 31) REDACTED:103— pluginExecution.hostHTTPRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 3, 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.
Server.handleBannerObservations (cognitive 31) go/pkg/agent/banner_grab_handler.go:31— Server.handleBannerObservations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mapper.buildSNMPL2LinksFromNeighbors (cognitive 31) go/pkg/mapper/snmp_l2_query.go:218— mapper.buildSNMPL2LinksFromNeighbors has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (2 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.
DiscoveryEngine.querySNMPL2Neighbors (cognitive 31) go/pkg/mapper/snmp_l2_query.go:29— DiscoveryEngine.querySNMPL2Neighbors has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 9, loops 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 15 belong to 3 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.
scan.getLocalIPAndInterfaceWithTarget (cognitive 31) go/pkg/scan/syn_scanner_interfaces.go:28— scan.getLocalIPAndInterfaceWithTarget has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (8 pts), boolean chains 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.
serviceradar_rdp_connector_probe::probe::connector::validate_service_radar_open_request (cognitive 31) rust/rdp-connector-probe/src/probe/connector.rs:1— serviceradar_rdp_connector_probe::probe::connector::validate_service_radar_open_request has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, boolean chains 15. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentCommandBus.validate_preallocated_transmit_payload (cognitive 30) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2533— AgentCommandBus.validate_preallocated_transmit_payload has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 3 (5 pts) (nesting depth added 14). 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.
Ubuntu.validate_fingerprint (cognitive 30) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:854— Ubuntu.validate_fingerprint has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, 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.
WorkloadAPI.fetch_x509_svid (cognitive 30) elixir/serviceradar_core/lib/serviceradar/spiffe/workload_api.ex:14— WorkloadAPI.fetch_x509_svid has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 3 (7 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.
PushLoop.controlStreamLoop (cognitive 30) go/pkg/agent/control_stream.go:229— PushLoop.controlStreamLoop has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 4 (10 pts), 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.
sysmon.firstUsableIPv4 (cognitive 30) go/pkg/sysmon/host.go:64— sysmon.firstUsableIPv4 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 pts), boolean chains 4 (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.
configurationResource.ModifyPlan (cognitive 30) go/pkg/terraformprovider/resource.go:43— configurationResource.ModifyPlan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 11 (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.
RemoteAccessTCPText.Component (cognitive 30) elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:48— RemoteAccessTCPText.Component has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (11 pts), ternaries 6, error handling 1 (nesting depth added 1). Of this number, 22 points are the body's own statements and 8 belong to 3 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.
tokenizer.inferSlot (cognitive 30) elixir/web-ng/assets/js/lib/srql/tokenizer.js:284— tokenizer.inferSlot has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 3 (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.
rendering_graph_view_methods.managedRouteGlyphClearanceConstraint (cognitive 30) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:263— rendering_graph_view_methods.managedRouteGlyphClearanceConstraint has cognitive complexity 30 (threshold 15). Drivers by points: if/else 3 (11 pts), ternaries 2 (8 pts), loops 3 (6 pts), boolean chains 5 (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.
publish.publishCommand (cognitive 30) js/cli/src/dashboard/publish.ts:19— publish.publishCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, ternaries 3, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
importsFor (cognitive 30) REDACTED:924— importsFor has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 11, if/else 11, ternaries 7, error handling 1. Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 30 function items inside it that branch (framePayloadBytes, emitRenderModel, writeBytes, …). 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.
createDeckInstance (cognitive 30) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:577— createDeckInstance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 4 (9 pts), boolean chains 3 (nesting depth added 8). Most of this is not in the body itself: 0 of the 30 points are its own statements and the rest belongs to 8 function items inside it that branch (onError, onViewStateChange::applyViewState, onViewStateChange, …). 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.
elkManifoldBindings (cognitive 30) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:174— elkManifoldBindings has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 6 (13 pts), loops 6 (8 pts), boolean chains 5, if/else 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveAwxLaunchPreflight.membership_request_host (cognitive 29) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:383— LiveAwxLaunchPreflight.membership_request_host has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 13, 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.
PluginResultIngestor.do_insert_status (cognitive 29) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:151— PluginResultIngestor.do_insert_status has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 4 (11 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.
RemoteAccessStreamHandler.credential_broker_opts (cognitive 29) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:461— RemoteAccessStreamHandler.credential_broker_opts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 5 (9 pts) (nesting depth added 14). 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.
check_extension_abi.main (cognitive 29) docker/images/check_extension_abi.py:191— check_extension_abi.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 5 (7 pts), ternaries 2 (5 pts), boolean chains 3 (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.
main.launchPreflightJSONWithoutNumbers (cognitive 29) go/cmd/wasm-plugins/awx/launch_preflight.go:849— main.launchPreflightJSONWithoutNumbers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 16). 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.
main.main (cognitive 29) go/cmd/tools/waitforport/main.go:12— main.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 3, 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.
runner.supervise (cognitive 29) go/pkg/agent/addon/manager.go:973— runner.supervise has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 1 (2 pts), boolean chains 1, 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.
agent.trustedProxmoxSSHTimeout (cognitive 29) go/pkg/agent/plugin_runtime_host_authority.go:2128— agent.trustedProxmoxSSHTimeout has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 2136). 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.
agent.systemdAddonUnitStatusWithReader (cognitive 29) go/pkg/agent/push_loop_capabilities.go:580— agent.systemdAddonUnitStatusWithReader has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 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.
edgeonboarding.EnrollCollectorFromToken (cognitive 29) REDACTED:64— edgeonboarding.EnrollCollectorFromToken has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25 (28 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.
createContext (cognitive 29) js/cli/harness/dev.js:30— createContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, error handling 3, ternaries 3, loops 2, other 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 10 function items inside it that branch (swapFixture, mount, loadFrames, …). 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.
draw (cognitive 29) elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:140— draw has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 7 (9 pts), boolean chains 5, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecureExecutionCurrentAuthority.exact_approval_snapshot (cognitive 28) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:309— SecureExecutionCurrentAuthority.exact_approval_snapshot has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, boolean chains 13, 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.
extract_rootfs.main (cognitive 28) docker/images/extract_rootfs.py:114— extract_rootfs.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3, boolean chains 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.
main.normalizeCallbackCredentialType (cognitive 28) go/cmd/wasm-plugins/awx/main.go:605— main.normalizeCallbackCredentialType has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 6, 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.
main.valueBool (cognitive 28) REDACTED:515— main.valueBool has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 1 (2 pts), boolean chains 1, 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.
agent.consumeUniqueJSONValue (cognitive 28) go/pkg/agent/plugin_runtime_host_authority.go:853— agent.consumeUniqueJSONValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts), boolean chains 2, match/switch 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.
PushLoop.handleAdhocScan (cognitive 28) go/pkg/agent/adhoc_scan.go:128— PushLoop.handleAdhocScan has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
k8sinventory.LoadConfigFromEnv (cognitive 28) go/pkg/k8sinventory/config.go:76— k8sinventory.LoadConfigFromEnv has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (25 pts), loops 1 (2 pts), 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.
DiscoveryEngine.startWorkers (cognitive 28) go/pkg/mapper/discovery_workers.go:61— DiscoveryEngine.startWorkers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (14 pts), match/switch 3 (11 pts), loops 2 (3 pts) (nesting depth added 20). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to one function literal inside it that branches (line 72). 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.
DiscoveryEngine.bridgeIfIndexByMACFromFDBEntries (cognitive 28) go/pkg/mapper/snmp_l2_bridge.go:157— DiscoveryEngine.bridgeIfIndexByMACFromFDBEntries has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 2, 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.
PortAllocator.Reserve (cognitive 28) go/pkg/scan/ports.go:107— PortAllocator.Reserve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (6 pts), loops 3 (5 pts) (nesting depth added 16). Of this number, 23 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionLibraryView.uploadSavedArtifacts (cognitive 28) swift/FieldSurvey/FieldSurvey/Views/HomeShellView.swift:495— SessionLibraryView.uploadSavedArtifacts has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 4 (5 pts), boolean chains 4, 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.
NestedArray.asString (cognitive 28) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArray.swift:431— NestedArray.asString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 14). 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.
ArrowType.fromCDataFormatId (cognitive 28) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:412— ArrowType.fromCDataFormatId has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22 (23 pts), match/switch 1 (2 pts), ternaries 1 (2 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.
DashboardBuilderCanvas.MiniVisual (cognitive 28) elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:227— DashboardBuilderCanvas.MiniVisual has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 16, ternaries 4 (9 pts), if/else 3 (nesting depth added 5). 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, 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.
acceptance_geometry_assertions.transportLayerRouteIdViolations (cognitive 28) elixir/web-ng/assets/js/lib/god_view/acceptance_geometry_assertions.js:26— acceptance_geometry_assertions.transportLayerRouteIdViolations has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5 (8 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 9). Of this number, 26 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.
validation.validateSampleFrames (cognitive 28) js/cli/src/validation.ts:161— validation.validateSampleFrames has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 4 (5 pts), boolean chains 4, loops 2, 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.
renderSvgFallback (cognitive 28) REDACTED:1722— renderSvgFallback has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, loops 3 (4 pts), ternaries 4, other 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 9 function items inside it that branch (labelFor, (anonymous), (anonymous)::(anonymous), …). 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.
selectNodeLabels (cognitive 28) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:180— selectNodeLabels has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 10, loops 2, ternaries 1 (nesting depth added 6). Of this number, 24 points are the body's own statements and 4 belong to 10 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.
_draw (cognitive 28) elixir/web-ng/assets/js/hooks/charts/NetflowTalkersIcicle.js:120— _draw has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 11, ternaries 4, loops 1 (nesting depth added 1). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 22 function items inside it that branch ((anonymous), colorFor, (anonymous), …). 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.
main.listAWXPathBounded (cognitive 27) go/cmd/wasm-plugins/awx/main.go:2377— main.listAWXPathBounded has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, 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.
agent.InstallAddonSystemdUnits (cognitive 27) go/pkg/agent/addon_systemd.go:161— agent.InstallAddonSystemdUnits has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 3, boolean chains 2 (nesting depth added 8). 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.
PushLoop.applyConfigResponseWithSequence (cognitive 27) go/pkg/agent/push_loop_config.go:131— PushLoop.applyConfigResponseWithSequence has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 3 (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.
remoteaccess.NormalizeDesktopCredentialGrantAt (cognitive 27) go/pkg/agent/remoteaccess/desktop_credential.go:79— remoteaccess.NormalizeDesktopCredentialGrantAt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, match/switch 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.
accounts.applyUserPermissions (cognitive 27) go/pkg/nats/accounts/user_manager.go:160— accounts.applyUserPermissions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (12 pts), match/switch 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.
scan.scanStreamBatched (cognitive 27) go/pkg/scan/syn_scanner_stream.go:41— scan.scanStreamBatched has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 14). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 60). 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.
NetworkSweeper.generateTargetsBatched (cognitive 27) go/pkg/sweeper/sweeper_target_generation.go:158— NetworkSweeper.generateTargetsBatched has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (5 pts) (nesting depth added 12). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
manifestschema.checkObject (cognitive 27) go/tools/addon-manifest-validator/internal/manifestschema/validator.go:316— manifestschema.checkObject has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (5 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.
SignalCoverageInterpolator.coverageGrid (cognitive 27) swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:13— SignalCoverageInterpolator.coverageGrid has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 8, loops 3 (6 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.
ArrowArrayBuilders.loadBuilder (cognitive 27) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:207— ArrowArrayBuilders.loadBuilder has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, boolean chains 13. 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.
ArrowUnkeyedDecoding.decode (cognitive 27) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowDecoder.swift:154— ArrowUnkeyedDecoding.decode has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 25, if/else 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.
topologySchematicLinks (cognitive 27) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:143— topologySchematicLinks has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (8 pts), if/else 5 (7 pts), loops 3 (nesting depth added 5). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (nearestHubFor, nearestHubFor::(anonymous), touch, …). 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.
buildNodeAndLabelLayers (cognitive 27) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:380— buildNodeAndLabelLayers has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13, boolean chains 10, if/else 3 (4 pts) (nesting depth added 1). Of this number, 19 points are the body's own statements and 8 belong to 28 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.
CallbackCommandResultCoordinator.process_success (cognitive 26) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:957— CallbackCommandResultCoordinator.process_success has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 4 (9 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.
Ubuntu.validate_assertion_kind (cognitive 26) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:673— Ubuntu.validate_assertion_kind has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 4, 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.
main.extractAnsibleHostFromVariables (cognitive 26) go/cmd/wasm-plugins/awx/main.go:3757— main.extractAnsibleHostFromVariables has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (6 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.
main.listDevices (cognitive 26) go/cmd/wasm-plugins/netbox/main.go:326— main.listDevices has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 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.
main.fetchUniFiNetworkSiteClientMatches (cognitive 26) go/cmd/wasm-plugins/unifi-protect/protect_network.go:89— main.fetchUniFiNetworkSiteClientMatches has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 3, 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.
agent.extractAddonTarball (cognitive 26) go/pkg/agent/addon_activation.go:611— agent.extractAddonTarball has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (24 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.
PushLoop.buildSNMPDrainedResults (cognitive 26) go/pkg/agent/push_loop_snmp.go:154— PushLoop.buildSNMPDrainedResults has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 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.
GatewayClient.Connect (cognitive 26) go/pkg/agentgateway/gateway_client.go:144— GatewayClient.Connect has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 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.
DiscoveryEngine.knownDeviceIPv4Set (cognitive 26) go/pkg/mapper/snmp_l2_bridge.go:378— DiscoveryEngine.knownDeviceIPv4Set has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (4 pts), boolean chains 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.
DiscoveryEngine.queryUniFiDevices (cognitive 26) go/pkg/mapper/ubnt_devices.go:26— DiscoveryEngine.queryUniFiDevices has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 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.
SubnetScanner.resolve (cognitive 26) swift/FieldSurvey/FieldSurvey/Network/SubnetScanner.swift:218— SubnetScanner.resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 2 (4 pts), boolean chains 3 (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.
Coordinator.monitorFrameLiveness (cognitive 26) swift/FieldSurvey/FieldSurvey/Views/CompositeSurveyView.swift:428— Coordinator.monitorFrameLiveness has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, match/switch 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.
god_view_elk_scene_acceptance.playwright.assertFocusedNeighborhood (cognitive 26) elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:61— god_view_elk_scene_acceptance.playwright.assertFocusedNeighborhood has cognitive complexity 26 (threshold 15). Drivers by points: loops 11 (16 pts), if/else 2 (6 pts), boolean chains 4 (nesting depth added 9). Of this number, 23 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
layout_topology_state_methods.detailTopologySceneFromGeometry (cognitive 26) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:196— layout_topology_state_methods.detailTopologySceneFromGeometry has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 15, if/else 6, ternaries 5. Of this number, 14 points are the body's own statements and 12 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.
dev.watchProjectForValidation (cognitive 26) js/cli/src/dashboard/dev.ts:362— dev.watchProjectForValidation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). Of this number, 24 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.
computeTraversalMask (cognitive 26) elixir/web-ng/assets/js/lib/god_view/rendering_graph_bitmap_methods.js:76— computeTraversalMask has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 3 (6 pts), error handling 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.
bindChart (cognitive 26) elixir/web-ng/assets/js/hooks/charts/TimeseriesChart.js:15— bindChart has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 8, match/switch 1, other 1. Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 10 function items inside it that branch (formatValue, formatBytes, formatHz, …). 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.
ControllerProvenance.exact_command_payload (cognitive 25) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:577— ControllerProvenance.exact_command_payload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, 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.
PluginIntegrationProvisioner.upsert_assignment (cognitive 25) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:150— PluginIntegrationProvisioner.upsert_assignment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 4 (10 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.
ProxmoxConsoleStreamHandler.handle_in (cognitive 25) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:91— ProxmoxConsoleStreamHandler.handle_in has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 4 (9 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
main.reviewedAWXSurveyVariable (cognitive 25) go/cmd/wasm-plugins/awx/main.go:2923— main.reviewedAWXSurveyVariable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, loops 3 (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.
main.projectAWXSurveyChoices (cognitive 25) go/cmd/wasm-plugins/awx/main.go:3006— main.projectAWXSurveyChoices has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 8). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config.Validate (cognitive 25) go/cmd/wasm-plugins/opentext-nom/config.go:272— Config.Validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, 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.
main.interfacesFromGuestConfig (cognitive 25) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:417— main.interfacesFromGuestConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 6 (9 pts), match/switch 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.
agent.applyCredentialBrokerFormInjection (cognitive 25) go/pkg/agent/plugin_runtime_actions.go:508— agent.applyCredentialBrokerFormInjection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, loops 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.
agent.buildNetprobeResultsPayloads (cognitive 25) go/pkg/agent/push_loop_mapper_netprobe.go:256— agent.buildNetprobeResultsPayloads has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 1, loops 1 (nesting depth added 9). Of this number, 23 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.
netprobe.pumpCaptureBlocks (cognitive 25) go/pkg/agent/netprobe/capture_forwarder.go:309— netprobe.pumpCaptureBlocks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (24 pts), 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.
PushLoop.applyBumblebeeConfig (cognitive 25) go/pkg/agent/push_loop_config.go:458— PushLoop.applyBumblebeeConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (22 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.
remoteaccess.validateDesktopFrame (cognitive 25) go/pkg/agent/remoteaccess/desktop_frame.go:124— remoteaccess.validateDesktopFrame has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, match/switch 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.
cli.RunSpireJoinToken (cognitive 25) go/pkg/cli/spire.go:44— cli.RunSpireJoinToken has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 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.
mapper.fetchUniFiPagedDataWithPageCap (cognitive 25) go/pkg/mapper/ubnt_pagination.go:59— mapper.fetchUniFiPagedDataWithPageCap has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (3 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.
DiscoveryEngine.enrichSNMPBridgeFingerprint (cognitive 25) go/pkg/mapper/snmp_fingerprint.go:31— DiscoveryEngine.enrichSNMPBridgeFingerprint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). Of this number, 23 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.
NetworkSweeper.runSweep (cognitive 25) go/pkg/sweeper/sweeper_run.go:102— NetworkSweeper.runSweep has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 5). Of this number, 18 points are the body's own statements and 7 belong to 4 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.
ArrowArrayBuilders.isValidBuilderType (cognitive 25) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:240— ArrowArrayBuilders.isValidBuilderType has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 25. 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.
god_view_acceptance_geometry_observer.renderedRouteStrokeWidth (cognitive 25) elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:133— god_view_acceptance_geometry_observer.renderedRouteStrokeWidth has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 16, ternaries 5, if/else 4. Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 136, 138, 135). 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.
doctor.doctorCommand (cognitive 25) js/cli/src/doctor.ts:34— doctor.doctorCommand has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 3 (6 pts), error handling 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.
wireSidePanel (cognitive 25) js/cli/harness/dev.js:301— wireSidePanel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (6 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). Of this number, 21 points are the body's own statements and 4 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_syncMarkers (cognitive 25) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:247— _syncMarkers has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 3 (5 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
focusClusterNeighborhood (cognitive 25) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1173— focusClusterNeighborhood has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (11 pts), ternaries 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 7 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.
Context.new (cognitive 24) elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:79— Context.new has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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.
otxJSONScanner.readString (cognitive 24) go/cmd/wasm-plugins/alienvault-otx/main.go:1319— otxJSONScanner.readString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (5 pts), boolean chains 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.
runfileResolver.resolve (cognitive 24) build/release/publish_packages.go:1106— runfileResolver.resolve has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (23 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.
main.sampleV1Query (cognitive 24) REDACTED:401— main.sampleV1Query has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 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.
main.parseRunConfig (cognitive 24) go/cmd/tools/mapper-baseline/main.go:183— main.parseRunConfig has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
agent.validatePluginActionGrantAllow (cognitive 24) go/pkg/agent/plugin_runtime_actions.go:326— agent.validatePluginActionGrantAllow has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (12 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.
pluginExecution.authorizeCredentialBrokerHTTPRequestBody (cognitive 24) go/pkg/agent/plugin_runtime_http_body_policy.go:30— pluginExecution.authorizeCredentialBrokerHTTPRequestBody has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, match/switch 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.
SNMPCollector.processValue (cognitive 24) go/pkg/agent/snmp/collector.go:316— SNMPCollector.processValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, match/switch 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.
armis.buildMetadata (cognitive 24) go/pkg/agent/syncsources/armis/update.go:58— armis.buildMetadata has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23 (24 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.
Server.DownloadObject (cognitive 24) go/pkg/datasvc/server.go:365— Server.DownloadObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 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.
DB.InsertOCSFNetworkActivity (cognitive 24) go/pkg/db/ocsf_network_activity.go:57— DB.InsertOCSFNetworkActivity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 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.
edgeonboarding.extractCollectorBundle (cognitive 24) REDACTED:275— edgeonboarding.extractCollectorBundle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 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.
endpointinventory.validateConfig (cognitive 24) go/pkg/endpointinventory/config.go:281— endpointinventory.validateConfig has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 1 (2 pts), 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.
DiscoveryEngine.resolveExistingDeviceIdentityByIPUnlocked (cognitive 24) go/pkg/mapper/discovery_devices.go:166— DiscoveryEngine.resolveExistingDeviceIdentityByIPUnlocked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (5 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.
OCSFDevice.ToJSONFields (cognitive 24) go/pkg/models/ocsf_device.go:376— OCSFDevice.ToJSONFields has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (24 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.
SubnetScanner.startScanning (cognitive 24) swift/FieldSurvey/FieldSurvey/Network/SubnetScanner.swift:33— SubnetScanner.startScanning has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (3 pts), 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.
SurveyView.checkpointSession (cognitive 24) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:671— SurveyView.checkpointSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (6 pts), boolean chains 2, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowReader.readStreaming (cognitive 24) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:258— ArrowReader.readStreaming has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (8 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.
_initOrUpdate (cognitive 24) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:50— _initOrUpdate has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), error handling 3 (6 pts), ternaries 2 (3 pts) (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildMtrPathEdgeData (cognitive 24) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:359— buildMtrPathEdgeData has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 7, ternaries 7, if/else 5 (6 pts), other 3, loops 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 369, 403). 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.
AwxLaunchPreflightAttestation.verify_evidence (cognitive 23) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:229— AwxLaunchPreflightAttestation.verify_evidence has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 10, 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.
HardenedLaunchPlan.build (cognitive 23) elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:32— HardenedLaunchPlan.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, boolean chains 8, 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.
CurrentAuthority.current_approval_snapshot (cognitive 23) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:782— CurrentAuthority.current_approval_snapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 10, 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.
EndpointVulnerabilityAdjudicator.trusted_assertion_provenance? (cognitive 23) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:671— EndpointVulnerabilityAdjudicator.trusted_assertion_provenance? has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 23. 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.
export_rootfs_from_layout._extract_layer (cognitive 23) docker/images/export_rootfs_from_layout.py:27— export_rootfs_from_layout._extract_layer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3, 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.
builder.build (cognitive 23) build/packaging/agent/macos/package.go:201— builder.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (22 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.
PluginManager.ApplyConfig (cognitive 23) go/pkg/agent/plugin_runtime_manager.go:164— PluginManager.ApplyConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (6 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.
devicealias.FromMetadata (cognitive 23) go/pkg/devicealias/alias.go:19— devicealias.FromMetadata has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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.
DiscoveryEngine.processPortTable (cognitive 23) go/pkg/mapper/ubnt_topology.go:70— DiscoveryEngine.processPortTable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tracer.matchProbeResponse (cognitive 23) go/pkg/mtr/tracer.go:597— Tracer.matchProbeResponse has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (10 pts), match/switch 2 (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.
ICMPSweeper.processResults (cognitive 23) go/pkg/scan/icmp_scanner_unix.go:718— ICMPSweeper.processResults has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 2, loops 1 (nesting depth added 13). 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.
SYNScanner.tryReleaseMapping (cognitive 23) go/pkg/scan/syn_scanner_mappings.go:31— SYNScanner.tryReleaseMapping has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 1 (4 pts), boolean chains 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.
SYNScanner.worker (cognitive 23) go/pkg/scan/syn_scanner_worker.go:31— SYNScanner.worker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (6 pts), loops 2 (3 pts), jumps 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.
DashboardBuilderCanvas.Component (cognitive 23) elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:351— DashboardBuilderCanvas.Component has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 8, boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 505, 364, 411, …). 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.
layout_elk_scene.decodeElkScene (cognitive 23) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:632— layout_elk_scene.decodeElkScene has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, ternaries 11. Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 691, 638, 726, …). 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.
topology_overview_projection.attachedEndpointNodes (cognitive 23) elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:283— topology_overview_projection.attachedEndpointNodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
security_findings.dashboardHtml (cognitive 23) REDACTED:48— security_findings.dashboardHtml has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 16 (19 pts), boolean chains 3, if/else 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 6 belong to 3 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.
dev.devCommandHmr (cognitive 23) js/cli/src/dashboard/dev.ts:51— dev.devCommandHmr has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), error handling 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 103). 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.
stateReasonForNode (cognitive 23) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:20— stateReasonForNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 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.
autoFitViewState (cognitive 23) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1083— autoFitViewState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, ternaries 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.
CallbackCommandContract.broker_matches? (cognitive 22) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:419— CallbackCommandContract.broker_matches? has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 20, if/else 1, match/switch 1. 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.
LiveAwxLaunchPreflight.validate_controller_security_snapshot (cognitive 22) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:304— LiveAwxLaunchPreflight.validate_controller_security_snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, boolean chains 10, 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.
CurrentAuthority.rebuild (cognitive 22) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:141— CurrentAuthority.rebuild has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 4, 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.
CurrentAuthority.current_policy_snapshot (cognitive 22) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:826— CurrentAuthority.current_policy_snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, boolean chains 10, 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.
Manifest.validate_producer_schedule (cognitive 22) elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1422— Manifest.validate_producer_schedule has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 10, match/switch 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.
ProxmoxHostAuthority.canonical_origin (cognitive 22) elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:429— ProxmoxHostAuthority.canonical_origin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 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.
Packages.create_from_upload (cognitive 22) elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:441— Packages.create_from_upload has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 19, if/else 2, 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.
main.normalizeLaunchPreflightAddress (cognitive 22) go/cmd/wasm-plugins/awx/launch_preflight.go:560— main.normalizeLaunchPreflightAddress has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (9 pts), loops 2 (3 pts) (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.
main.mergeRunGroup (cognitive 22) go/cmd/tools/ubuntu-feed-merge/main.go:708— main.mergeRunGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (nesting depth added 7). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 722). 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.
main.validateVEXStatement (cognitive 22) go/cmd/tools/ubuntu-feed-merge/projector.go:851— main.validateVEXStatement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2, loops 2, 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.
main.ensureCanonicalPURLSize (cognitive 22) go/cmd/tools/ubuntu-feed-merge/projector.go:1617— main.ensureCanonicalPURLSize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 2 (nesting depth added 5). Of this number, 11 points are the body's own statements and 11 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.
agent.proxmoxInventoryPathAllowed (cognitive 22) go/pkg/agent/plugin_runtime_host_authority.go:953— agent.proxmoxInventoryPathAllowed has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, if/else 4, 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.
agent.proxyProxmoxConsoleSSHInput (cognitive 22) go/pkg/agent/proxmox_console_ssh.go:214— agent.proxyProxmoxConsoleSSHInput has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (4 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.
desktopMediaGatewaySender.recvLoop (cognitive 22) go/pkg/agent/desktop_media_sender.go:349— desktopMediaGatewaySender.recvLoop has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (21 pts), 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.
client.enrichAssetFields (cognitive 22) go/pkg/agent/syncsources/armis/asset_enrichment.go:203— client.enrichAssetFields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (10 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.
Server.Stop (cognitive 22) go/pkg/agent/server.go:602— Server.Stop has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 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.
NATSAccountServer.getResolverConn (cognitive 22) go/pkg/datasvc/nats_account_service.go:183— NATSAccountServer.getResolverConn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 20 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.
DiscoveryEngine.queryInterfaces (cognitive 22) go/pkg/mapper/snmp_interfaces.go:30— DiscoveryEngine.queryInterfaces has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (4 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.
models.DeepCopyHostResult (cognitive 22) go/pkg/models/sweep.go:184— models.DeepCopyHostResult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tracer.Run (cognitive 22) go/pkg/mtr/tracer.go:210— Tracer.Run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5 (nesting depth added 4). Of this number, 15 points are the body's own statements and 7 belong to 3 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.
sysmon.CollectDisks (cognitive 22) go/pkg/sysmon/disk.go:28— sysmon.CollectDisks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SurveySetupPhaseView.body (cognitive 22) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1032— SurveySetupPhaseView.body has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14 (18 pts), if/else 4 (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.
layout_topology_state_methods.overviewTopologySceneFromGeometry (cognitive 22) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:283— layout_topology_state_methods.overviewTopologySceneFromGeometry has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, if/else 5. 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.
rendering_style_edge_particle_methods.packetFlowStamp (cognitive 22) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:3— rendering_style_edge_particle_methods.packetFlowStamp has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 16, ternaries 2 (4 pts), if/else 1, loops 1 (nesting depth added 2). Of this number, 20 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.
NetflowStackedAreaChart.renderTotalOverlays (cognitive 22) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:436— NetflowStackedAreaChart.renderTotalOverlays has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 6 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.
mounted (cognitive 22) elixir/web-ng/assets/js/hooks/SRQLTimeCookie.js:2— mounted has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, error handling 1, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 13 function items inside it that branch (maybeRestore, cookieGet, extractTimeToken, …). 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.
draw (cognitive 22) elixir/web-ng/assets/js/hooks/charts/FlowDonut.js:34— draw has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 4, error handling 1. Of this number, 11 points are the body's own statements and 11 belong to 5 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.
AwxLaunchPreflightAttestation.verify_persisted_internal (cognitive 21) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:327— AwxLaunchPreflightAttestation.verify_persisted_internal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 6, 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.
CallbackCommandResultCoordinator.activate_exact_scope (cognitive 21) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1164— CallbackCommandResultCoordinator.activate_exact_scope has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lifecycle.prepare_draft (cognitive 21) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:442— Lifecycle.prepare_draft has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 7, 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.
Ubuntu.validate_product_fields (cognitive 21) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:343— Ubuntu.validate_product_fields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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.
AddonFleet.build_row (cognitive 21) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.ex:375— AddonFleet.build_row has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 17, if/else 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.
FirstPartyImporter.import (cognitive 21) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:149— FirstPartyImporter.import has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, 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.
main.isProbablyIP (cognitive 21) go/cmd/wasm-plugins/awx/main.go:3794— main.isProbablyIP has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, loops 3 (5 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.
Query.UnmarshalJSON (cognitive 21) go/cmd/wasm-plugins/opentext-nom/config.go:67— Query.UnmarshalJSON has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (5 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.
main.validatePluginInputsJSON (cognitive 21) go/cmd/wasm-plugins/proxmox/config.go:219— main.validatePluginInputsJSON has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 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.
builder.verifyPayload (cognitive 21) build/packaging/agent/macos/package.go:370— builder.verifyPayload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1, 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.
builder.buildArch (cognitive 21) build/packaging/agent/windows/package.go:153— builder.buildArch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
agent.newDesktopMediaGatewaySender (cognitive 21) go/pkg/agent/desktop_media_sender.go:87— agent.newDesktopMediaGatewaySender has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 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.
agent.parseSystemdUnitStatusOutputForUnit (cognitive 21) go/pkg/agent/push_loop_capabilities.go:719— agent.parseSystemdUnitStatusOutputForUnit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.stageAgentRelease (cognitive 21) REDACTED:232— agent.stageAgentRelease has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 1 (nesting depth added 3). 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: 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.
PluginManager.loadWasm (cognitive 21) go/pkg/agent/plugin_runtime_wazero.go:291— PluginManager.loadWasm has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (21 pts) (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.
PushLoop.handlePluginRunAction (cognitive 21) go/pkg/agent/control_stream.go:656— PushLoop.handlePluginRunAction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 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.
PushLoop.enrollOnce (cognitive 21) go/pkg/agent/push_loop_enroll.go:113— PushLoop.enrollOnce has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 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.
PushLoop.monitorReleaseActivation (cognitive 21) go/pkg/agent/push_loop_enroll.go:228— PushLoop.monitorReleaseActivation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 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.
PushLoop.pushNetprobeResults (cognitive 21) go/pkg/agent/push_loop_mapper_netprobe.go:95— PushLoop.pushNetprobeResults has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4, boolean chains 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.
cli.RunEdgePackageList (cognitive 21) go/pkg/cli/edge_onboarding.go:310— cli.RunEdgePackageList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2, 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.
Bootstrapper.loadPackageFromArchive (cognitive 21) go/pkg/edgeonboarding/download.go:222— Bootstrapper.loadPackageFromArchive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 1 (2 pts), loops 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.
DiscoveryEngine.findMatchingGroup (cognitive 21) go/pkg/mapper/discovery_dedup.go:118— DiscoveryEngine.findMatchingGroup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (5 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.
CoreServiceConfig.UnmarshalJSON (cognitive 21) REDACTED:317— CoreServiceConfig.UnmarshalJSON has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (21 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.
accounts.BootstrapOperator (cognitive 21) go/pkg/nats/accounts/operator.go:363— accounts.BootstrapOperator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 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.
DefaultCollector.Collect (cognitive 21) go/pkg/sysmon/collector.go:187— DefaultCollector.Collect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (21 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, 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.
tokenizer.splitSegments (cognitive 21) elixir/web-ng/assets/js/lib/srql/tokenizer.js:64— tokenizer.splitSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, 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.
SrqlEditor.Component (cognitive 21) elixir/web-ng/assets/component/src/SrqlEditor.jsx:4— SrqlEditor.Component has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, ternaries 4 (7 pts), boolean chains 6 (nesting depth added 3). 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 literals inside it that branch (lines 47, 15, 56, …). 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.
harness.browserModuleApi (cognitive 21) js/cli/harness/harness.js:95— harness.browserModuleApi has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 3, loops 2 (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 10 function literals inside it that branch (lines 106, 151, 100, …). 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.
hintValues (cognitive 21) elixir/web-ng/assets/js/hooks/SRQLInput.js:480— hintValues has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, 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.
connectWebRtc (cognitive 21) elixir/web-ng/assets/js/hooks/CameraRelayStatusStream.js:338— connectWebRtc has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 8, error handling 2 (3 pts) (nesting depth added 1). Of this number, 11 points are the body's own statements and 10 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.
fitVisualSpecs (cognitive 21) elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:198— fitVisualSpecs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (5 pts), boolean chains 2, loops 1 (2 pts), other 2 (nesting depth added 6). Of this number, 14 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
requestTopologyProfileLayout (cognitive 21) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:479— requestTopologyProfileLayout has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), error handling 1, other 1 (nesting depth added 1). Of this number, 18 points are the body's own statements and 3 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.
_draw (cognitive 21) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:115— _draw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 8, error handling 2. Of this number, 16 points are the body's own statements and 5 belong to 7 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.
AwxClient.valid_launch_args? (cognitive 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1109— AwxClient.valid_launch_args? has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 20. 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.
AwxLaunchContract.validate_template (cognitive 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:612— AwxLaunchContract.validate_template has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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.
FileCallbackResponsePolicyProvider.materialize_targets (cognitive 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:460— FileCallbackResponsePolicyProvider.materialize_targets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveAwxLaunchPreflight.attest (cognitive 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:110— LiveAwxLaunchPreflight.attest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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.
SecureExecutionCurrentAuthority.current_principal (cognitive 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:96— SecureExecutionCurrentAuthority.current_principal has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 9, 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.
EndpointVulnerabilityAdjudicator.version_scope_parent_context? (cognitive 20) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:529— EndpointVulnerabilityAdjudicator.version_scope_parent_context? has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (5 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.
EndpointVulnerabilityMatcher.load_fixed_vex_version_scopes (cognitive 20) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:841— EndpointVulnerabilityMatcher.load_fixed_vex_version_scopes has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 18, if/else 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.
ArmisUnmerge.apply_split (cognitive 20) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1055— ArmisUnmerge.apply_split has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4 (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.
Index.handle_event (cognitive 20) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/plugin_package_live/index.ex:628— Index.handle_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 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.
main.runFetchLaunchPreflight (cognitive 20) go/cmd/wasm-plugins/awx/launch_preflight.go:224— main.runFetchLaunchPreflight has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2, boolean chains 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.
main.validatedJobEventPairs (cognitive 20) go/cmd/wasm-plugins/awx/main.go:1883— main.validatedJobEventPairs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (3 pts), 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.
main.rawPluginInputsValid (cognitive 20) go/cmd/wasm-plugins/proxmox/config_raw_parse.go:80— main.rawPluginInputsValid has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, 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.
main.preparePackageArtifacts (cognitive 20) build/release/platform_artifacts.go:118— main.preparePackageArtifacts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2, 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.
desktopRDPHelperSession.readLoop (cognitive 20) go/pkg/agent/desktop_rdp_helper_adapter.go:335— desktopRDPHelperSession.readLoop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), 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.
armis.normalizeMetadataFieldName (cognitive 20) go/pkg/agent/syncsources/armis/metadata_fields.go:202— armis.normalizeMetadataFieldName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 9, 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.
db.buildCNPGConnURL (cognitive 20) go/pkg/db/cnpg_pool.go:76— db.buildCNPGConnURL has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (2 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.
endpointinventory.applyDefaults (cognitive 20) go/pkg/endpointinventory/config.go:126— endpointinventory.applyDefaults 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.
k8sinventory.EndpointSliceFromDiscovery (cognitive 20) go/pkg/k8sinventory/convert.go:56— k8sinventory.EndpointSliceFromDiscovery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2, 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.
mapper.fetchSystemVariables (cognitive 20) go/pkg/mapper/snmp_sysinfo.go:99— mapper.fetchSystemVariables has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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.
Runner.Run (cognitive 20) go/pkg/scalibrinventory/adapter.go:119— Runner.Run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 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.
scan.readReservedPorts (cognitive 20) go/pkg/scan/syn_scanner_ports.go:48— scan.readReservedPorts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 pts), boolean chains 3 (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.
ICMPSweeper.listenForRepliesOnConn (cognitive 20) go/pkg/scan/icmp_scanner_unix.go:553— ICMPSweeper.listenForRepliesOnConn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 1 (2 pts), 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.
SYNScanner.logTelemetry (cognitive 20) REDACTED:186— SYNScanner.logTelemetry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (7 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.
sweepBatchRunner.addTarget (cognitive 20) go/pkg/sweeper/sweeper_batch_runner.go:45— sweepBatchRunner.addTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 1 (nesting depth added 11). 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.
SubnetScanner.startPosixBroadcast (cognitive 20) swift/FieldSurvey/FieldSurvey/Network/SubnetScanner.swift:134— SubnetScanner.startPosixBroadcast has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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.
kvutil::load_spiffe_tls (cognitive 20) rust/kvutil/src/lib.rs:141— kvutil::load_spiffe_tls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (4 pts), boolean chains 3, 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.
SpoolReader::try_next (cognitive 20) rust/otel/src/agent_forward/spool/reader.rs:37— SpoolReader::try_next has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (8 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.
rendering_graph_view_methods.segmentSeparation (cognitive 20) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:161— rendering_graph_view_methods.segmentSeparation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 3 (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.
_syncLine (cognitive 20) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:287— _syncLine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 4 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 7). Of this number, 19 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.
edgeEnabledByTopologyLayer (cognitive 20) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_topology_methods.js:143— edgeEnabledByTopologyLayer has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 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.
handlePanMove (cognitive 20) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:122— handlePanMove has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, error handling 1 (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.
AwxCleanup.build_plan (cognitive 19) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:84— AwxCleanup.build_plan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 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.
RelaySessionLifecycle.activate_session (cognitive 19) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_lifecycle.ex:13— RelaySessionLifecycle.activate_session has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (7 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.
Ubuntu.validate_provenance (cognitive 19) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:194— Ubuntu.validate_provenance has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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.
Ubuntu.validate_assertion (cognitive 19) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:628— Ubuntu.validate_assertion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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.
UbuntuAdapter.validate_inventory (cognitive 19) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/ubuntu_adapter.ex:134— UbuntuAdapter.validate_inventory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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.
Dispatcher.route (cognitive 19) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:352— Dispatcher.route has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Loader.do_reload (cognitive 19) elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex:262— Loader.do_reload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (7 pts), boolean chains 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.
MtrRuntime.load_traces (cognitive 19) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/mtr_runtime.ex:50— MtrRuntime.load_traces has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 7, boolean chains 2 (nesting depth added 5). 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.
MtrData.compare_windows (cognitive 19) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:292— MtrData.compare_windows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ensure_k8s_node_alerts.main (cognitive 19) REDACTED:28— ensure_k8s_node_alerts.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 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.
main.extractLaunchPreflightAnsibleHost (cognitive 19) go/cmd/wasm-plugins/awx/launch_preflight.go:1129— main.extractLaunchPreflightAnsibleHost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 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.
main.extractLaunchPreflightJSONAnsibleHost (cognitive 19) go/cmd/wasm-plugins/awx/launch_preflight.go:1166— main.extractLaunchPreflightJSONAnsibleHost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, 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.
main.runFetchJobHostSummaries (cognitive 19) go/cmd/wasm-plugins/awx/main.go:1687— main.runFetchJobHostSummaries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, 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.
main.runInventorySyncController (cognitive 19) go/cmd/wasm-plugins/awx/main.go:3555— main.runInventorySyncController has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.containsForbiddenProxmoxPublicConfigValue (cognitive 19) go/cmd/wasm-plugins/proxmox/config.go:427— main.containsForbiddenProxmoxPublicConfigValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 11). 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.
main.run_check (cognitive 19) go/cmd/wasm-plugins/unifi-protect/main.go:14— main.run_check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 15). 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.
main.buildProtectCameraDescriptors (cognitive 19) go/cmd/wasm-plugins/unifi-protect/protect_descriptors.go:33— main.buildProtectCameraDescriptors has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BGPSimulationConfig.UnmarshalJSON (cognitive 19) go/cmd/faker/main.go:270— BGPSimulationConfig.UnmarshalJSON has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18 (19 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.
main.buildAdvisory (cognitive 19) go/cmd/tools/ubuntu-feed-merge/projector.go:959— main.buildAdvisory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
grpcServer.RelayOtlp (cognitive 19) go/pkg/addon/grpc.go:174— grpcServer.RelayOtlp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 9). Of this number, 14 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
metricFeedLifecycle.runStream (cognitive 19) go/pkg/agent/addon/metric_feed.go:213— metricFeedLifecycle.runStream has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 3 (5 pts), if/else 1 (3 pts) (nesting depth added 11). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. 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.
agent.splitAWXInventoryHostCredentials (cognitive 19) go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:120— agent.splitAWXInventoryHostCredentials has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 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.
agent.validateProxmoxConsoleBindingTargetIDs (cognitive 19) go/pkg/agent/plugin_runtime_host_authority.go:376— agent.validateProxmoxConsoleBindingTargetIDs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 1, match/switch 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.
agent.dialProxmoxConsoleSSH (cognitive 19) go/pkg/agent/proxmox_console_ssh.go:267— agent.dialProxmoxConsoleSSH has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 1 (nesting depth added 4). 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: 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.
netprobe.processSnapshotSummary (cognitive 19) go/pkg/agent/netprobe/translator.go:319— netprobe.processSnapshotSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 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.
PluginManager.refreshDownloadCredentials (cognitive 19) go/pkg/agent/plugin_runtime_manager.go:301— PluginManager.refreshDownloadCredentials has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5, boolean chains 3 (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.
pluginExecution.proxmoxHostAuthorityForHTTPRequest (cognitive 19) go/pkg/agent/plugin_runtime_host_authority.go:1016— pluginExecution.proxmoxHostAuthorityForHTTPRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, 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.
PushLoop.systemdAddonRuntimeReady (cognitive 19) go/pkg/agent/push_loop_addons.go:756— PushLoop.systemdAddonRuntimeReady has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, 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.
remoteaccess.copyWithFileTransferQuota (cognitive 19) go/pkg/agent/remoteaccess/sftp.go:434— remoteaccess.copyWithFileTransferQuota has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1, 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.
endpointinventory.FinalizeFullScan (cognitive 19) go/pkg/endpointinventory/cache_commit.go:204— endpointinventory.FinalizeFullScan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 219). 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.
DiscoveryEngine.reconcileObservedFDBJoins (cognitive 19) go/pkg/mapper/snmp_l2_observed.go:300— DiscoveryEngine.reconcileObservedFDBJoins has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 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.
DiscoveryEngine.queryUniFiAPI (cognitive 19) REDACTED:110— DiscoveryEngine.queryUniFiAPI has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 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.
ICMPSweeper.processReply (cognitive 19) go/pkg/scan/icmp_scanner_unix.go:626— ICMPSweeper.processReply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 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.
apiClient.request (cognitive 19) go/pkg/terraformprovider/client.go:102— apiClient.request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
manifestschema.normalizeYAML (cognitive 19) go/tools/addon-manifest-validator/internal/manifestschema/validator.go:113— manifestschema.normalizeYAML has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 11). 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.
GaussianProcessModel.cholesky (cognitive 19) swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:255— GaussianProcessModel.cholesky has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Socket::activate (cognitive 19) rust/afpacket/src/linux.rs:116— Socket::activate has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 9 (14 pts), if/else 5 (nesting depth added 5). 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.
dgraph_topology::downstream::reachable_on_canonical (cognitive 19) rust/dgraph-topology/src/downstream.rs:39— dgraph_topology::downstream::reachable_on_canonical has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 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.
Listener::run (cognitive 19) rust/flow-collector/src/listener.rs:129— Listener::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (8 pts), match/switch 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.
FlowAttributionRuntime::start (cognitive 19) rust/netprobe/src/attribution.rs:1350— FlowAttributionRuntime::start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DashboardWasmHost.buildSrqlQuery (cognitive 19) REDACTED:104— DashboardWasmHost.buildSrqlQuery has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (6 pts), loops 2 (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.
harness.buildSrqlQuery (cognitive 19) js/cli/harness/harness.js:193— harness.buildSrqlQuery has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (6 pts), loops 2 (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.
buildCandidates (cognitive 19) elixir/web-ng/assets/js/hooks/SRQLInput.js:233— buildCandidates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 1 (2 pts), other 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 1 belongs to 6 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.
nodeTypeHeroIcon (cognitive 19) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:263— nodeTypeHeroIcon has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 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.
deterministicRelationPresentation (cognitive 19) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:96— deterministicRelationPresentation has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (6 pts), if/else 3 (nesting depth added 2). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 111, 97). 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.
routePairGeometry (cognitive 19) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:962— routePairGeometry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 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.
_draw (cognitive 19) elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:142— _draw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 1). Of this number, 10 points are the body's own statements and 9 belong to 13 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.
AutomationResultSanitizer.job (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:368— AutomationResultSanitizer.job has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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.
AwxBindingReview.normalize_request (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_binding_review.ex:65— AwxBindingReview.normalize_request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, 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.
CallbackCommandRecovery.recover_with_command (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery.ex:96— CallbackCommandRecovery.recover_with_command has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 9). 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.
EventIngestor.handle_launch (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/event_ingestor.ex:344— EventIngestor.handle_launch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (6 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.
SecureChildLauncher.load_launch_state (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:138— SecureChildLauncher.load_launch_state has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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.
AshStore.consume_once (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:106— AshStore.consume_once has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 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.
AshStore.validate_cleanup_reconciliation (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:932— AshStore.validate_cleanup_reconciliation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 7, 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.
CleanupReconciler.result_status (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:160— CleanupReconciler.result_status has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, match/switch 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.
CurrentAuthority.current_principal (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:205— CurrentAuthority.current_principal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 7, 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.
AgentConfigGenerator.map_proxmox_input_items (cognitive 18) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1443— AgentConfigGenerator.map_proxmox_input_items has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 4 (8 pts) (nesting depth added 10). 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.
MergeEngine.do_merge_devices (cognitive 18) elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:234— MergeEngine.do_merge_devices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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.
IntegrationIdentity.validate_v3_record (cognitive 18) elixir/serviceradar_core/lib/serviceradar/inventory/integration_identity.ex:269— IntegrationIdentity.validate_v3_record has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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.
ProxmoxUnfuse.apply_split (cognitive 18) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:481— ProxmoxUnfuse.apply_split has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 4 (7 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.
NetflowProviderDatasetRefreshWorker.fetch_provider_rows (cognitive 18) elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:134— NetflowProviderDatasetRefreshWorker.fetch_provider_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
PluginResultIngestor.handler_marker_context (cognitive 18) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:953— PluginResultIngestor.handler_marker_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 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.
SRQL.execute_query (cognitive 18) elixir/web-ng/lib/serviceradar_web_ng/srql.ex:88— SRQL.execute_query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimeGraph.canonical_edge_to_runtime_row (cognitive 18) elixir/web-ng/lib/serviceradar_web_ng/topology/runtime_graph.ex:248— RuntimeGraph.canonical_edge_to_runtime_row has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 18. 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.
check_extension_abi._shared_objects (cognitive 18) docker/images/check_extension_abi.py:175— check_extension_abi._shared_objects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.positiveQueryInt (cognitive 18) go/cmd/wasm-plugins/alienvault-otx/main.go:860— main.positiveQueryInt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.projectAWXEventData (cognitive 18) go/cmd/wasm-plugins/awx/main.go:2022— main.projectAWXEventData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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.
main.awxSurveyVariableTokens (cognitive 18) go/cmd/wasm-plugins/awx/main.go:2967— main.awxSurveyVariableTokens has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (7 pts), loops 1 (nesting depth added 3). 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, 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.
Collector.lookupAttachedSwitchPort (cognitive 18) go/cmd/wasm-plugins/opentext-nom/attached_switch_port.go:44— Collector.lookupAttachedSwitchPort has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 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.
options.validate (cognitive 18) build/packaging/agent/macos/package.go:148— options.validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, 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.
main.validateWindowsPackages (cognitive 18) build/release/platform_artifacts.go:221— main.validateWindowsPackages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
main.runPushMode (cognitive 18) go/cmd/agent/main.go:159— main.runPushMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.generateMACAddresses (cognitive 18) go/cmd/faker/main.go:1533— main.generateMACAddresses has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 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.
main.loadConfig (cognitive 18) REDACTED:257— main.loadConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (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.
main.consumeArchiveMember (cognitive 18) go/cmd/tools/ubuntu-feed-merge/main.go:412— main.consumeArchiveMember has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (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.
main.parseOSVWithLimits (cognitive 18) go/cmd/tools/ubuntu-feed-merge/projector.go:634— main.parseOSVWithLimits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 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.
main.projectVEX (cognitive 18) go/cmd/tools/ubuntu-feed-merge/projector.go:1161— main.projectVEX has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.parseUbuntuPURLQualifiers (cognitive 18) go/cmd/tools/ubuntu-feed-merge/projector.go:1545— main.parseUbuntuPURLQualifiers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 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.
grpcClient.StreamMetricFeed (cognitive 18) go/pkg/addon/grpc.go:509— grpcClient.StreamMetricFeed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 9). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 520, 544). 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.
addon.reconnectStreamLoop (cognitive 18) go/pkg/agent/addon/stream_backoff.go:48— addon.reconnectStreamLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
agent.applyLocalAddonOverrides (cognitive 18) go/pkg/agent/addon_activation.go:892— agent.applyLocalAddonOverrides has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (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.
agent.validateProxmoxGrantAllow (cognitive 18) go/pkg/agent/control_stream.go:1802— agent.validateProxmoxGrantAllow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 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.
PluginManager.credentialBrokerCacheDecision (cognitive 18) REDACTED:500— PluginManager.credentialBrokerCacheDecision has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (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.
PushLoop.handleEndpointInventoryForceFreshScan (cognitive 18) go/pkg/agent/endpoint_inventory_commands.go:72— PushLoop.handleEndpointInventoryForceFreshScan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 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.
PushLoop.applyConfigIntervals (cognitive 18) go/pkg/agent/push_loop_config.go:362— PushLoop.applyConfigIntervals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 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.
NATSStore.handleWatchWithReconnect (cognitive 18) go/pkg/datasvc/nats.go:356— NATSStore.handleWatchWithReconnect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 2 (5 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.
NATSAccountServer.WriteOperatorConfig (cognitive 18) go/pkg/datasvc/nats_account_service.go:294— NATSAccountServer.WriteOperatorConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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. This shape REPEATS in the file: one other method here (NATSAccountServer.writeOperatorConfigLocked) 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.
NATSAccountServer.writeOperatorConfigLocked (cognitive 18) go/pkg/datasvc/nats_account_service.go:475— NATSAccountServer.writeOperatorConfigLocked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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. This shape REPEATS in the file: one other method here (NATSAccountServer.WriteOperatorConfig) 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.
archiveMetadataFile.toModel (cognitive 18) go/pkg/edgeonboarding/download.go:320— archiveMetadataFile.toModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mapper.distinctHardwareMACSets (cognitive 18) go/pkg/mapper/utils.go:356— mapper.distinctHardwareMACSets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 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.
DiscoveryEngine.addOrUpdateDeviceToResults (cognitive 18) go/pkg/mapper/discovery_devices.go:35— DiscoveryEngine.addOrUpdateDeviceToResults has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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.
DiscoveryEngine.enrichSNMPVLANFingerprint (cognitive 18) go/pkg/mapper/snmp_fingerprint.go:74— DiscoveryEngine.enrichSNMPVLANFingerprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, loops 3 (nesting depth added 1). Of this number, 11 points are the body's own statements and 7 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.
CA.SignUserCertificate (cognitive 18) go/pkg/remoteaccess/sshca/sshca.go:173— CA.SignUserCertificate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
scalibrinventory.applyDefaults (cognitive 18) go/pkg/scalibrinventory/config.go:64— scalibrinventory.applyDefaults has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
Service.enrichPodCorrelation (cognitive 18) go/pkg/trivysidecar/service.go:185— Service.enrichPodCorrelation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
manifestschema.checkArray (cognitive 18) go/tools/addon-manifest-validator/internal/manifestschema/validator.go:368— manifestschema.checkArray has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 3 (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.
main.run (cognitive 18) go/tools/addon-manifest-validator/main.go:50— main.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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.
Coordinator.maybeUpdateARPriorityMode (cognitive 18) swift/FieldSurvey/FieldSurvey/Views/CompositeSurveyView.swift:487— Coordinator.maybeUpdateARPriorityMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (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.
serviceradar_integration_db::bin::observe_connections::main (cognitive 18) rust/integration-db/src/bin/observe_connections.rs:15— serviceradar_integration_db::bin::observe_connections::main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3 (4 pts), boolean chains 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.
CensusConsumer::poll_once (cognitive 18) rust/netprobe/src/census.rs:1510— CensusConsumer::poll_once has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), boolean chains 1, 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.
god_view_exec::compute_three_hop_mask (cognitive 18) elixir/web-ng/assets/wasm/god_view_exec/src/lib.rs:66— god_view_exec::compute_three_hop_mask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 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.
layout_elk_scene.buildElkSceneGraph (cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:333— layout_elk_scene.buildElkSceneGraph has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, loops 2 (3 pts), ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 352, 385, 403, …). 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.
layout_elk_radial_overview.indexElkLayout (cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:252— layout_elk_radial_overview.indexElkLayout has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 3, loops 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.
topology_overview_projection.orientForest (cognitive 18) elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:404— topology_overview_projection.orientForest has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 2 (6 pts), boolean chains 4 (nesting depth added 7). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rendering_scene_view.focusScene (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:394— rendering_scene_view.focusScene has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 17, ternaries 1. Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 418, 402, 414, …). 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.
boot (cognitive 18) REDACTED:385— boot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 2 (3 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.
humanizeCausalReason (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:88— humanizeCausalReason has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6, 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.
expandableEndpointClusterId (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:219— expandableEndpointClusterId has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 7, if/else 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.
aggregateVisibleEdges::classBucketForEdge (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:639— aggregateVisibleEdges::classBucketForEdge has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
clusterEdges (cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:167— clusterEdges has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 8, if/else 1. Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 170). 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.
draw (cognitive 18) elixir/web-ng/assets/js/hooks/charts/FlowSparkline.js:26— draw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 2, error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ControllerProvenance.label_summary (cognitive 17) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:907— ControllerProvenance.label_summary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 5, match/switch 3 (4 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.
Lifecycle.consume_by_state (cognitive 17) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:518— Lifecycle.consume_by_state has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
SshCaBundleResponse.retirement_proof (cognitive 17) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:332— SshCaBundleResponse.retirement_proof has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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.
ProxmoxConsoleSessions.reauthorize_session (cognitive 17) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:471— ProxmoxConsoleSessions.reauthorize_session has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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.
AnomalyEpisodeRegistry.transition_row (cognitive 17) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:315— AnomalyEpisodeRegistry.transition_row has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, 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.
Ubuntu.prepare_products (cognitive 17) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:301— Ubuntu.prepare_products has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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.
NetboxImportWorker.paginate (cognitive 17) elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:279— NetboxImportWorker.paginate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 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.
SPIFFE.parse_spiffe_id (cognitive 17) elixir/serviceradar_core/lib/serviceradar/spiffe.ex:146— SPIFFE.parse_spiffe_id has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (8 pts) (nesting depth added 9). 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.
Show.handle_event (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:542— Show.handle_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 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.
Overlays.load_stacked100_composition_overlays (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:156— Overlays.load_stacked100_composition_overlays has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sankey.srql_sankey_edge_from_row (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/sankey.ex:55— Sankey.srql_sankey_edge_from_row has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 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.
Config.applyDefaults (cognitive 17) go/cmd/wasm-plugins/alienvault-otx/main.go:775— Config.applyDefaults has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
main.validateQueryParameters (cognitive 17) go/cmd/wasm-plugins/opentext-nom/config.go:389— main.validateQueryParameters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), 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.
main.mergeProxmoxConsoleTargetRef (cognitive 17) REDACTED:529— main.mergeProxmoxConsoleTargetRef has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4 (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.
main.proxmoxGuestLegacyIDs (cognitive 17) go/cmd/wasm-plugins/proxmox/identity.go:197— main.proxmoxGuestLegacyIDs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (6 pts), 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.
main.resolveProtectStreamSourceURL (cognitive 17) go/cmd/wasm-plugins/unifi-protect/protect_streams.go:10— main.resolveProtectStreamSourceURL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.loadFakerConfig (cognitive 17) go/cmd/faker/main.go:1040— main.loadFakerConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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.
main.run (cognitive 17) go/cmd/tools/ubuntu-feed-merge/main.go:1476— main.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, 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.
main.projectRecordWithLimits (cognitive 17) go/cmd/tools/ubuntu-feed-merge/projector.go:543— main.projectRecordWithLimits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 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.
agent.stageAddonArtifactWithClient (cognitive 17) go/pkg/agent/addon_activation.go:181— agent.stageAddonArtifactWithClient has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 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.
agent.buildMapperResultsPayload (cognitive 17) go/pkg/agent/mapper_service.go:595— agent.buildMapperResultsPayload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.validatePluginHostAuthorityTargetIDs (cognitive 17) go/pkg/agent/plugin_runtime_host_authority.go:341— agent.validatePluginHostAuthorityTargetIDs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 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.
agent.proxmoxConsoleSSHCredentialFromMaterial (cognitive 17) go/pkg/agent/plugin_runtime_host_authority.go:2101— agent.proxmoxConsoleSSHCredentialFromMaterial has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginManager.refreshPluginHostAuthorities (cognitive 17) go/pkg/agent/plugin_runtime_manager.go:261— PluginManager.refreshPluginHostAuthorities has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5, boolean chains 3 (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.
PluginManager.ProxmoxAssignmentPolicyAcks (cognitive 17) go/pkg/agent/plugin_runtime_manager.go:830— PluginManager.ProxmoxAssignmentPolicyAcks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, boolean chains 2 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pluginExecution.trustedProxmoxConsoleSSHConfig (cognitive 17) go/pkg/agent/plugin_runtime_host_authority.go:2008— pluginExecution.trustedProxmoxConsoleSSHConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, 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.
pluginExecution.writePluginHTTPResponse (cognitive 17) REDACTED:261— pluginExecution.writePluginHTTPResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 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.
PushLoop.configApplyFailureStatuses (cognitive 17) go/pkg/agent/config_section_state.go:302— PushLoop.configApplyFailureStatuses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4, 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.
PushLoop.handleControlStream (cognitive 17) go/pkg/agent/control_stream.go:392— PushLoop.handleControlStream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), 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.
PushLoop.recordEndpointInventoryUploadSuccesses (cognitive 17) go/pkg/agent/endpoint_inventory_upload_ack.go:39— PushLoop.recordEndpointInventoryUploadSuccesses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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.
PushLoop.applyVisibilityConfig (cognitive 17) go/pkg/agent/push_loop_config.go:729— PushLoop.applyVisibilityConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 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.
remoteaccess.validateDesktopTarget (cognitive 17) go/pkg/agent/remoteaccess/desktop_target.go:166— remoteaccess.validateDesktopTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 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.
SyncRuntime.ApplyConfig (cognitive 17) go/pkg/agent/sync_runtime.go:96— SyncRuntime.ApplyConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), 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.
SysmonService.ApplyRemoteConfig (cognitive 17) REDACTED:572— SysmonService.ApplyRemoteConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.
Runner.Run (cognitive 17) go/pkg/bumblebee/runner.go:57— Runner.Run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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.
cli.parseEdgePackageCreateFlags (cognitive 17) go/pkg/cli/cli.go:633— cli.parseEdgePackageCreateFlags 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.
cli.RunEdgePackageShow (cognitive 17) go/pkg/cli/edge_onboarding.go:392— cli.RunEdgePackageShow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 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.
cli.RunGenerateJWTKeys (cognitive 17) go/pkg/cli/jwt_keys.go:38— cli.RunGenerateJWTKeys 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.
db.NewCNPGPool (cognitive 17) go/pkg/db/cnpg_pool.go:152— db.NewCNPGPool has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
endpointinventory.ApplyRuntimeProfile (cognitive 17) go/pkg/endpointinventory/config.go:226— endpointinventory.ApplyRuntimeProfile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
NATSPublisher.ensureStream (cognitive 17) go/pkg/k8sinventory/publisher.go:240— NATSPublisher.ensureStream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, 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.
DiscoveryEngine.knownDeviceNeighborByMAC (cognitive 17) go/pkg/mapper/snmp_l2_bridge.go:421— DiscoveryEngine.knownDeviceNeighborByMAC 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). 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.
DiscoveryEngine.handleInterfaceDiscoverySNMP (cognitive 17) go/pkg/mapper/snmp_polling_handlers.go:24— DiscoveryEngine.handleInterfaceDiscoverySNMP has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 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.
models.FilterIPsWithBlacklist (cognitive 17) go/pkg/models/sync.go:57— models.FilterIPsWithBlacklist has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (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.
Tracer.resolveHopHostnames (cognitive 17) go/pkg/mtr/tracer.go:657— Tracer.resolveHopHostnames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SYNScanner.startReaper (cognitive 17) go/pkg/scan/syn_scanner_mappings.go:111— SYNScanner.startReaper has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). 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 literal inside it that branches (line 138). 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.
SYNScanner.processTCPFinalResult (cognitive 17) go/pkg/scan/syn_scanner_reply_results.go:32— SYNScanner.processTCPFinalResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, loops 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.
Coordinator.recoverRoomCaptureSession (cognitive 17) swift/FieldSurvey/FieldSurvey/Views/CompositeSurveyView.swift:560— Coordinator.recoverRoomCaptureSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 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.
SurveyView.uploadRoomArtifact (cognitive 17) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:716— SurveyView.uploadRoomArtifact has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowCImporter.importArray (cognitive 17) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowCImporter.swift:101— ArrowCImporter.importArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 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.
ArrowReader.readFile (cognitive 17) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:331— ArrowReader.readFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (6 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.
SeriesState::step (cognitive 17) rust/anomaly-core/src/scorecard.rs:145— SeriesState::step has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 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.
serviceradar_rperf_checker::rperf::parse_rperf_output (cognitive 17) rust/rperf-client/src/rperf.rs:47— serviceradar_rperf_checker::rperf::parse_rperf_output has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 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.
rendering_scene_view.completeSceneBounds (cognitive 17) elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:115— rendering_scene_view.completeSceneBounds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 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.
PacketFlowLayer.getBounds (cognitive 17) elixir/web-ng/assets/js/lib/deckgl/PacketFlowLayer.js:142— PacketFlowLayer.getBounds has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), loops 1 (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.
rendering_graph_view_methods.managedClusterGroup (cognitive 17) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:898— rendering_graph_view_methods.managedClusterGroup has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), loops 1 (nesting depth added 3). 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.
security_findings.bindActions (cognitive 17) REDACTED:237— security_findings.bindActions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 239, 246, 254, …). 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.
NetflowGridChart.gridPanelAtPointer (cognitive 17) elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:70— NetflowGridChart.gridPanelAtPointer has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 15, if/else 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.
publish.errorHint (cognitive 17) js/cli/src/dashboard/publish.ts:183— publish.errorHint has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 3 (6 pts), match/switch 1 (nesting depth added 3). 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.
ensure_k8s_alerts.ensureK8sAlertsCommand (cognitive 17) js/cli/src/notifications/ensure_k8s_alerts.ts:29— ensure_k8s_alerts.ensureK8sAlertsCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). 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, 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.
manifest.manifestErrors (cognitive 17) js/cli/src/plugin/manifest.ts:89— manifest.manifestErrors has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
status.statusCommand (cognitive 17) js/cli/src/plugin/status.ts:9— status.statusCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 3 (6 pts), boolean chains 2, 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.
validation.validateSampleSettings (cognitive 17) js/cli/src/validation.ts:255— validation.validateSampleSettings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 2, loops 1 (2 pts), 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.
validateSettings (cognitive 17) js/cli/harness/harness.js:399— validateSettings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updateBrowserModuleHost (cognitive 17) REDACTED:332— updateBrowserModuleHost has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, if/else 3, 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.
deckLayer (cognitive 17) REDACTED:1243— deckLayer has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 5, other 1 (nesting depth added 3). Of this number, 13 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.
clusteredLayerData (cognitive 17) REDACTED:1346— clusteredLayerData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (nesting depth added 3). Of this number, 12 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
connectWebsocket (cognitive 17) elixir/web-ng/assets/js/hooks/CameraRelayStatusStream.js:221— connectWebsocket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 278, 241, 261, …). 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.
managedViewStateForCamera (cognitive 17) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:980— managedViewStateForCamera has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 4, boolean chains 2, other 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.
resizeCanvas (cognitive 17) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:412— resizeCanvas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7 (nesting depth added 1). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: 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.
AwxLaunchPreflightAttestation.verify_binding (cognitive 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:171— AwxLaunchPreflightAttestation.verify_binding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, 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.
AwxMembershipReconciler.upsert_membership (cognitive 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:546— AwxMembershipReconciler.upsert_membership has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. 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.
HardenedLaunchPlan.validate_preflight_attestation (cognitive 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:284— HardenedLaunchPlan.validate_preflight_attestation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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.
SecureExecutionCurrentAuthority.authorize_attempt (cognitive 16) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:49— SecureExecutionCurrentAuthority.authorize_attempt 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.
CurrentAuthority.current_authority (cognitive 16) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:83— CurrentAuthority.current_authority has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, 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.
LaunchEnvelopes.prepare_and_seal (cognitive 16) elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes.ex:39— LaunchEnvelopes.prepare_and_seal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 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.
ProxmoxConsoleSessions.request_open (cognitive 16) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:55— ProxmoxConsoleSessions.request_open has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), 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.
FlowEnrichment.tags_from_active_ti_match (cognitive 16) elixir/serviceradar_core/lib/serviceradar/event_writer/flow_enrichment.ex:432— FlowEnrichment.tags_from_active_ti_match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 2 (5 pts), boolean chains 3 (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.
EndpointVulnerabilityAdjudicator.exact_product? (cognitive 16) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:429— EndpointVulnerabilityAdjudicator.exact_product? has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3, 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.
HypervisorEnrichmentIngestor.validate_trusted_proxmox_source_binding (cognitive 16) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:379— HypervisorEnrichmentIngestor.validate_trusted_proxmox_source_binding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
ZenRuleSync.sync_rule_impl (cognitive 16) elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_sync.ex:303— ZenRuleSync.sync_rule_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 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.
MediaFrameEnvelope.frame_fields (cognitive 16) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/media_frame_envelope.ex:53— MediaFrameEnvelope.frame_fields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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.
ReleaseSourceImporter.import (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:62— ReleaseSourceImporter.import has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, 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.
CollectorController.index (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:32— CollectorController.index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 4 (7 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. This shape REPEATS in the file: one other method here (CollectorController.credentials) 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.
CollectorController.credentials (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:278— CollectorController.credentials has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 4 (7 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. This shape REPEATS in the file: one other method here (CollectorController.index) 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.
RemoteAccessDesktopTargetsLive.target_params (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:1026— RemoteAccessDesktopTargetsLive.target_params has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 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.
Show.assign_header (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:614— Show.assign_header has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, 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.
validate-external-wasm-plugin-bundle.validate_metadata (cognitive 16) scripts/validate-external-wasm-plugin-bundle.py:116— validate-external-wasm-plugin-bundle.validate_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 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.
plot.main (cognitive 16) tools/anomaly-proof/plot.py:147— plot.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 4 (6 pts), ternaries 1 (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.
device_fact_writer.main (cognitive 16) tools/device_fact_writer.py:165— device_fact_writer.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), error handling 3 (5 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
otxJSONScanner.nextObjectBytes (cognitive 16) go/cmd/wasm-plugins/alienvault-otx/main.go:1444— otxJSONScanner.nextObjectBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (5 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.
main.projectAWXJobEvent (cognitive 16) go/cmd/wasm-plugins/awx/main.go:1968— main.projectAWXJobEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 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.
axisref.ParseStreamProfiles (cognitive 16) go/cmd/wasm-plugins/axis/internal/axisref/vapix_parsers.go:48— axisref.ParseStreamProfiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3, match/switch 1 (2 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.
main.enrichNodes (cognitive 16) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:119— main.enrichNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 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.
main.countResourceBottlenecks (cognitive 16) go/cmd/wasm-plugins/proxmox/summaries.go:265— main.countResourceBottlenecks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), boolean chains 3 (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.
main.ensureRelease (cognitive 16) build/release/publish_packages.go:608— main.ensureRelease has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (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.
main.canonicalizeValue (cognitive 16) build/wasm_plugins/upload_signature_tool.go:314— main.canonicalizeValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), 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.
main.shuffleIPs (cognitive 16) go/cmd/faker/main.go:645— main.shuffleIPs 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.
projectionBuilder.addSet (cognitive 16) go/cmd/tools/ubuntu-feed-merge/projector.go:1424— projectionBuilder.addSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (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.
structuralPreflight.scanVEXDocument (cognitive 16) go/cmd/tools/ubuntu-feed-merge/structure.go:596— structuralPreflight.scanVEXDocument has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (2 pts), boolean chains 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.
grpcServer.StreamMetricFeed (cognitive 16) go/pkg/addon/grpc.go:224— grpcServer.StreamMetricFeed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 7). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.newRTSPCameraRelayStream (cognitive 16) REDACTED:80— agent.newRTSPCameraRelayStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 1). Of this number, 8 points are the body's own statements and 8 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.
agent.pluginHTTPClientWithTrustedCAs (cognitive 16) go/pkg/agent/plugin_http_trust.go:41— agent.pluginHTTPClientWithTrustedCAs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, 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.
agent.pluginActionGrantForHTTPRequestIntent (cognitive 16) go/pkg/agent/plugin_runtime_actions.go:204— agent.pluginActionGrantForHTTPRequestIntent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 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.
agent.canonicalAWXControllerOrigin (cognitive 16) go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:324— agent.canonicalAWXControllerOrigin has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 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.
agent.validatePluginHostAuthorityGrant (cognitive 16) go/pkg/agent/plugin_runtime_host_authority.go:305— agent.validatePluginHostAuthorityGrant has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, 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.
agent.newConsoleSpecAuthorityState (cognitive 16) go/pkg/agent/plugin_runtime_host_authority.go:1513— agent.newConsoleSpecAuthorityState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (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.
agent.credentialBrokerTokenForm (cognitive 16) go/pkg/agent/plugin_runtime_oauth.go:178— agent.credentialBrokerTokenForm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, 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.
agent.localSourceIPs (cognitive 16) go/pkg/agent/push_loop.go:623— agent.localSourceIPs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), match/switch 1 (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.
MultiSweepService.GetSweepResults (cognitive 16) go/pkg/agent/multi_sweep_service.go:341— MultiSweepService.GetSweepResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3, 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.
PushLoop.applySweepConfig (cognitive 16) go/pkg/agent/push_loop_config.go:922— PushLoop.applySweepConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 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.
PushLoop.pushSysmonStatus (cognitive 16) go/pkg/agent/push_loop_status.go:132— PushLoop.pushSysmonStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 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.
remoteaccess.validateSSHOpenPayloadScope (cognitive 16) go/pkg/agent/remoteaccess/ssh_open.go:113— remoteaccess.validateSSHOpenPayloadScope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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.
TCPAdapter.Read (cognitive 16) go/pkg/agent/remoteaccess/tcp_adapter.go:138— TCPAdapter.Read 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.
Server.runAddonOtlpRelay (cognitive 16) go/pkg/agent/addon_otlp_relay.go:217— Server.runAddonOtlpRelay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 1, 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.
cli.runDeviceCodeFlowWithClock (cognitive 16) go/pkg/cli/auth.go:404— cli.runDeviceCodeFlowWithClock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 1 (2 pts), boolean chains 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.
Client.watchStream (cognitive 16) go/pkg/config/kvgrpc/client.go:81— Client.watchStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), 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.
Client.Watch (cognitive 16) go/pkg/config/kvnats/client.go:82— Client.Watch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 89). 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.
NATSStore.ensureDomainLocked (cognitive 16) go/pkg/datasvc/nats.go:875— NATSStore.ensureDomainLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
edgeonboarding.extractBundle (cognitive 16) REDACTED:223— edgeonboarding.extractBundle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, match/switch 1 (2 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.
edgeonboarding.chownAgentAssets (cognitive 16) REDACTED:687— edgeonboarding.chownAgentAssets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
Bootstrapper.generateGatewayConfig (cognitive 16) go/pkg/edgeonboarding/config.go:106— Bootstrapper.generateGatewayConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, 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.
Runner.Run (cognitive 16) go/pkg/endpointinventory/collect.go:77— Runner.Run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, 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.
grpc.NewSpiffeProvider (cognitive 16) go/pkg/grpc/security.go:325— grpc.NewSpiffeProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
k8sinventory.SnapshotFromLister (cognitive 16) go/pkg/k8sinventory/snapshot.go:165— k8sinventory.SnapshotFromLister 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.
mapper.mergeInterface (cognitive 16) go/pkg/mapper/interface_dedup.go:144— mapper.mergeInterface has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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.
DiscoveryEngine.processDevicesForSNMPTargets (cognitive 16) go/pkg/mapper/discovery_recursive.go:217— DiscoveryEngine.processDevicesForSNMPTargets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 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.
DiscoveryEngine.getInt32FromPDU (cognitive 16) go/pkg/mapper/snmp_interface_pdu.go:53— DiscoveryEngine.getInt32FromPDU has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, 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.
DiscoveryEngine.processWiredClientAssociations (cognitive 16) go/pkg/mapper/ubnt_topology.go:216— DiscoveryEngine.processWiredClientAssociations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
EventPublisher.ensureStream (cognitive 16) go/pkg/natsutil/events.go:372— EventPublisher.ensureStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, match/switch 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.
scalibrinventory.sourceDiagnostics (cognitive 16) go/pkg/scalibrinventory/adapter.go:508— scalibrinventory.sourceDiagnostics has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 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.
scalibrinventory.scalibrExtractors (cognitive 16) go/pkg/scalibrinventory/adapter.go:604— scalibrinventory.scalibrExtractors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (5 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.
configurationResource.Update (cognitive 16) go/pkg/terraformprovider/resource.go:172— configurationResource.Update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 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.
trivysidecar.LoadConfigFromEnv (cognitive 16) go/pkg/trivysidecar/config.go:58— trivysidecar.LoadConfigFromEnv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 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.
serviceradar_anomaly_disposition::disposition::peak_profile::evaluate_peak_profile (cognitive 16) rust/anomaly-disposition/src/disposition/peak_profile/mod.rs:88— serviceradar_anomaly_disposition::disposition::peak_profile::evaluate_peak_profile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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.
serviceradar_powerdns_addon::handle_connection (cognitive 16) rust/powerdns/src/lib.rs:278— serviceradar_powerdns_addon::handle_connection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (6 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.
renderer_state.createDirtyTileMask (cognitive 16) elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js:138— renderer_state.createDirtyTileMask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 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.
tokenizer.parseSegment (cognitive 16) elixir/web-ng/assets/js/lib/srql/tokenizer.js:111— tokenizer.parseSegment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 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.
god_view_acceptance_geometry_observer.renderedPhysicalRouteRecords (cognitive 16) elixir/web-ng/assets/god_view_acceptance_geometry_observer.js:94— god_view_acceptance_geometry_observer.renderedPhysicalRouteRecords has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), boolean chains 4, if/else 1 (3 pts), 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.
layout_elk_scene.decodedManifolds (cognitive 16) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:533— layout_elk_scene.decodedManifolds has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, ternaries 6. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 538, 580). 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.
topology_overview_projection.summaryRelations (cognitive 16) elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:449— topology_overview_projection.summaryRelations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 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.
layout_topology_state_methods.mergeGraphNodes (cognitive 16) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:57— layout_topology_state_methods.mergeGraphNodes has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (7 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.
rendering_graph_view_methods.routeSegmentsOutsideDeclaredJunctionApproaches (cognitive 16) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:431— rendering_graph_view_methods.routeSegmentsOutsideDeclaredJunctionApproaches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rendering_graph_view_methods.selectManagedDensityForScale (cognitive 16) elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:682— rendering_graph_view_methods.selectManagedDensityForScale has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), loops 1, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
attachTimeTooltip (cognitive 16) elixir/web-ng/assets/js/netflow_charts/util.js:110— attachTimeTooltip has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, other 3. Of this number, 12 points are the body's own statements and 4 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.
mounted::initDeck (cognitive 16) elixir/web-ng/assets/js/hooks/SpatialSurveyMap.js:55— mounted::initDeck has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 4, if/else 3 (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.
parseProps (cognitive 16) elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:9— parseProps has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), error handling 1, loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
navigationPath (cognitive 16) REDACTED:766— navigationPath has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 4, if/else 4 (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.
_draw (cognitive 16) elixir/web-ng/assets/js/hooks/charts/NetflowLineSeriesChart.js:45— _draw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, error handling 1. Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 19 function items inside it that branch (strokeForKey, dashForKey, opacityForKey, …). 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.
D22 · Internal API Consistency· Duplicate intent · ×1
Duplicate intent: Two distinct types (ArrowArrayHolderImpl and ImportArrayHolder) expose identical methods with identical signatures for constructing an ArrowColumn. These types appear to serve similar wrapper roles for Arrow data (one likely for internal implementation, one for C-Data import), yet they duplicate the public API surface for column construction. — Extract the getArrowColumn logic into a protocol or a static utility function on ArrowColumn to avoid duplicating the method across multiple holder types. (signatures: ArrowArrayHolderImpl.getArrowColumn(ArrowField, [ArrowArrayHolder]) throws -> ArrowColumn | ImportArrayHolder.getArrowColumn(ArrowField, [ArrowArrayHolder]) throws -> ArrowColumn)
D22 · Internal API Consistency· Inconsistent naming for string conversion · ×1
Inconsistent naming for string conversion: While most arrays use asString, the presence of TimestampArray.formattedDate suggests a split in string representation strategies. More importantly, asString is used for both binary data (BinaryArray) and logical types (TimestampArray, NestedArray), which can be ambiguous. However, the primary inconsistency is that ChunkedArray also has asString, but it operates on a collection of arrays. If the intent is 'convert this specific element to string', the naming is consistent, but the semantic meaning of 'asString' varies wildly between Binary (hex/utf8?) and Timestamp (formatted date?). — Rename BinaryArray.asString to asStringOrHex (or similar) to distinguish it from logical type string representations, or provide a unified formatting protocol. (signatures: ArrowArray.asString(UInt): String | TimestampArray.asString(UInt): String | BinaryArray.asString(UInt): String | NestedArray.asString(UInt): String | ChunkedArray.asString(UInt): String)
D4 · Code Duplication· Near-duplicate member family (5 members, 19 shared lines) · ×1
Near-duplicate member family (5 members, 19 shared lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:65— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:65-104 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:109-148 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:83-129 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:134-180 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:185-229 — These 5 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 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 5 times.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:212— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:212-248 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:258-286 — 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 copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:33— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:33-70 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:279-316 — 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 copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/storage_token.ex:48— elixir/serviceradar_core/lib/serviceradar/plugins/storage_token.ex:48-58 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:108-118 — 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 (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/layout_helpers.ex:20— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/layout_helpers.ex:20-27 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/layout_helpers.ex:31-38 — 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· Members sharing a duplicated core (18 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (18 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:83— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:83-90 | elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:428-435 | elixir/serviceradar_core/lib/serviceradar/inventory/device_cleanup_worker.ex:94-103 | elixir/serviceradar_core/lib/serviceradar/inventory/device_identifier_gc_worker.ex:208-215 | elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_assessment_worker.ex:47-54 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_match_worker.ex:42-49 | elixir/serviceradar_core/lib/serviceradar/jobs/schedule_health_worker.ex:124-131 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:247-254 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_cleanup_worker.ex:47-54 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:117-124 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:54-61 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:57-64 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:48-55 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:50-57 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:73-80 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex:58-65 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_feed_refresh_worker.ex:51-58 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_data_cleanup_worker.ex:100-107 — These 18 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 18 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 18 times.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:63— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:63-90 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:267-297 | elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:31-58 | elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:36-63 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:240-275 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:1471-1515 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_event_writer.ex:74-106 | elixir/serviceradar_core/lib/serviceradar/observability/oban_failure_event_reporter.ex:106-150 | elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex:79-116 — These 9 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 9 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 9 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:441— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:441-448 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:602-609 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:205-212 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:286-293 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:173-178 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:33-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:1504-1509 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:165-172 — These 8 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 8 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 8 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:117— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:117-126 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:136-145 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:310-319 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1254-1263 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:207-216 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:30-39 — These 6 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 6 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 6 times.
Duplicated block (38–52 lines × 4) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:207— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:207-253 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:276-313 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:315-366 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:712-749 — 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.
Duplicated block (41 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:198— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:198-238 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:290-330 — 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 (38–41 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9133— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9133-9173 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9612-9649 — 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 (27–36 lines × 4) elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:30— elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:30-56 | elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:84-112 | elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:209-244 | elixir/serviceradar_core/lib/serviceradar/bgp/stats.ex:409-438 — 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.
Duplicated block (34 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data.ex:150— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data.ex:150-183 | elixir/web-ng/lib/serviceradar_web_ng_web/netflow_visualize/query.ex:197-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.
Duplicated block (31 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:98— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:98-128 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:149-179 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:198-228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (29 lines × 7) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:147— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:147-175 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:404-432 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:440-468 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:547-575 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:583-611 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:619-647 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:683-711 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–28 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/native_descriptors.ex:102— elixir/serviceradar_core/lib/serviceradar/credentials/native_descriptors.ex:102-129 | elixir/serviceradar_core/lib/serviceradar/credentials/native_descriptors.ex:132-146 — 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 (28 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:35— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:35-62 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:157-184 — 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 (26 lines × 5) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:164— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:164-189 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:221-246 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:264-289 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:336-361 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:700-725 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21–25 lines × 8) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:133— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:133-153 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:186-210 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:390-410 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:433-453 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:540-560 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:576-596 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:612-632 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:676-696 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25 lines × 5) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:382— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:382-406 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:414-438 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:488-512 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:541-565 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:581-605 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25 lines × 3) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex:42— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex:42-66 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex:73-97 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex:104-128 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–25 lines × 2) elixir/serviceradar_core/lib/serviceradar/agent_commands/status_handler.ex:549— elixir/serviceradar_core/lib/serviceradar/agent_commands/status_handler.ex:549-573 | elixir/serviceradar_core/lib/serviceradar/agent_commands/status_handler.ex:588-596 — 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–25 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/stale_agent_devices.ex:174— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/stale_agent_devices.ex:174-198 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/test_debris.ex:225-246 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/stale_agent_devices.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/test_debris.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 (25 lines × 2) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1988— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1988-2012 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2914-2938 — 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 (19–25 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:556— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:556-580 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:685-703 — 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 (24 lines × 5) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:179— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:179-202 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:191-214 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:233-256 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:240-263 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:188-211 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 (24 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:64— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:64-87 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:70-93 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:297-320 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 (23 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:554— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:554-576 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:445-467 | elixir/web-ng/lib/serviceradar_web_ng_web/live/metric_live/show.ex:372-394 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17–23 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:88— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:88-104 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:99-121 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 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 (22 lines × 5) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:418— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:418-439 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:454-475 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:490-511 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:561-582 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:597-618 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:108— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:108-129 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:119-140 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:419-440 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex` and `elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 (21 lines × 9) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:157— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:157-177 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:257-277 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:414-434 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:450-470 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:486-506 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:557-577 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:593-613 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:629-649 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:693-713 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18–21 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/components/plugin_results.ex:193— elixir/web-ng/lib/serviceradar_web_ng_web/components/plugin_results.ex:193-213 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/index/card_grid.ex:123-140 — 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 (20 lines × 8) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:127— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:127-146 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:384-403 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:427-446 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:463-482 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:534-553 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:570-589 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:606-625 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:670-689 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 7) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:300— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:300-319 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:421-440 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:457-476 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:493-512 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:564-583 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:600-619 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:736-755 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19 lines × 10) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:126— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:126-144 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:383-401 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:426-444 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:462-480 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:498-516 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:533-551 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:569-587 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:605-623 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:669-687 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:741-759 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19 lines × 9) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:130— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:130-148 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:187-205 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:387-405 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:430-448 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:466-484 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:537-555 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:573-591 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:609-627 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:673-691 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19 lines × 6) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:173— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:173-191 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:230-248 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:273-291 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:316-334 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:345-363 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:709-727 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–19 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:299— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:299-312 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:448-466 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:552-565 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:90-103 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 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 (17–19 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:628— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:628-646 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:378-394 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:888-904 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (16–19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:214— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:214-232 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:470-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.
Duplicated block (10–19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:105— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:105-123 | elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:96-105 — `elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18–19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:804— elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex:804-822 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:938-955 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/infrastructure_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 136 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 (18 lines × 11) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:124— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:124-141 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:303-320 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:381-398 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:424-441 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:460-477 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:496-513 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:531-548 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:567-584 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:603-620 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:667-684 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:739-756 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–18 lines × 2) elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:127— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:127-144 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention.ex:90-100 — 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 (15–18 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:389— elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:389-403 | elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:407-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.
Duplicated block (13–17 lines × 4) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:45— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:45-57 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:47-63 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:48-64 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:41-53 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (10–17 lines × 3) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:457— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:457-466 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:621-632 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:759-775 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–17 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:97— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:97-108 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:268-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:71— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:71-86 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:77-92 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:304-319 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:363-378 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 (15–16 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:369— elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:369-384 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1151-1165 — 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 (14–16 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/field_survey_stream_controller.ex:103— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/field_survey_stream_controller.ex:103-118 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/field_survey_stream_controller.ex:152-165 — 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 (13–16 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:546— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:546-561 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:589-601 — 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 (15 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:413— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:413-427 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:258-272 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:137-151 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 (11–14 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:30— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:30-43 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:93-103 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:137-147 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:179-189 — 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.
Duplicated block (11–14 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:34— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:34-44 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:223-236 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:315-328 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 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 (12–14 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:192— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:192-205 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:212-223 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 155 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 (13–14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:75— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:75-87 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:128-141 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:639— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:639-652 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:742-748 — 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 (13 lines × 4) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:166— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:166-178 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:291-303 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:151-163 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:109-121 — before extracting anything, compare `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 (9–12 lines × 7) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:33— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:33-44 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:96-104 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:140-148 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:182-190 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:118-129 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:169-180 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:218-229 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–12 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1636— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1636-1643 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:24-34 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:29-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1021-1032 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (11–12 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2126— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2126-2136 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2504-2514 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1505-1516 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (8–12 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:91— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:91-102 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:106-113 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:402-413 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex` and `elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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–12 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:214— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:214-225 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1216-1227 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:171-177 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 137 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–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:407— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:407-413 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:430-441 — 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 (11 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:57— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:57-67 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:100-110 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:151-161 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:200-210 — 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.
Duplicated block (6–11 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:759— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:759-764 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1146-1156 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1127-1132 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 141 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 (9–11 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex:171— elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex:171-179 | elixir/serviceradar_core/lib/serviceradar/plugins/secret_refs.ex:732-742 | elixir/web-ng/lib/serviceradar_web_ng/edge/crypto.ex:128-136 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex` and `elixir/web-ng/lib/serviceradar_web_ng/edge/crypto.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (8–11 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:455— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:455-465 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:852-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:351— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:351-359 | elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:372-382 — 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–10 lines × 4) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:62— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:62-68 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:68-77 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:69-78 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:58-64 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (1–10 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1655— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1655-1661 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:60-69 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:52-61 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1046-1055 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:78-78 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (6–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:777— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:777-786 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:849-854 — 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–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_plugin_id.ex:36— elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_plugin_id.ex:36-42 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_assignment.ex:68-77 — 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–10 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:48— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:48-55 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:198-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 7) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:90— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:90-98 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_stream_controller.ex:42-50 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:83-91 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:127-135 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:169-177 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:112-120 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:410-418 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 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 (9 lines × 5) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:154— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:154-162 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:166-174 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:208-216 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:215-223 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:163-171 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 (8 lines × 18) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:83— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:83-90 | elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:428-435 | elixir/serviceradar_core/lib/serviceradar/inventory/device_cleanup_worker.ex:96-103 | elixir/serviceradar_core/lib/serviceradar/inventory/device_identifier_gc_worker.ex:208-215 | elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_assessment_worker.ex:47-54 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_match_worker.ex:42-49 | elixir/serviceradar_core/lib/serviceradar/jobs/schedule_health_worker.ex:124-131 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:247-254 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_cleanup_worker.ex:47-54 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:117-124 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:54-61 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:57-64 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:48-55 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:50-57 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:73-80 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex:58-65 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_feed_refresh_worker.ex:51-58 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_data_cleanup_worker.ex:100-107 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (8 lines × 10) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:100— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:100-107 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:58-65 | elixir/serviceradar_core/lib/serviceradar/identity/cli_auth_cleanup_worker.ex:89-96 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:92-99 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:42-49 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_worker.ex:55-62 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_legacy_assignment_recovery_worker.ex:97-104 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_dispatch_worker.ex:72-79 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:38-45 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_monitor_worker.ex:79-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 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 10 times.
Duplicated block (8 lines × 5) elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:42— elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:42-49 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:247-254 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:1498-1505 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_event_writer.ex:81-88 | elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex:99-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times.
Duplicated block (7 lines × 6) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:441— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:441-447 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:602-608 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:205-211 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:286-292 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:33-39 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:165-171 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 (6–7 lines × 4) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:456— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:456-462 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:522-527 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:927-933 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:993-998 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (3–7 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:226— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:226-228 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:307-313 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/sweep.ex:325-331 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/srql.ex:51— elixir/web-ng/lib/serviceradar_web_ng/srql.ex:51-57 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:108-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.
Duplicated block (6 lines × 19) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/plugin_metrics_publisher.ex:64— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/plugin_metrics_publisher.ex:64-69 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:644-649 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority_ash_source.ex:69-74 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:140-145 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:175-180 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:26-31 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:220-225 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1497-1502 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_ssh_certificate_policy.ex:210-215 | elixir/serviceradar_core/lib/serviceradar/notifications/renderer.ex:418-423 | elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:659-664 | elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:114-119 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:655-660 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:38-43 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:153-158 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:110-115 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/system_reports.ex:203-208 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:536-541 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/predicate.ex:164-169 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 × 14) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:141— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:141-146 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:176-181 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:27-32 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1498-1503 | elixir/serviceradar_core/lib/serviceradar/notifications/renderer.ex:419-424 | elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:660-665 | elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:258-263 | elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:115-120 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:39-44 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:154-159 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:111-116 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/system_reports.ex:204-209 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:537-542 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/predicate.ex:165-170 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 64 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 × 8) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:443— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:443-448 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:604-609 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:207-212 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:288-293 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:173-178 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:35-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:1504-1509 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:167-172 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 (6 lines × 6) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120-125 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:139-144 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:313-318 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1257-1262 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:210-215 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:33-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
Duplicated block (3–6 lines × 4) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:472— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:472-474 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:547-552 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:943-945 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1018-1023 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 98 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 (5 lines × 10) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:370— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:370-374 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:488-492 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:536-540 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:183-187 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1068-1072 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1102-1106 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1119-1123 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1200-1204 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1412-1416 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:2019-2023 — there are 10 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 10 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (4–5 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1651— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1651-1654 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:54-59 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:46-51 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1040-1045 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:71-75 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (5 lines × 7) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery_worker.ex:14— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery_worker.ex:14-18 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/lifecycle_seed_worker.ex:17-21 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery_worker.ex:14-18 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:23-27 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:28-32 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_dispatch_worker.ex:28-32 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:24-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
Duplicated block (5 lines × 12) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:71— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:71-75 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:78-82 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_cleanup_worker.ex:35-39 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:42-46 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:45-49 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:36-40 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:38-42 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:44-48 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex:46-50 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_feed_refresh_worker.ex:39-43 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_data_cleanup_worker.ex:88-92 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_monitor_worker.ex:65-69 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (5 lines × 6) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:254— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:254-258 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:128-132 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:157-161 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:794-798 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:171-175 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:323-327 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 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 × 9) elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/components.ex:327— elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/components.ex:327-341 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_components/formatters.ex:111-116 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/interface_components.ex:788-793 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ocsf_components.ex:496-501 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:229-234 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/virtualization_components.ex:498-503 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2005-2010 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7203-7208 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7608-7613 — there are 9 copies across 8 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 7) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:111— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:111-120 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:69-78 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:155-164 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_worker.ex:66-75 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_legacy_assignment_recovery_worker.ex:73-82 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_dispatch_worker.ex:83-92 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:88-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
Duplicated block (8 lines × 6) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:538— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:538-545 | elixir/web-ng/lib/serviceradar_web_ng_web/live/analytics_live/index.ex:1905-1912 | elixir/web-ng/lib/serviceradar_web_ng_web/live/analytics_live/index.ex:1917-1924 | elixir/web-ng/lib/serviceradar_web_ng_web/live/analytics_live/index.ex:1929-1936 | elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_relay_live/index.ex:982-989 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex:1930-1937 — there are 6 copies across 4 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 6 sites; resolving a subset leaves the remainder to drift apart.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — elixir/web-ng/assets/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
Duplication concentrated across 6 sibling directories (14 clone groups) REDACTED:820— 14 duplicated blocks under elixir/web-ng/assets/js/ have copies in at least two of the sibling directories dashboards, hooks, lib, netflow_charts, utils, wasm — 9 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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.
Duplication concentrated across 4 sibling directories (7 clone groups) js/cli/src/dashboard/init.ts:16— 7 duplicated blocks under js/cli/src/ have copies in at least two of the sibling directories auth, dashboard, notifications, plugin — 4 of them are reported below, and 3 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 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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 (110 matched lines × 2 locations) · ×1
Duplicated block with local edits (110 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/TimeseriesChart.js:9— elixir/web-ng/assets/js/hooks/charts/TimeseriesChart.js:9 · elixir/web-ng/assets/js/hooks/charts/TimeseriesCombinedChart.js:11 — the two spans are one implementation copied and then locally edited — 876 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 (69 matched lines × 2 locations) · ×1
Duplicated block with local edits (69 matched lines × 2 locations) elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:167— elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:167 · elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:124 — the two spans are one implementation copied and then locally edited — 391 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 (57 matched lines × 2 locations) · ×1
Duplicated block with local edits (57 matched lines × 2 locations) js/cli/src/dashboard/init.ts:16— js/cli/src/dashboard/init.ts:16 · js/cli/src/plugin/init.ts:16 — the two spans are one implementation copied and then locally edited — 444 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (55 lines × 2 locations) elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:99— elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:99 · elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:61 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:213— elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:213 · elixir/web-ng/assets/js/dashboards/service_availability_noc.js:179 — the two spans are one implementation copied and then locally edited — 297 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 (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:121— elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:121 · elixir/web-ng/assets/js/hooks/charts/NetflowLineSeriesChart.js:24 — the two spans are one implementation copied and then locally edited — 399 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (39 lines × 2 locations) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:85— elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:85 · elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:3 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (29 lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:128— elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:128 · elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:370 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (28 matched lines × 2 locations) · ×1
Duplicated block with local edits (28 matched lines × 2 locations) elixir/web-ng/assets/js/lib/camera_relay/player.js:277— elixir/web-ng/assets/js/lib/camera_relay/player.js:277 · elixir/web-ng/assets/js/lib/camera_relay/player.js:403 — the two spans are one implementation copied and then locally edited — 191 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (27 matched lines × 2 locations) · ×1
Duplicated block with local edits (27 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:129— elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:129 · elixir/web-ng/assets/js/hooks/charts/FlowSparkline.js:15 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (26 lines × 2 locations) elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:8— elixir/web-ng/assets/js/hooks/RemoteAccessTerminal.js:8 · elixir/web-ng/assets/js/hooks/RemoteConsoleTerminal.js:8 — 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 (25 lines × 2 locations) elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:10— elixir/web-ng/assets/js/dashboards/endpoint_inventory.js:10 · REDACTED:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (24 matched lines × 2 locations) · ×1
Duplicated block with local edits (24 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:6— elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:6 · elixir/web-ng/assets/js/hooks/charts/NetflowTalkersIcicle.js:104 — the two spans are one implementation copied and then locally edited — 148 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 (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/BGPTimeSeriesChart.js:159— elixir/web-ng/assets/js/hooks/charts/BGPTimeSeriesChart.js:159 · elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:236 — the two spans are one implementation copied and then locally edited — 130 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (22 lines × 2 locations) elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:6— elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:6 · elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:6 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (22 matched lines × 2 locations) · ×1
Duplicated block with local edits (22 matched lines × 2 locations) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:82— elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:82 · elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:615 — the two spans are one implementation copied and then locally edited — 138 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (21 lines × 2 locations) elixir/web-ng/assets/js/hooks/charts/FlowDonut.js:19— elixir/web-ng/assets/js/hooks/charts/FlowDonut.js:19 · elixir/web-ng/assets/js/hooks/charts/FlowSparkline.js:11 — 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 (19 lines × 2 locations) elixir/web-ng/assets/js/lib/srql/tokenizer.js:210— elixir/web-ng/assets/js/lib/srql/tokenizer.js:210 · elixir/web-ng/assets/js/lib/srql/tokenizer.js:255 — 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 (17 lines × 3 locations) elixir/web-ng/assets/js/lib/srql/tokenizer.js:78— elixir/web-ng/assets/js/lib/srql/tokenizer.js:78 · elixir/web-ng/assets/js/lib/srql/tokenizer.js:213 · elixir/web-ng/assets/js/lib/srql/tokenizer.js:258 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3 locations) elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:13— elixir/web-ng/assets/js/hooks/RemoteAccessApplication.js:13 · elixir/web-ng/assets/js/hooks/RemoteAccessDesktopSession.js:36 · elixir/web-ng/assets/js/hooks/RemoteAccessTCPText.js:13 — 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 (15 lines × 2 locations) REDACTED:1611— REDACTED:1611 · elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:124 — 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 × 3 locations) elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:3— elixir/web-ng/assets/component/src/RemoteAccessApplication.jsx:3 · elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:20 · elixir/web-ng/assets/component/src/RemoteAccessTCPText.jsx:3 — 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.
Complex function validateTopologyScene (cyclomatic 91, cognitive 152) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1030— validateTopologyScene has cyclomatic complexity 91 and cognitive complexity 152; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateTopologyOverview (cyclomatic 62, cognitive 81) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:395— validateTopologyOverview has cyclomatic complexity 62 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderSelectionDetails (cyclomatic 60, cognitive 53) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:49— renderSelectionDetails has cyclomatic complexity 60 and cognitive complexity 53; 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.
Complex function _draw (cyclomatic 53, cognitive 56) elixir/web-ng/assets/js/hooks/charts/NetflowSankeyChart.js:25— _draw has cyclomatic complexity 53 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 49, cognitive 51) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:436— (anonymous) has cyclomatic complexity 49 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.
Complex function _showFlowDetails (cyclomatic 44, cognitive 43) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1484— _showFlowDetails has cyclomatic complexity 44 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.
Complex function (anonymous) (cyclomatic 44, cognitive 28) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1599— (anonymous) has cyclomatic complexity 44 and cognitive complexity 28; 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.
Complex function (anonymous) (cyclomatic 43, cognitive 31) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:304— (anonymous) has cyclomatic complexity 43 and cognitive complexity 31; 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.
Complex function buildVisibleGraphData (cyclomatic 42, cognitive 45) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:140— buildVisibleGraphData has cyclomatic complexity 42 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 42, cognitive 37) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:211— (anonymous) has cyclomatic complexity 42 and cognitive complexity 37; 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.
Complex function buildPacketFlowInstances (cyclomatic 39, cognitive 57) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:20— buildPacketFlowInstances has cyclomatic complexity 39 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Component (cyclomatic 36, cognitive 38) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— Component has cyclomatic complexity 36 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 36, cognitive 24) elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1886— (anonymous) has cyclomatic complexity 36 and cognitive complexity 24; 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.
Complex function handleSnapshot (cyclomatic 34, cognitive 35) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:77— handleSnapshot has cyclomatic complexity 34 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getNodeTooltip (cyclomatic 34, cognitive 35) elixir/web-ng/assets/js/lib/god_view/rendering_tooltip_methods.js:75— getNodeTooltip has cyclomatic complexity 34 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyCommand (cyclomatic 32, cognitive 53) js/cli/src/plugin/apply.ts:70— applyCommand has cyclomatic complexity 32 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runDeviceCodeFlow (cyclomatic 32, cognitive 49) js/cli/src/auth/login.ts:62— runDeviceCodeFlow has cyclomatic complexity 32 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function decodeArrowGraph (cyclomatic 31, cognitive 47) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_decode_methods.js:17— decodeArrowGraph has cyclomatic complexity 31 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function publishCommand (cyclomatic 31, cognitive 30) js/cli/src/dashboard/publish.ts:19— publishCommand has cyclomatic complexity 31 and cognitive complexity 30; 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.
Complex function _applyBrandBasemapTint (cyclomatic 30, cognitive 36) elixir/web-ng/assets/js/hooks/MapboxFlowMap.js:192— _applyBrandBasemapTint has cyclomatic complexity 30 and cognitive complexity 36; 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.
Unused dependency '@deck.gl/aggregation-layers' — Declared in elixir/web-ng/assets/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.
Unused dependency '@deck.gl/mesh-layers' — Declared in elixir/web-ng/assets/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.
Unused dependency '@loaders.gl/gltf' — Declared in elixir/web-ng/assets/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.
ED3 · Event naming· Event not named in past tense · ×8
Event not named in past tense: AccountLimits go/pkg/nats/accounts/account_manager.go:44— `AccountLimits` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: SubjectMapping go/pkg/nats/accounts/account_manager.go:55— `SubjectMapping` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: StreamExport go/pkg/nats/accounts/account_manager.go:61— `StreamExport` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: StreamImport go/pkg/nats/accounts/account_manager.go:67— `StreamImport` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: UserPermissions go/pkg/nats/accounts/user_manager.go:37— `UserPermissions` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: UserCredentials go/pkg/nats/accounts/user_manager.go:47— `UserCredentials` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: SuiteEvent third_party/netprobe_ebpf_vendor/cargo_metadata/src/libtest.rs:11— `SuiteEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Event not named in past tense: TestEvent third_party/netprobe_ebpf_vendor/cargo_metadata/src/libtest.rs:53— `TestEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
Subsumed condition operand go/pkg/agent/metric_envelope.go:664— `strings.HasSuffix(key, "_bytes_total")` can never decide this `||` — every value satisfying `strings.HasSuffix(key, "_bytes_total")` also satisfies `strings.Contains(key, "_bytes_")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand rust/srql/src/query/tests/translation.rs:1611— `sql.contains("<<= ")` can never decide this `||` — every value satisfying `sql.contains("<<= ")` also satisfies `sql.contains("<<=")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand rust/srql/src/query/tests/device_queries.rs:586— `lower.contains("device_type")` can never decide this `||` — every value satisfying `lower.contains("device_type")` also satisfies `lower.contains("type")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:308— `String.contains?(tag, "vulnerability")` can never decide this `||` — every value satisfying `String.contains?(tag, "vulnerability")` also satisfies `String.contains?(tag, "vuln")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:319— `String.contains?(tag, "misconfiguration")` can never decide this `||` — every value satisfying `String.contains?(tag, "misconfiguration")` also satisfies `String.contains?(tag, "configuration")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:1594— `String.contains?(text, "ifoutoctets")` can never decide this `||` — every value satisfying `String.contains?(text, "ifoutoctets")` also satisfies `String.contains?(text, "ifout")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
No AppArmor/SELinux confinement — Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp's syscall filter.
No security response headers detected docker/compose/Caddyfile:11— No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
Outdated: ash_cloak — `:ash_cloak` is locked at 0.3.1 but 0.4.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.1"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_cloak` and commit the updated REDACTED.
Outdated: ash_credo — `:ash_credo` is locked at 0.16.1 but 0.18.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.7"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_credo` and commit the updated REDACTED.
Outdated: ash_credo — `:ash_credo` is locked at 0.16.1 but 0.18.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.7"` requirement declared in elixir/serviceradar_core_elx/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_credo` and commit the updated REDACTED.
Outdated: ash_credo — `:ash_credo` is locked at 0.16.1 but 0.18.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.7"` requirement declared in elixir/serviceradar_agent_gateway/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_credo` and commit the updated REDACTED.
Outdated: ash_credo — `:ash_credo` is locked at 0.16.1 but 0.18.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.7"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_credo` and commit the updated REDACTED.
Outdated: ash_oban — `:ash_oban` is locked at 0.8.10 but 0.8.14 is the current stable release on hex.pm, and it already satisfies the `"~> 0.4"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_oban` and commit the updated REDACTED.
Outdated: ash_phoenix — `:ash_phoenix` is locked at 2.3.24 but 2.3.25 is the current stable release on hex.pm, and it already satisfies the `"~> 2.0"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_phoenix` and commit the updated REDACTED.
Outdated: ash_postgres — `:ash_postgres` is locked at 2.10.0 but 2.13.1 is the current stable release on hex.pm, and it already satisfies the `"~> 2.4"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_postgres` and commit the updated REDACTED.
Outdated: broadway_dashboard — `:broadway_dashboard` is locked at 0.4.1 but 0.5.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.4"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update broadway_dashboard` and commit the updated REDACTED.
Outdated: broadway_dashboard — `:broadway_dashboard` is locked at 0.4.1 but 0.5.0 is the current stable release on hex.pm, and it already satisfies the `"~> 0.4"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update broadway_dashboard` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_srql/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in third_party/hex_vendored/elixir_uuid/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_core_elx/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_agent_gateway/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in third_party/hex_vendored/connection/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/datasvc/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.7 but 1.4.8 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update dialyxir` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in third_party/hex_vendored/elixir_uuid/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in elixir/serviceradar_core_elx/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in elixir/datasvc/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in elixir/serviceradar_agent_gateway/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Outdated: ex_dna — `:ex_dna` is locked at 1.5.3 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3"` requirement declared in third_party/hex_vendored/connection/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ex_dna` and commit the updated REDACTED.
Skipped (documented): (unnamed test) elixir/web-ng/assets/component/test/RemoteAccessTerminal.test.jsx:46— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) elixir/web-ng/assets/component/test/RemoteAccessSSHConsoleSession.test.jsx:71— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) elixir/web-ng/assets/component/test/RemoteAccessSSHConsoleRememberKey.test.jsx:67— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) elixir/web-ng/assets/component/test/RemoteAccessSSHConsoleHostKey.test.jsx:100— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
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.
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 1 file(s) — `docs/docusaurus.config.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
Run 01a0d15d-fad1-748c-8443-b7187568d7f2 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 178 · Warnings: 3357 · Recommendations: 120 · Info: 86 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 24-09-2026 @ 03:03 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.