Public report of carverauto/serviceradar, published 13 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.3). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 13 November 2026, 11:53 UTC · Survey ID cd_892c5c5f56934e8ebe9c549d8f078392
carverauto/serviceradar
Measured 13 November 2026, 11:50 UTC, at code version 3121e09
CAI scoreAt riskUp 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 1,291,277 lines of product code in 173 projects, tests not counted · Estimated rebuild effort: about 26.8 person-years · Weakest lens: Production Readiness, 53
Findings by how serious they are
248 critical7336 serious279 minor
29 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 11:50 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
83of 83 dimensions measured by tools.
7760of 7863 findings point to an exact file and line, so you can open each one in the code. The other 103 concern the repository as a whole, such as missing documentation.
83dimensions across 10 lenses, read from 1,291,277 lines of product code in 173 projects.
carverauto/serviceradar is rated At risk because critical security findings are open. Its score is held back because four passwords or keys sit in the current code and it has uses of packages that aren't listed. It scores 59 out of 100, which the At risk rating leaves unchanged.
Production Readiness, at 53, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step is replacing the four exposed passwords or keys and switching the old ones off, worth about 5 points. Putting upper bounds on the open-ended dependency requirements comes next, worth about 3 points.
Fifty-eight passwords or keys in the code's history and four in the code are open to anyone who can read the repository. Fifty-seven settings leave the servers or containers unsafe, and thirty-eight weaknesses in the code could be used by an attacker. Replacing each exposed password or key, correcting the unsafe settings and fixing the weaknesses the scanner points to would close these risks. Updating the vulnerable packages would fix the 35 packages with a known security hole, and pinning each tool to an exact version would deal with the 13 pipeline tools referenced by a changeable name. The 13 sets of files in separate parts that keep changing together need that dependency made explicit.
The product code is 1,291,277 lines, about €3,900,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
The weakest lenses score close to each other, so improving any of them moves the score.
Code composition: what the lines of code are
Product code 63%Tests 37%
New since the last survey: 4276 findings
These 4276 critical or serious findings weren't in the previous survey, on 23 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 866 findings
These 866 critical or serious findings were in the previous survey, on 23 October 2026, and are gone from this one. The first 100 are listed here.
God Classes · TooManyFunctions: Decisions elixir/serviceradar_core/lib/serviceradar/inventory/remediation/decisions.ex
God Classes · TooManyFunctions: Pipeline elixir/serviceradar_core/lib/serviceradar/event_writer/pipeline.ex
God Classes · TooManyFunctions: Spool elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/spool.ex
God Classes · FileTooLong: topology_graph/canonical_rebuild.ex elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_graph/canonical_rebuild.ex
God Classes · TooManyFunctions: StreamLoad elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex
God Classes · FileTooLong: camera/relay_session_manager.ex elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.ex
God Classes · TooManyFunctions: ReleaseArtifactMirror elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex
God Classes · TooManyFunctions: NativeAddonSyncWorker elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync_worker.ex
God Classes · FunctionTooLong: main.MapDashboard js/cli/templates/react-map/src/main.jsx
God Classes · TooManyFunctions: CertIssuer elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex
God Classes · TooManyFunctions: AwxMembershipApproval elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_approval.ex
God Classes · FileTooLong: serviceradar_agent_gateway/status_processor.ex elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/status_processor.ex
God Classes · FileTooLong: ingestion/result_ingestor.ex elixir/serviceradar_core/lib/serviceradar/ingestion/result_ingestor.ex
God Classes · FileTooLong: ingestion/sweep_queue.ex elixir/serviceradar_core/lib/serviceradar/ingestion/sweep_queue.ex
God Classes · TooManyFunctions: Evaluation elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex
God Classes · FileTooLong: ingestion/status_ingestor.ex elixir/serviceradar_core/lib/serviceradar/ingestion/status_ingestor.ex
Code Duplication · Near-duplicate member family (4 members, 30 shared lines) rust/srql/src/query/logs/rollup.rs
Code Duplication · Near-duplicate member pair (62 shared lines) rust/anomaly-addon/src/verdict.rs
Code Duplication · Near-duplicate member pair (40 shared lines) rust/netprobe/ebpf/src/lib.rs
Code Duplication · Edited copy of a member (34 corresponding lines) rust/srql/src/query/devices/filters.rs
Code Duplication · Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/storage_token.ex
Code Duplication · Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex
Code Duplication · Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex
Code Duplication · Members sharing a duplicated core (19 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex
Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex
Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) rust/srql/src/query/addon_statuses.rs
Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex
Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex
Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) rust/srql/src/query/addon_statuses.rs
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/status_processor.ex
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) rust/srql/src/query/logs/filters.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) rust/srql/src/query/agents.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) rust/srql/src/query/logs/mod.rs
€1,300,000 to €6,500,000, for 21,585 to 68,476 hours of work, about 26.8 person-years for 15 to 51 engineers
Difficulty of the problem
Very high, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 59. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 1,291,277 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €3,900,000 to build again, about 26.8 person-years of work. Its weakest lens is Production Readiness, at 53 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 4 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
2258 modules, with 2664 dependencies between them. 38 loops run through 173 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 2218 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
github.com/carverauto/serviceradar/go/pkg/models uses github.com/carverauto/serviceradar/go/pkg/logger, so a change to github.com/carverauto/serviceradar/go/pkg/logger can break github.com/carverauto/serviceradar/go/pkg/models, while a change to github.com/carverauto/serviceradar/go/pkg/models can't break github.com/carverauto/serviceradar/go/pkg/logger.
Position
Below the diagonal: github.com/carverauto/serviceradar/go/pkg/models uses a module listed above it, which is the healthy direction.
proc_macro2 uses proc_macro2.fallback, so a change to proc_macro2.fallback can break proc_macro2, while a change to proc_macro2 can't break proc_macro2.fallback.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in serde_json.value uses a type in serde_json.ser.
The types involved
serde_json.value.Value → serde_json.ser.Formatter
Direction
serde_json.value uses serde_json.ser, so a change to serde_json.ser can break serde_json.value, while a change to serde_json.value can't break serde_json.ser.
Position
Below the diagonal: serde_json.value uses a module listed above it, which is the healthy direction.
github.com/carverauto/serviceradar/go/pkg/agent uses github.com/carverauto/serviceradar/go/pkg/logger, so a change to github.com/carverauto/serviceradar/go/pkg/logger can break github.com/carverauto/serviceradar/go/pkg/agent, while a change to github.com/carverauto/serviceradar/go/pkg/agent can't break github.com/carverauto/serviceradar/go/pkg/logger.
Position
Below the diagonal: github.com/carverauto/serviceradar/go/pkg/agent uses a module listed above it, which is the healthy direction.
44 pairs of types, where a type in github.com/carverauto/serviceradar/go/pkg/agent uses a type in github.com/carverauto/serviceradar/go/pkg/models. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
github.com/carverauto/serviceradar/go/pkg/agent uses github.com/carverauto/serviceradar/go/pkg/models, so a change to github.com/carverauto/serviceradar/go/pkg/models can break github.com/carverauto/serviceradar/go/pkg/agent, while a change to github.com/carverauto/serviceradar/go/pkg/agent can't break github.com/carverauto/serviceradar/go/pkg/models.
Position
Below the diagonal: github.com/carverauto/serviceradar/go/pkg/agent uses a module listed above it, which is the healthy direction.
110 pairs of types, where a type in object.pe uses a type in object.endian. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
object.pe uses object.read.coff.section, so a change to object.read.coff.section can break object.pe, while a change to object.pe can't break object.read.coff.section.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
object.read.traits uses object.build.table, so a change to object.build.table can break object.read.traits, while a change to object.read.traits can't break object.build.table.
Position
Below the diagonal: object.read.traits uses a module listed above it, which is the healthy direction.
object.read.traits uses object.common, so a change to object.common can break object.read.traits, while a change to object.read.traits can't break object.common.
Position
Below the diagonal: object.read.traits uses a module listed above it, which is the healthy direction.
object.read.traits uses object.read.private, so a change to object.read.private can break object.read.traits, while a change to object.read.traits can't break object.read.private.
Position
Below the diagonal: object.read.traits uses a module listed above it, which is the healthy direction.
object.read.traits uses object.endian, so a change to object.endian can break object.read.traits, while a change to object.read.traits can't break object.endian.
Position
Below the diagonal: object.read.traits uses a module listed above it, which is the healthy direction.
object.read.traits uses object.read, so a change to object.read can break object.read.traits, while a change to object.read.traits can't break object.read.
Position
Below the diagonal: object.read.traits uses a module listed above it, which is the healthy direction.
22→26 object.read.traits uses object.read.anypart of a loop✕
Connections
8 pairs of types, where a type in object.read.traits uses a type in object.read.any.
object.read.traits uses object.read.any, so a change to object.read.any can break object.read.traits, while a change to object.read.traits can't break object.read.any.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→39 object.read.traits uses object.build.elfpart of a loop✕
Connections
2 pairs of types, where a type in object.read.traits uses a type in object.build.elf.
object.read.traits uses object.build.elf, so a change to object.build.elf can break object.read.traits, while a change to object.read.traits can't break object.build.elf.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
proc_macro2.fallback uses proc_macro2, so a change to proc_macro2 can break proc_macro2.fallback, while a change to proc_macro2.fallback can't break proc_macro2.
Position
Below the diagonal: proc_macro2.fallback uses a module listed above it, which is the healthy direction.
srql.query.types uses srql.parser.ast, so a change to srql.parser.ast can break srql.query.types, while a change to srql.query.types can't break srql.parser.ast.
Position
Below the diagonal: srql.query.types uses a module listed above it, which is the healthy direction.
srql.query.types uses serde_json.value, so a change to serde_json.value can break srql.query.types, while a change to srql.query.types can't break serde_json.value.
Position
Below the diagonal: srql.query.types uses a module listed above it, which is the healthy direction.
gimli.read.unit uses gimli.constants, so a change to gimli.constants can break gimli.read.unit, while a change to gimli.read.unit can't break gimli.constants.
Position
Below the diagonal: gimli.read.unit uses a module listed above it, which is the healthy direction.
gimli.read.unit uses proc_macro2.fallback, so a change to proc_macro2.fallback can break gimli.read.unit, while a change to gimli.read.unit can't break proc_macro2.fallback.
Position
Below the diagonal: gimli.read.unit uses a module listed above it, which is the healthy direction.
25→30 gimli.read.unit uses gimli.readpart of a loop✕
Connections
7 pairs of types, where a type in gimli.read.unit uses a type in gimli.read.
object.read.any uses object.build.table, so a change to object.build.table can break object.read.any, while a change to object.read.any can't break object.build.table.
Position
Below the diagonal: object.read.any uses a module listed above it, which is the healthy direction.
object.read.any uses object.common, so a change to object.common can break object.read.any, while a change to object.read.any can't break object.common.
Position
Below the diagonal: object.read.any uses a module listed above it, which is the healthy direction.
object.read.any uses object.read.private, so a change to object.read.private can break object.read.any, while a change to object.read.any can't break object.read.private.
Position
Below the diagonal: object.read.any uses a module listed above it, which is the healthy direction.
object.read.any uses object.read.traits, so a change to object.read.traits can break object.read.any, while a change to object.read.any can't break object.read.traits.
Position
Below the diagonal: object.read.any uses a module listed above it, which is the healthy direction.
object.read.any uses proc_macro2.fallback, so a change to proc_macro2.fallback can break object.read.any, while a change to object.read.any can't break proc_macro2.fallback.
Position
Below the diagonal: object.read.any uses a module listed above it, which is the healthy direction.
26→39 object.read.any uses object.build.elfpart of a loop✕
Connections
1 pair of types, where a type in object.read.any uses a type in object.build.elf.
The types involved
object.read.any.File → object.build.elf.Section
Direction
object.read.any uses object.build.elf, so a change to object.build.elf can break object.read.any, while a change to object.read.any can't break object.build.elf.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
object.read.coff.section uses object.build.table, so a change to object.build.table can break object.read.coff.section, while a change to object.read.coff.section can't break object.build.table.
Position
Below the diagonal: object.read.coff.section uses a module listed above it, which is the healthy direction.
object.read.coff.section uses object.common, so a change to object.common can break object.read.coff.section, while a change to object.read.coff.section can't break object.common.
Position
Below the diagonal: object.read.coff.section uses a module listed above it, which is the healthy direction.
object.read.coff.section uses object.read.private, so a change to object.read.private can break object.read.coff.section, while a change to object.read.coff.section can't break object.read.private.
Position
Below the diagonal: object.read.coff.section uses a module listed above it, which is the healthy direction.
object.read.coff.section uses object.read, so a change to object.read can break object.read.coff.section, while a change to object.read.coff.section can't break object.read.
Position
Below the diagonal: object.read.coff.section uses a module listed above it, which is the healthy direction.
object.read.coff.section uses object.pe, so a change to object.pe can break object.read.coff.section, while a change to object.read.coff.section can't break object.pe.
Position
Below the diagonal: object.read.coff.section uses a module listed above it, which is the healthy direction.
object.read.coff.section uses object.read.traits, so a change to object.read.traits can break object.read.coff.section, while a change to object.read.coff.section can't break object.read.traits.
Position
Below the diagonal: object.read.coff.section uses a module listed above it, which is the healthy direction.
quote.to_tokens uses proc_macro2.fallback, so a change to proc_macro2.fallback can break quote.to_tokens, while a change to quote.to_tokens can't break proc_macro2.fallback.
Position
Below the diagonal: quote.to_tokens uses a module listed above it, which is the healthy direction.
serde_derive.internals.ast uses proc_macro2.fallback, so a change to proc_macro2.fallback can break serde_derive.internals.ast, while a change to serde_derive.internals.ast can't break proc_macro2.fallback.
Position
Below the diagonal: serde_derive.internals.ast uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.common, so a change to object.common can break object.read.elf.file, while a change to object.read.elf.file can't break object.common.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in object.read.elf.file uses a type in object.pod.
The types involved
object.read.elf.file.FileHeader → object.pod.Pod
Direction
object.read.elf.file uses object.pod, so a change to object.pod can break object.read.elf.file, while a change to object.read.elf.file can't break object.pod.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.read.private, so a change to object.read.private can break object.read.elf.file, while a change to object.read.elf.file can't break object.read.private.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.endian, so a change to object.endian can break object.read.elf.file, while a change to object.read.elf.file can't break object.endian.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.read, so a change to object.read can break object.read.elf.file, while a change to object.read.elf.file can't break object.read.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.read.traits, so a change to object.read.traits can break object.read.elf.file, while a change to object.read.elf.file can't break object.read.traits.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.read.any, so a change to object.read.any can break object.read.elf.file, while a change to object.read.elf.file can't break object.read.any.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
object.read.elf.file uses object.read.coff.section, so a change to object.read.coff.section can break object.read.elf.file, while a change to object.read.elf.file can't break object.read.coff.section.
Position
Below the diagonal: object.read.elf.file uses a module listed above it, which is the healthy direction.
31→36 object.read.elf.file uses object.read.elf.sectionpart of a loop✕
Connections
2 pairs of types, where a type in object.read.elf.file uses a type in object.read.elf.section.
object.read.elf.file uses object.read.elf.section, so a change to object.read.elf.section can break object.read.elf.file, while a change to object.read.elf.file can't break object.read.elf.section.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
object.read.macho.file uses object.build.table, so a change to object.build.table can break object.read.macho.file, while a change to object.read.macho.file can't break object.build.table.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.common, so a change to object.common can break object.read.macho.file, while a change to object.read.macho.file can't break object.common.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.pod, so a change to object.pod can break object.read.macho.file, while a change to object.read.macho.file can't break object.pod.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.read.private, so a change to object.read.private can break object.read.macho.file, while a change to object.read.macho.file can't break object.read.private.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.endian, so a change to object.endian can break object.read.macho.file, while a change to object.read.macho.file can't break object.endian.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.read, so a change to object.read can break object.read.macho.file, while a change to object.read.macho.file can't break object.read.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.read.traits, so a change to object.read.traits can break object.read.macho.file, while a change to object.read.macho.file can't break object.read.traits.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.macho.file uses object.read.any, so a change to object.read.any can break object.read.macho.file, while a change to object.read.macho.file can't break object.read.any.
Position
Below the diagonal: object.read.macho.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.common, so a change to object.common can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.common.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.pod, so a change to object.pod can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.pod.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.read.private, so a change to object.read.private can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.read.private.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.read, so a change to object.read can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.read.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.read.traits, so a change to object.read.traits can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.read.traits.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.read.any, so a change to object.read.any can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.read.any.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
object.read.xcoff.file uses object.read.coff.section, so a change to object.read.coff.section can break object.read.xcoff.file, while a change to object.read.xcoff.file can't break object.read.coff.section.
Position
Below the diagonal: object.read.xcoff.file uses a module listed above it, which is the healthy direction.
158 pairs of types, where a type in syn.token uses a type in proc_macro2.fallback. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
syn.token uses proc_macro2.fallback, so a change to proc_macro2.fallback can break syn.token, while a change to syn.token can't break proc_macro2.fallback.
Position
Below the diagonal: syn.token uses a module listed above it, which is the healthy direction.
100 pairs of types, where a type in syn.token uses a type in quote.to_tokens. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
The types involved
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, so a change to quote.to_tokens can break syn.token, while a change to syn.token can't break quote.to_tokens.
Position
Below the diagonal: syn.token uses a module listed above it, which is the healthy direction.
100 pairs of types, where a type in syn.token uses a type in syn.parse. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
The types involved
syn.token.Abstract → syn.parse.Parse
syn.token.And → syn.parse.Parse
syn.token.AndAnd → syn.parse.Parse
syn.token.AndEq → syn.parse.Parse
syn.token.As → syn.parse.Parse
syn.token.Async → syn.parse.Parse
syn.token.At → syn.parse.Parse
syn.token.Auto → syn.parse.Parse
syn.token.Await → syn.parse.Parse
syn.token.Become → syn.parse.Parse
syn.token.Box → syn.parse.Parse
syn.token.Break → syn.parse.Parse
syn.token.Caret → syn.parse.Parse
syn.token.CaretEq → syn.parse.Parse
syn.token.Colon → syn.parse.Parse
syn.token.Comma → syn.parse.Parse
syn.token.Const → syn.parse.Parse
syn.token.Continue → syn.parse.Parse
syn.token.Crate → syn.parse.Parse
syn.token.Default → syn.parse.Parse
syn.token.Do → syn.parse.Parse
syn.token.Dollar → syn.parse.Parse
syn.token.Dot → syn.parse.Parse
syn.token.DotDot → syn.parse.Parse
syn.token.DotDotDot → syn.parse.Parse
Direction
syn.token uses syn.parse, so a change to syn.parse can break syn.token, while a change to syn.token can't break syn.parse.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
object.read.elf.section uses object.build.table, so a change to object.build.table can break object.read.elf.section, while a change to object.read.elf.section can't break object.build.table.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.common, so a change to object.common can break object.read.elf.section, while a change to object.read.elf.section can't break object.common.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.pod, so a change to object.pod can break object.read.elf.section, while a change to object.read.elf.section can't break object.pod.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.read.private, so a change to object.read.private can break object.read.elf.section, while a change to object.read.elf.section can't break object.read.private.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.endian, so a change to object.endian can break object.read.elf.section, while a change to object.read.elf.section can't break object.endian.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.read, so a change to object.read can break object.read.elf.section, while a change to object.read.elf.section can't break object.read.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.read.traits, so a change to object.read.traits can break object.read.elf.section, while a change to object.read.elf.section can't break object.read.traits.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.read.coff.section, so a change to object.read.coff.section can break object.read.elf.section, while a change to object.read.elf.section can't break object.read.coff.section.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
object.read.elf.section uses object.read.elf.file, so a change to object.read.elf.file can break object.read.elf.section, while a change to object.read.elf.section can't break object.read.elf.file.
Position
Below the diagonal: object.read.elf.section uses a module listed above it, which is the healthy direction.
syn.parse uses proc_macro2.fallback, so a change to proc_macro2.fallback can break syn.parse, while a change to syn.parse can't break proc_macro2.fallback.
Position
Below the diagonal: syn.parse uses a module listed above it, which is the healthy direction.
gimli.read.dwarf uses gimli.read.unit, so a change to gimli.read.unit can break gimli.read.dwarf, while a change to gimli.read.dwarf can't break gimli.read.unit.
Position
Below the diagonal: gimli.read.dwarf uses a module listed above it, which is the healthy direction.
32 pairs of types, where a type in gimli.read.dwarf uses a type in gimli.common. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
gimli.read.dwarf uses gimli.common, so a change to gimli.common can break gimli.read.dwarf, while a change to gimli.read.dwarf can't break gimli.common.
Position
Below the diagonal: gimli.read.dwarf uses a module listed above it, which is the healthy direction.
object.build.elf uses object.build.table, so a change to object.build.table can break object.build.elf, while a change to object.build.elf can't break object.build.table.
Position
Below the diagonal: object.build.elf uses a module listed above it, which is the healthy direction.
object.build.elf uses object.endian, so a change to object.endian can break object.build.elf, while a change to object.build.elf can't break object.endian.
Position
Below the diagonal: object.build.elf uses a module listed above it, which is the healthy direction.
object.build.elf uses object.read.any, so a change to object.read.any can break object.build.elf, while a change to object.build.elf can't break object.read.any.
Position
Below the diagonal: object.build.elf uses a module listed above it, which is the healthy direction.
object.build.elf uses object.read.coff.section, so a change to object.read.coff.section can break object.build.elf, while a change to object.build.elf can't break object.read.coff.section.
Position
Below the diagonal: object.build.elf uses a module listed above it, which is the healthy direction.
object.build.elf uses object.read.elf.section, so a change to object.read.elf.section can break object.build.elf, while a change to object.build.elf can't break object.read.elf.section.
Position
Below the diagonal: object.build.elf uses a module listed above it, which is the healthy direction.
36 pairs of types, where a type in syn.item uses a type in proc_macro2.fallback. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
syn.item uses proc_macro2.fallback, so a change to proc_macro2.fallback can break syn.item, while a change to syn.item can't break proc_macro2.fallback.
Position
Below the diagonal: syn.item uses a module listed above it, which is the healthy direction.
36 pairs of types, where a type in syn.item uses a type in quote.to_tokens. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
35 pairs of types, where a type in syn.item uses a type in syn.parse. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
The types involved
syn.item.FnArg → syn.parse.Parse
syn.item.ForeignItem → syn.parse.Parse
syn.item.ForeignItemFn → syn.parse.Parse
syn.item.ForeignItemMacro → syn.parse.Parse
syn.item.ForeignItemStatic → syn.parse.Parse
syn.item.ForeignItemType → syn.parse.Parse
syn.item.ImplItem → syn.parse.Parse
syn.item.ImplItemConst → syn.parse.Parse
syn.item.ImplItemFn → syn.parse.Parse
syn.item.ImplItemMacro → syn.parse.Parse
syn.item.ImplItemType → syn.parse.Parse
syn.item.ItemConst → syn.parse.Parse
syn.item.ItemEnum → syn.parse.Parse
syn.item.ItemExternCrate → syn.parse.Parse
syn.item.ItemFn → syn.parse.Parse
syn.item.ItemForeignMod → syn.parse.Parse
syn.item.ItemImpl → syn.parse.Parse
syn.item.ItemMacro → syn.parse.Parse
syn.item.ItemMod → syn.parse.Parse
syn.item.ItemStatic → syn.parse.Parse
syn.item.ItemStruct → syn.parse.Parse
syn.item.ItemTrait → syn.parse.Parse
syn.item.ItemTraitAlias → syn.parse.Parse
syn.item.ItemType → syn.parse.Parse
syn.item.ItemUnion → syn.parse.Parse
Direction
syn.item uses syn.parse, so a change to syn.parse can break syn.item, while a change to syn.item can't break syn.parse.
Position
Below the diagonal: syn.item uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 56% · Adequate · gated by X5 ·
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
A02:2025 — Security Misconfiguration
256
High / Critical
A05:2025 — Injection
114
High / Critical
A03:2025 — Software Supply Chain Failures
100
High / Critical
A07:2025 — Authentication Failures
65
High / Critical
Roadmap
Top priorities: Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED; Resolve the 2 Unbounded dependency requirement finding(s) in Dependency Hygiene; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
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.
Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
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 — 248
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 — 7336
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 — 279
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 29
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 83 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 83 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, 7760 of 7863 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .ts, .tsx, .ex, .go, .rs, and our analyzer cannot run the .ex, .go, .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 75.0% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,257 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 2,944 test source file(s) (.rs, .go, .py, .exs, .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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .ex, .rs, and the built-in reliability runner cannot re-run the .ex test suite(s); the rust executor ran against the .rs half and could not be re-run to completion inside our analyzer environment — 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/ (1203 tests); node:test via `npm ci --ignore-scripts` in js/cli/ (148 tests); node:test via `npm ci --ignore-scripts` in js/create-dashboard/ (2 tests)): measured (0 flaky); Go (14 modules): measured (0 flaky) suite(s) did re-run, and came back with 0 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. The half was driven by a runner we ship, so this is not a missing-runner gap.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, 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 (6 contributor(s) across 20000 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 5 hold 0.6% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Tracing effort is measured over resolved call sites, and all 412 sampled here came from .ex files. This repository's .go, .rs source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `docs/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.
D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Helm/serviceradar-k8s-edge/templates/deployment.yaml:3, REDACTED:3, REDACTED:36, REDACTED:45, helm/serviceradar/templates/archive-reader.yaml:38, helm/serviceradar/templates/bmp-collector.yaml:60, helm/serviceradar/templates/cert-generator-job.yaml:68, helm/serviceradar/templates/cert-regenerator-job.yaml:51, helm/serviceradar/templates/checker-templates-kv-bootstrap-job.yaml:3, helm/serviceradar/templates/cnpg-client-ca-job.yaml:62 and 28 more did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 56 further occurrence(s) are not listed individually; the score already reflects all 96.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 17 — an image could not be built) — failed to solve: failed to compute cache key: failed to calculate checksum of ref 7f1add72-722d-44cb-954b-4886e5ebf10b::llx7fica5dy706iymilblzj0k: "/elixir/vendor": not found; runtime evidence skipped.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These 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.
ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Elixir, Erlang, Go, Python, Rust, Swift, c, cpp, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Elixir, Erlang, Go, Python, Rust, Swift, c, cpp, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 83 further occurrence(s) are not listed individually; the score already reflects all 123.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 177 further occurrence(s) are not listed individually; the score already reflects all 217.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 556 further occurrence(s) are not listed individually; the score already reflects all 596.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X14 Bypassable address classification — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X15 Unvalidated length from an untrusted reader — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X21 Side-effecting pattern guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 330 further occurrence(s) are not listed individually; the score already reflects all 370.
X30 Support guard that admits what it rejects — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust, Go, Java, Kotlin, Scala, PHP, Ruby, Swift and Dart), and its Elixir, Erlang source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 32 further occurrence(s) are not listed individually; the score already reflects all 72.
Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
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.
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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
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.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
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.
758 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _renderSvgOverlay at 140. A further 71 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 88 — they are counted neither in the figure above nor in this dimension's score. 31 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 88), rust/srql/src/query/viz/mod.rs (srql::query::viz::meta_for_plan at 77), rust/srql/src/query/engine.rs (QueryEngine::execute_query at 59), 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/endpoint_vulnerability_matches.rs (srql::query::endpoint_vulnerability_matches::row_condition at 42), and 26 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.
+ 621 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with _renderSvgOverlay (cyclomatic 140), _draw (cyclomatic 133), serviceradar_netprobe_ebpf::observe_mdns (cyclomatic 124). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.7 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 942 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 120 down to 120 or less in Cognitive Complexity — start with serviceradar_netprobe_ebpf::observe_mdns (cognitive 161), Converter::convert_ipfix (cognitive 154), layout_elk_scene.validateTopologyScene (cognitive 153). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cognitive Complexity from 5.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.7 / 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 384 FileTooLong finding(s) in God Classes — start with index.ex (25), show.ex (12), REDACTED (7). — One of this dimension's main actionable groups (384 warning-level).
Resolve the 137 TooManyFunctions finding(s) in God Classes — start with native.ex (3), native_addon_importer.ex (2), ocsf.ex. — One of this dimension's main actionable groups (137 warning-level).
Resolve the 88 FunctionTooLong finding(s) in God Classes — start with exposure-reconciliation-audit.openspec.html (12), exposure-source-validation.openspec.html (12), REDACTED (4). — One of this dimension's main actionable groups (88 warning-level).
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.
1779 duplicated block group(s) detected. A further 2494 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 25 of the 4273 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
Edited copy of a member (4 corresponding lines) · ×201elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_summary_components.ex:402
+ 434 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 201 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with proxmox_console_stream_handler.ex (6), index.ex (6), show.ex (4). — One of this dimension's main actionable groups (201 warning-level).
Resolve the 137 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with show.ex (5), index.ex (3), device_mount_assigns.ex (2). — One of this dimension's main actionable groups (137 warning-level).
Resolve the 131 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with index.ex (11), REDACTED (3), virtualization.rs (3). — One of this dimension's main actionable groups (131 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.4 / 10Stronggated by 12 serious findings✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
173 production modules (Cargo+npm+Go+SwiftPM+OTP+Bazel), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 12 module(s) off the main sequence, with abstractness counted on 63 of the 173 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: datasvc · ×12
What to do
Resolve the 12 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
What it measures: Whether 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).
Detailed fixes: d7_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 1257 tests. Measured on the JavaScript/TypeScript suite only — at least 2,944 test source file(s) (.rs, .go, .py, .exs, .ex) went unread, so its test quality is unmeasured and is not in these counts.
Mock-dominated test: ignores stale data channel messages after the viewer session is closed · ×19elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.test.js:626
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
76 outdated, 0 retired direct Hex dependencies, 4 pinning defect(s). 248 of 287 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 · ×76
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.
4 secret(s) detected. 6 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
REDACTED
What to do
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 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 809 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 REDACTED, 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: rust/srql/src/query/starrocks.rs (86×36=3096); elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx (12×152=1824); rust/srql/src/query/translate.rs (27×64=1728) Repeated repair below the complexity floor: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.ex (15 of 27 changes were fixes); elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex (15 of 20 changes were fixes); elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex (14 of 25 changes were fixes)
Resolve the 123 Hotspot finding(s) in Churn × Complexity Hotspots — start with filters.rs (2), REDACTED (2), world_overlay_frame.js (2). — One of this dimension's main actionable groups (123 warning-level).
Resolve the 44 Repeated repair finding(s) in Churn × Complexity Hotspots — start with ordinals.rs (2), jet_stream_publisher.ex, publish_window.ex. — One of this dimension's main actionable groups (44 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.
10 deducted task-comment markers across 1291277 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 10 TodoComment finding(s) in Explicit Debt — start with grpc.go (2), device.ex (2), context_hydrator.rs. — One of this dimension's main actionable groups (10 warning-level).
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: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
7 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated. Measured over the .ex source only — this repository's .go, .rs was not sampled for call sites, so this score covers part of the tree, not all of it.
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 High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
60 finding(s): 0 critical, 58 high, 0 medium, 0 low. 11 detection(s) in paths this repository declares as reviewed specimen content (its credential-scanner allowlist) were excluded. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 51 REDACTED finding(s) in Secrets (history) — start with REDACTED (32), REDACTED (6), REDACTED (3). — One of this dimension's main actionable groups (51 issue-level).
Resolve the 7 High secret finding(s) in Secrets (history) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 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).
114 finding(s): 0 critical, 70 high, 19 medium, 25 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 109 file(s) — `buildbuddy_setup_fixture_env.sh` (lines 41–403), `config/proto_bindings/go/config.pb.go`, `docker/compose/bootstrap-admin.sh` (line 66), `docker/compose/tools-profile.sh` (line 60), `docs/docusaurus.config.ts` (line 89, line 106, line 227), … (+104 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
REDACTED
REDACTED
+ 19 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (20 issue-level).
Resolve the 16 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (16 issue-level).
No action in Static Analysis (SAST) — all 13 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (13 issue-level, 0 of them charged here).
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 and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 32 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (28), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (32 issue-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 High 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 119 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (18), REDACTED (14), REDACTED (4). — One of this dimension's main actionable groups (119 warning-level).
Resolve the 80 Low IaC finding(s) in IaC & Container Security — start with REDACTED (10), REDACTED (10), REDACTED (9). — One of this dimension's main actionable groups (80 recommendation-level).
Resolve the 57 High 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 5420 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 13 Boundary-crossing change coupling finding(s) in Change Coupling — start with entity_access.ex (4), sweep.pb.ex (4), catalog.ex (2). — One of this dimension's main actionable groups (13 issue-level).
Resolve the 10 Change coupling finding(s) in Change Coupling — start with native.ex (2), engine.rs, topology_atlas.ex. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with entity.rs. — One of this dimension's main actionable groups (1 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 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — 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.
5/6 workload(s) run every container under a seccomp profile; 0/6 declare an AppArmor/SELinux profile.
No seccomp profileREDACTED:2
What to do
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED. — 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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 22 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
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:138, 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: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
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.
`html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden])` moves (`animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:444, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:444, openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:444
`.share-chapter-cue[data-state="playing"] .share-chapter-state::before` moves (`animation: archify-share-cue-pulse 1.15s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:494, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:494, openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:494
`html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-motion="running"] .diagram-container::before` moves (`animation: archify-signal-scan 4.8s ease-in-out 1 both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:809, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:809, openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:809
`.diagram-container.is-camera-moving svg` moves (`transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:909, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:909, openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:909
`.diagram-guide-action` moves (`transition: border-color 140ms ease, background 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2100, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2100, openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:2100
`.preset-control-mark` moves (`transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:3162, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:3162, openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:3162
`.archify-toast` moves (`transition: opacity 0.2s, transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:3561, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:3561
`.node-finder-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2276, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2276
`.node-finder-input:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2282, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2282
`svg [data-node-id]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:4078, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:4078
`svg [data-legend-kind]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:4116, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:4116
`.relationship-hit-target` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:4259, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:4259
`html[data-preset="editorial"] .diagram-container::after` sets color: #059669 on background-color: #ffffff — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:784, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:784
`.diagram-nav #btn-diagram-guide[aria-expanded="true"]` sets color: #d97706 on background-color: #fffdf8 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:1048, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:1048
`.diagram-nav #btn-overview-map[aria-expanded="true"]` sets color: #0891b2 on background-color: #fffdf8 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:1267, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:1267
`.diagram-nav #btn-route-probe[aria-pressed="true"]` sets color: #059669 on background-color: #fffdf8 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:1289, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:1289
`.guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index` sets color: #ffffff on background-color: #0891b2 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2799, openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2799
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.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · 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.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
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 cross-context integration events stay loosely coupled — no producer-owned enums/domain types leaking to consumers. Shared-kernel/contracts types are allowed.
Method: Roslyn (DDD-gated): integration-event properties scanned for producer-domain type/enum leaks versus primitives and shared-kernel types. Deterministic, hard fact.
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 · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.
Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.
Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — 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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — third_party/netprobe_ebpf_vendor/cargo_metadata/src/libtest.rs:53
What to do
Name new events in the past tense: they record facts that already happened. Do not rename an event that is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it.
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 repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
helm/serviceradar/README.md links to `../docs/docs/edge-agents.md`, but `helm/docs/docs/edge-agents.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — helm/serviceradar/README.md:89
What to do
Reconcile the README with reality: helm/serviceradar/README.md links to `../docs/docs/edge-agents.md`, but `helm/docs/docs/edge-agents.md` does not exist.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
1 public type in `swift~FieldSurvey~LocalPackages~arrow-swift~Arrow` is marked as implementation by its own namespace, folder or name: `ArrowArrayHolderImpl` (swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArray.swift:31, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArray.swift:31
What to do
Hide `swift~FieldSurvey~LocalPackages~arrow-swift~Arrow` (`ArrowArrayHolderImpl`) (Rust: `pub(crate)`, or keep the module private; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
Only 33/49 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `elixir/serviceradar_core/native/dgraph_nif`, `elixir/serviceradar_core/native/topology_atlas_nif`, `elixir/serviceradar_nvr`, `elixir/web-ng/assets` and 11 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.
`REDACTED` schedules updates, but no `package-ecosystem` entry covers `bun`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:3
What to do
Dependabot is configured but does not watch `bun`, `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 outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`http.Client{` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — build/wasm_plugins/upload_signature_tool.go:617
`ureq::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — config/manager_config/rust/src/ca_bundle.rs:20
`Req.new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:761
`Req.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1226, elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1285, elixir/web-ng/lib/serviceradar_web_ng_web/plugs/gateway_auth.ex:222
What to do
Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Set an explicit timeout on every client — `recv_timeout:` for HTTPoison, `receive_timeout:` for Req and Finch, `Tesla.Middleware.Timeout` (or the adapter's `recv_timeout`) for Tesla, `timeout:` for `:httpc` — and add retries with back-off (`Tesla.Middleware.Retry`, Req's `retry:`) and a breaker (`:fuse`, `ExternalService`) around dependencies that fail.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
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.
11 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 — 8 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 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 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 11 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
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
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:91 · 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:91
elixir/web-ng/assets/js/hooks/charts/NetflowStacked100Chart.js:128 · elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:395 — 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/lib/camera_relay/viewer.js:493 · elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js:376 — the two spans are one implementation copied and then locally edited — 167 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/camera_relay/viewer.js:493
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
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
REDACTED:91 · elixir/web-ng/assets/camera_recording.playwright.js:111 — 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. — REDACTED:91
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:98 · elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:606 — 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:98
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
elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:514 · elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:541 — 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/DashboardWasmHost.js:514
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:79 — the two spans are one implementation copied and then locally edited — 82 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:129 — 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
elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1701 · 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. — elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1701
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:287 · 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:287
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
elixir/web-ng/assets/js/lib/god_view/lifecycle_managed_camera_recovery.js:139 · elixir/web-ng/assets/js/lib/god_view/lifecycle_managed_camera_recovery.js:160 — the two spans are one implementation copied and then locally edited — 57 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/god_view/lifecycle_managed_camera_recovery.js:139
elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:362 · elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:412 — 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/god_view_elk_scene_acceptance.playwright.js:362
REDACTED:820 · elixir/web-ng/assets/js/dashboards/service_availability_noc.js:369 · elixir/web-ng/assets/js/utils/dashboard_user_time.js:17 — 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. — REDACTED:820
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/css/app.css:19 reaches into another package with a relative path (../node_modules/mapbox-gl/dist/mapbox-gl.css) — import the package by name instead. — elixir/web-ng/assets/css/app.css:19
elixir/web-ng/assets/css/app.css:20 reaches into another package with a relative path (../node_modules/gridstack/dist/gridstack.min.css) — import the package by name instead. — elixir/web-ng/assets/css/app.css:20
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
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:370
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:70
_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
buildVisibleGraphData has cyclomatic complexity 46 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. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:172
(anonymous) has cyclomatic complexity 46 and cognitive complexity 48; 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:498
(anonymous) has cyclomatic complexity 46 and cognitive complexity 34; 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:328
_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
buildPacketFlowEdges has cyclomatic complexity 43 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:12
(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
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
admitNodeLabelsForViewport 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/js/lib/god_view/rendering_graph_layer_node_methods.js:446
(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
aggregateVisibleEdges has cyclomatic complexity 35 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. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:607
main has cyclomatic complexity 35 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:10
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:76
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
selectNodeLabels has cyclomatic complexity 33 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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_layer_node_methods.js:289
renderCondition has cyclomatic complexity 32 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/world_filter_panel.js:212
decodeWorldTile has cyclomatic complexity 32 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/world_tile_decode.js:39
_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
MiniVisual has cyclomatic complexity 30 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/DashboardBuilderCanvas.jsx:227
expression has cyclomatic complexity 29 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/world_filter_panel.js:346
openSession has cyclomatic complexity 28 and cognitive complexity 29; 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:922
handlePick has cyclomatic complexity 27 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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_selection_methods.js:353
expandableEndpointClusterId has cyclomatic complexity 27 and cognitive complexity 18; 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:240
buildNodeAndLabelLayers has cyclomatic complexity 26 and cognitive complexity 27; 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_layer_node_methods.js:566
edgeEnabledByTopologyLayer has cyclomatic complexity 26 and cognitive complexity 20; 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_style_edge_topology_methods.js:143
(anonymous) has cyclomatic complexity 26 and cognitive complexity 18; 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/layout_cluster_methods.js:172
gridPanelAtPointer has cyclomatic complexity 26 and cognitive complexity 15; 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/charts/NetflowGridChart.js:70
handleDetailsPanelClick has cyclomatic complexity 24 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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_dom_setup_methods.js:207
receive has cyclomatic complexity 24 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 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/world_membership.js:44
update has cyclomatic complexity 23 and cognitive complexity 23; 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/world_filter_panel.js:122
buildTransportAndEffectLayers has cyclomatic complexity 23 and cognitive complexity 21; 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_layer_transport_methods.js:62
decodeWorldOverlay has cyclomatic complexity 23 and cognitive complexity 15; 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/world_overlay_frame.js:20
assertScene has cyclomatic complexity 22 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/god_view_elk_scene_acceptance.playwright.js:175
renderLayers has cyclomatic complexity 22 and cognitive complexity 34; 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/world_tile_layer.js:230
draw has cyclomatic complexity 22 and cognitive complexity 29; 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/FlowRateChart.js:140
(anonymous) has cyclomatic complexity 22 and cognitive complexity 27; 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:742
Do you agree with this assessment?
R3 · Large Files4.7 / 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.
elixir/web-ng/assets/js/hooks/DashboardWasmHost.js has 1706 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1
elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js has 1699 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1
elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx has 1347 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1
elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js has 1187 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1
elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js has 1164 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1
elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx has 911 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:1
elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js has 860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:1
elixir/web-ng/assets/god_view_world_gpu.playwright.js has 796 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/god_view_world_gpu.playwright.js:1
elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js has 776 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js:1
elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:1
elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js has 757 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:1
elixir/web-ng/assets/component/src/DashboardPanelChart.jsx has 751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:1
REDACTED has 747 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js has 711 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:1
elixir/web-ng/assets/js/lib/camera_relay/viewer.js has 681 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/camera_relay/viewer.js:1
elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js has 601 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:1
elixir/web-ng/assets/js/hooks/SRQLInput.js has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/hooks/SRQLInput.js:1
elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js has 567 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:1
elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js has 563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:1
elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx has 530 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:1
elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js has 527 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:1
elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js has 464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js:1
elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:1
elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js has 453 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js:1
elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:1
elixir/web-ng/assets/js/lib/srql/monaco_srql.js has 443 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/srql/monaco_srql.js:1
elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:1
elixir/web-ng/assets/js/lib/camera_relay/player.js has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — elixir/web-ng/assets/js/lib/camera_relay/player.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage8.5 / 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. (×30) — elixir/web-ng/assets/god_view_world_gpu.playwright.js:1, elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:1, elixir/web-ng/assets/god_view_elk_scene_harness.js:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED 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: REDACTED 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.
3 file(s) (~54 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
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 REDACTED — installs work only by hoisting accident. (×2) — js/topology-layout/worker.js:1, elixir/web-ng/assets/js/utils/chart_axis_grid.test.js:1
Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×4)
Only test files import it (first: elixir/web-ng/assets/js/lib/god_view/world_tile_layer.test.js:5) — move it to devDependencies. — REDACTED:29
Only test files import it (first: js/cli/tests/managed-host.test.mjs:7) — move it to devDependencies. — js/cli/package.json:48
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.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — 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?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/4 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
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 — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
SC1 Supply-chain hygiene — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
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 — 50 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; the BEAM has no dependency-injection container — state lives in processes, and no process is handed an instance whose lifetime another one scopes; this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Ruby imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX6 Interface segregation — AX6 reached only 5% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), rust (200,121 lines), swift (15,798 lines), python (5,815 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — failed to solve: failed to compute cache key: failed to calculate checksum of ref 7f1add72-722d-44cb-954b-4886e5ebf10b::llx7fica5dy706iymilblzj0k: "/elixir/vendor": not found; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — 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's runner produced no measurement
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Elixir, Erlang, Go, JavaScript, Python, Rust, Swift, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
ED2 Event/command shape — no command-shaped messages detected — single-handler-per-command check not applicable
ED5 Idempotency — Not assessed, and this one is on us: 3 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P9 Domain vs controller coverage — coverage data present for 75 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
X1 Async correctness — X1 reached only 20% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 6% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), rust (200,121 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — X14 reached only 37% of this repository's production lines — elixir (843,210 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X15 Unvalidated length from an untrusted reader — X15 reached only 36% of this repository's production lines — elixir (843,210 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X16 Unfloored truncation loop — X16 reached only 5% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), rust (200,121 lines), swift (15,798 lines), python (5,815 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — X2 reached only 36% of this repository's production lines — elixir (843,210 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X21 Side-effecting pattern guard — X21 reached only 20% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 6% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), rust (200,121 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — X25 reached only 6% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), rust (200,121 lines), swift (15,798 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — X26 reached only 18% of this repository's production lines — elixir (843,210 lines), rust (200,121 lines), javascript (62,121 lines), typescript (6,350 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X27 Collection changed while being enumerated — X27 reached only 15% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), javascript (62,121 lines), swift (15,798 lines), typescript (6,350 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X29 Per-element action decided by a fixed element — X29 reached only 20% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), swift (15,798 lines), python (5,815 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X3 Exception handling — X3 reached only 23% of this repository's production lines — elixir (843,210 lines), rust (200,121 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — X30 reached only 36% of this repository's production lines — elixir (843,210 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — X4 reached only 20% of this repository's production lines — elixir (843,210 lines), go (215,499 lines), swift (15,798 lines), erlang (1,586 lines), c (470 lines), objectivec (425 lines), cpp (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score.
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.
Boundary-crossing change coupling: entity_access.ex ↔ mod.rs elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex:1— `elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex` (context elixir) and `rust/srql/src/query/viz/mod.rs` (context rust) sit in DIFFERENT parts of the tree yet 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) — 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 `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `431a1193` no-mistakes(review): Preserve sysmon compatibility and fix analytics …; `68bbe1cb` feat(srql): camera_sources entity and agg:last downsampling — run `git show` on any of them.
Boundary-crossing change coupling: native.ex ↔ client.rs elixir/serviceradar_core/lib/serviceradar/dgraph/native.ex:1— `elixir/serviceradar_core/lib/serviceradar/dgraph/native.ex` (context elixir) and `rust/dgraph-topology/src/client.rs` (context rust) sit in DIFFERENT parts of the tree yet 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) — 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 `d39e7a57` fix(topology): read canonical rebuild inputs in bounded pages; `779e4a96` feat(topology): project CONTAINS edges from virtualization inventory; `0e361501` feat(dgraph): batched device-graph and edge upserts — run `git show` on any of them.
Boundary-crossing change coupling: contract_catalog.ex ↔ push_loop.go elixir/serviceradar_core/lib/serviceradar/edge/contract_catalog.ex:1— `elixir/serviceradar_core/lib/serviceradar/edge/contract_catalog.ex` (context elixir) and `go/pkg/agent/push_loop.go` (context go) sit in DIFFERENT parts of the tree yet change together 79% of the time (11 of the 14 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 11 shared commits counted here, the most recent 3 are `947584c7` feat(edge): deliver bumblebee scans as serviceradar.bumblebee.scan ed…; `2ff13335` feat(edge): add endpoint inventory scan edge record producer and proj…; `880aea5e` feat(agent): emit k8s public endpoint snapshots as edge records (#6315) — run `git show` on any of them.
Boundary-crossing change coupling: sweep.pb.ex ↔ domain.go elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex:1— `elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex` (context elixir) and `go/pkg/edge/edgerecord/domain.go` (context go) sit in DIFFERENT parts of the tree yet change together 71% of the time (10 of the 14 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 10 shared commits counted here, the most recent 3 are `35c50d84` review r2: freeze the plan-global ordinal window model; `3bcaf5a6` review: define the range binding instead of moving it; fix the ledger…; `4cddc01d` feat(edge): authoritative assignment record owns the MTR expectation … — run `git show` on any of them.
Boundary-crossing change coupling: entity_access.ex ↔ ast.rs elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex:1— `elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex` (context elixir) and `rust/srql/src/parser/ast.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 of the 12 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 `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `431a1193` no-mistakes(review): Preserve sysmon compatibility and fix analytics …; `68bbe1cb` feat(srql): camera_sources entity and agg:last downsampling — run `git show` on any of them.
Boundary-crossing change coupling: catalog.ex ↔ entity.rs elixir/web-ng/lib/serviceradar_web_ng_web/srql/catalog.ex:1— `elixir/web-ng/lib/serviceradar_web_ng_web/srql/catalog.ex` (context elixir) and `rust/srql/src/parser/entity.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 62% of the time (8 of the 13 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 `40a61e14` no-mistakes(review): Fix audit filters, coalesce refreshes, remove un…; `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `fa83178c` no-mistakes(review): Remove unsupported singular process query alias — run `git show` on any of them.
Boundary-crossing change coupling: catalog.ex ↔ mod.rs elixir/web-ng/lib/serviceradar_web_ng_web/srql/catalog.ex:1— `elixir/web-ng/lib/serviceradar_web_ng_web/srql/catalog.ex` (context elixir) and `rust/srql/src/query/viz/mod.rs` (context rust) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `431a1193` no-mistakes(review): Preserve sysmon compatibility and fix analytics …; `68bbe1cb` feat(srql): camera_sources entity and agg:last downsampling — run `git show` on any of them.
Boundary-crossing change coupling: sweep.pb.ex ↔ test_patch_edge_enum_negatives.exs elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex:1— `elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex` (context elixir) and `scripts/test_patch_edge_enum_negatives.exs` (context scripts) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `4cddc01d` feat(edge): authoritative assignment record owns the MTR expectation …; `dddf875b` task 1.4: declare MtrCompletionDisposition once as a generated enum; `21fd27b6` feat(edge): edge enum negative retention + semantic validation (usp-v… — run `git show` on any of them.
Boundary-crossing change coupling: sweep.pb.ex ↔ patch_edge_enum_negatives.exs elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex:1— `elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex` (context elixir) and `scripts/patch_edge_enum_negatives.exs` (context scripts) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `4cddc01d` feat(edge): authoritative assignment record owns the MTR expectation …; `dddf875b` task 1.4: declare MtrCompletionDisposition once as a generated enum; `21fd27b6` feat(edge): edge enum negative retention + semantic validation (usp-v… — run `git show` on any of them.
Boundary-crossing change coupling: entity_access.ex ↔ engine.rs elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex:1— `elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex` (context elixir) and `rust/srql/src/query/engine.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 57% of the time (8 of the 14 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 `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `431a1193` no-mistakes(review): Preserve sysmon compatibility and fix analytics …; `68bbe1cb` feat(srql): camera_sources entity and agg:last downsampling — run `git show` on any of them.
Boundary-crossing change coupling: sweep.pb.ex ↔ assignment.go elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex:1— `elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex` (context elixir) and `go/pkg/edge/edgerecord/assignment.go` (context go) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 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 6 shared commits counted here, the most recent 3 are `35c50d84` review r2: freeze the plan-global ordinal window model; `3bcaf5a6` review: define the range binding instead of moving it; fix the ledger…; `4cddc01d` feat(edge): authoritative assignment record owns the MTR expectation … — run `git show` on any of them.
Boundary-crossing change coupling: entity_access.ex ↔ translate.rs elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex:1— `elixir/web-ng/lib/serviceradar_web_ng/srql/entity_access.ex` (context elixir) and `rust/srql/src/query/translate.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 50% of the time (8 of the 16 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 `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `431a1193` no-mistakes(review): Preserve sysmon compatibility and fix analytics …; `68bbe1cb` feat(srql): camera_sources entity and agg:last downsampling — run `git show` on any of them.
Boundary-crossing change coupling: dgraph_persist.ex ↔ client.rs elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_graph/dgraph_persist.ex:1— `elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_graph/dgraph_persist.ex` (context elixir) and `rust/dgraph-topology/src/client.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 50% of the time (7 of the 14 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 7 shared commits counted here, the most recent 3 are `779e4a96` feat(topology): project CONTAINS edges from virtualization inventory; `e1d0cb00` no-mistakes(review): Restore neighbor port names, escape DQL strings,…; `42f31c6b` no-mistakes(ci): Fixed the GPU route lifetime race, bounded/checkpoin… — run `git show` on any of them.
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:138— 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.
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>.
Unlisted import 'd3-scale' elixir/web-ng/assets/js/utils/chart_axis_grid.test.js:1— Imported but not declared in any reachable REDACTED — 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 — 9053 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 429 functions. The bar is 500 significant lines; this is 8553 over it, 18.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: architecture/exposure-reconciliation-audit.openspec.html docs/architecture/exposure-reconciliation-audit.openspec.html— FileTooLong — 7693 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7193 over it, 15.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: architecture/exposure-source-validation.openspec.html docs/architecture/exposure-source-validation.openspec.html— FileTooLong — 7692 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7192 over it, 15.38× 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 — 5201 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 415 functions. The bar is 500 significant lines; this is 4701 over it, 10.40× 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 — 4445 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 372 functions. The bar is 500 significant lines; this is 3945 over it, 8.89× 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 — 3251 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 105 functions. The bar is 500 significant lines; this is 2751 over it, 6.50× 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 — 3147 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 248 functions. The bar is 500 significant lines; this is 2647 over it, 6.29× 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: plugins/show_live.ex elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex— FileTooLong — 2792 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 165 functions. The bar is 500 significant lines; this is 2292 over it, 5.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: awx/main.go go/cmd/wasm-plugins/awx/main.go— FileTooLong — 2725 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2225 over it, 5.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: inventory/hypervisor_enrichment_ingestor.ex elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex— FileTooLong — 2698 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 174 functions. The bar is 500 significant lines; this is 2198 over it, 5.40× 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 — 2683 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 152 functions. The bar is 500 significant lines; this is 2183 over it, 5.37× 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 — 2664 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 221 functions. The bar is 500 significant lines; this is 2164 over it, 5.33× 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 — 2651 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 142 functions. The bar is 500 significant lines; this is 2151 over it, 5.30× 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 — 2641 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 176 functions. The bar is 500 significant lines; this is 2141 over it, 5.28× 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 — 2630 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 150 functions. The bar is 500 significant lines; this is 2130 over it, 5.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: sweep_jobs/sweep_results_ingestor.ex elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex— FileTooLong — 2486 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 164 functions. The bar is 500 significant lines; this is 1986 over it, 4.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: settings/catalog.ex elixir/web-ng/lib/serviceradar_web_ng_web/settings/catalog.ex— FileTooLong — 2435 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 37 functions. The bar is 500 significant lines; this is 1935 over it, 4.87× 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 — 2360 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1860 over it, 4.72× 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: edge/agent_command_bus.ex elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex— FileTooLong — 2312 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 189 functions. The bar is 500 significant lines; this is 1812 over it, 4.62× 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 — 2308 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 190 functions. The bar is 500 significant lines; this is 1808 over it, 4.62× 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 — 2251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 1751 over it, 4.50× 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 — 2105 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 117 functions. The bar is 500 significant lines; this is 1605 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: query/starrocks.rs rust/srql/src/query/starrocks.rs— FileTooLong — 2076 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 98 free functions. The bar is 500 significant lines; this is 1576 over it, 4.15× 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.
+ 359 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×201
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_summary_components.ex:402— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_summary_components.ex:402-405 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/interface_components.ex:837-840 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/composite_checks/scope.ex:121— elixir/serviceradar_core/lib/serviceradar/composite_checks/scope.ex:121-124 | elixir/serviceradar_core/lib/serviceradar/inventory/availability_source_profile_materializer.ex:115-118 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_population.ex:186— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_population.ex:186-194 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/block_fingerprint.ex:258-261 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:278— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:278-281 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:1058-1061 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/prefix_tags/threat_intel_source.ex:77— elixir/serviceradar_core/lib/serviceradar/prefix_tags/threat_intel_source.ex:77-82 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/provider_source.ex:63-66 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_prefix_tags.ex:179— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_prefix_tags.ex:179-182 | elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_values.ex:35-38 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_instance_target.ex:48— elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_instance_target.ex:48-51 | elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_target.ex:48-51 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2639— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2639-2642 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:3186-3189 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:247— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:247-256 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/topology_snapshot_controller.ex:21-24 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/palisade/lib/palisade/network_address_policy.ex:152— elixir/palisade/lib/palisade/network_address_policy.ex:152-155 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:170-173 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/events/audit_writer.ex:300— elixir/serviceradar_core/lib/serviceradar/events/audit_writer.ex:300-303 | elixir/serviceradar_core/lib/serviceradar/events/job_writer.ex:147-150 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:884— elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:884-887 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:977-980 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target.ex:139— elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target.ex:139-142 | elixir/web-ng/lib/serviceradar_web_ng_web/live/security/threat_intel_live/index.ex:1169-1172 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:211— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:211-214 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:256-259 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:213— elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:213-216 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:234-237 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:228— elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:228-231 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:249-252 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards/first_party_packages.ex:217— elixir/web-ng/lib/serviceradar_web_ng/dashboards/first_party_packages.ex:217-220 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:256-259 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:1228— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:1228-1232 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3039-3042 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:893— elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:893-896 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_assignment_planner.ex:240-250 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:196— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:196-199 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:908-913 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:548— elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:548-551 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/discovery_scope.ex:88-91 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1523— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1523-1526 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:143-151 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1651— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1651-1654 | elixir/web-ng/lib/serviceradar_web_ng_web/live/flows/attributed_live.ex:122-125 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/source_observation_data.ex:43— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/source_observation_data.ex:43-46 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1815-1818 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/secret_provider_adapters/open_bao.ex:38— elixir/serviceradar_core/lib/serviceradar/credentials/secret_provider_adapters/open_bao.ex:38-41 | elixir/serviceradar_core/lib/serviceradar/credentials/secret_provider_adapters/stub.ex:44-47 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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: CoordinatorChildren elixir/serviceradar_core/lib/serviceradar/cluster/coordinator_children.ex:1— TooManyFunctions — 65 functions. The bar is 30 functions; this is 35 over it, 2.17× 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: SweepBodyValidate elixir/serviceradar_core/lib/serviceradar/edge/sweep_body_validate.ex:1— TooManyFunctions — 61 functions. The bar is 30 functions; this is 31 over it, 2.03× 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: PublicationIdentity elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.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: Slack elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.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: 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: Storage elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.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: Store elixir/serviceradar_core/lib/serviceradar/prefix_tags/store.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: Assignments elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.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: StatusIngestor elixir/serviceradar_core/lib/serviceradar/ingestion/status_ingestor.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: 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: Application elixir/serviceradar_core/lib/serviceradar/application.ex:1— TooManyFunctions — 48 functions. The bar is 30 functions; this is 18 over it, 1.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: Dgraph elixir/serviceradar_core/lib/serviceradar/dgraph.ex:1— TooManyFunctions — 48 functions. The bar is 30 functions; this is 18 over it, 1.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: UserAuth elixir/web-ng/lib/serviceradar_web_ng_web/user_auth.ex:1— TooManyFunctions — 48 functions. The bar is 30 functions; this is 18 over it, 1.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: CredentialGrants elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.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: RelaySessionManager elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.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: ReleaseSourceImporter elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.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: ResultIngestor elixir/serviceradar_core/lib/serviceradar/ingestion/result_ingestor.ex:1— TooManyFunctions — 45 functions. The bar is 30 functions; this is 15 over it, 1.50× 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: ArchiveAuthorities elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.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: Paths elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/paths.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: CameraMediaSessionTracker elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.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.
Duplicated block (7 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1508— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1508-1519 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/media_identity.ex:71-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:38— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:38-44 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:77-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 (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:625— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:625-631 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:638-644 — both copies are in the same file, so extract the 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/callback_command_contract.ex:455— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:455-461 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:312-318 — 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 11 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:451` calls `expected_broker_inject`, `credential_secret_id_for_verb`, `value` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:310` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:254— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:254-260 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:371-377 — 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_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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:547— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:547-553 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1018-1024 — 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 11 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:547` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:193— elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:193-199 | elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:211-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:189— elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:189-195 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:234-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:232` calls `stringify`, `value` and `elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:187` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) 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/edge/workers/provision_agent_worker.ex:164— elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:164-170 | elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex:135-141 — 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_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:729— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:729-735 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:795-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:729` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:52— elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:52-58 | elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:86-98 — both copies are in the same file, so extract the 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/identity/batch_resolver.ex:346— elixir/serviceradar_core/lib/serviceradar/inventory/identity/batch_resolver.ex:346-352 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/batch_resolver.ex:846-852 — both copies are in the same file, so extract the 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/service_state_registry/assignment_lifecycle.ex:344— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:344-350 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:572-578 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:116— elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:116-122 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:62-68 — 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/stateful_alert_engine/diagnostics.ex:177— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:177-183 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:187-193 — both copies are in the same file, so extract the 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/addon_rollout_artifact.ex:312— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:312-318 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:961-967 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:511` calls `optional_label` and `elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:558` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:612— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:612-618 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:651-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:612` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:66— elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:66-72 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:217-223 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/dashboards/definition.ex:138— elixir/web-ng/lib/serviceradar_web_ng/dashboards/definition.ex:138-144 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_index.ex:97-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/dashboards/definition.ex:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:378— elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:378-384 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:385-391 — both copies are in the same file, so extract the 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/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 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 × 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/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 11 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) 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 5 separate duplicated blocks between them, totalling at least 50 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 163 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 163 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/retention_worker.ex:166— elixir/serviceradar_core/lib/serviceradar/automation/ansible/retention_worker.ex:166-171 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/retention_worker.ex:191-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:473— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:473-478 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:944-949 — 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 11 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:473` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.ex:117— elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.ex:117-122 | elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.ex:156-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 (6 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3444— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3444-3449 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:1061-1066 — 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 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. 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/trivy_reports.ex:407— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:407-412 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1286-1291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1292` calls `normalize_map`, `resource_label` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:413` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:643— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:643-648 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:662-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:650` calls `playback_state` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:669` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:272` calls `map_value` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:232` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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/release_source_importer.ex:186— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:186-191 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:210-216 — both copies are in the same file, so extract the 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_web/components/observability/signal_display_components.ex:346— elixir/web-ng/lib/serviceradar_web_ng_web/components/observability/signal_display_components.ex:346-351 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:5352-5357 — 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/web-ng/lib/serviceradar_web_ng_web/live/camera_relay_live/index.ex:27— elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_relay_live/index.ex:27-32 | elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_relay_live/index.ex:683-688 — both copies are in the same file, so extract the 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_web/live/dashboard_hub_live/index.ex:133— elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_hub_live/index.ex:133-138 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:273-278 — 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/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_state.ex:107— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_state.ex:107-112 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_tags.ex:39-44 — 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_web/live/device_live/index_events/bulk_tags.ex:33— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_tags.ex:33-38 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/selection.ex:129-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_tags.ex:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1069— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1069-1074 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1080-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1069` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:143— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:143-148 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:398-403 — both copies are in the same file, so extract the 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_web/live/log_live/index.ex:504— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:504-509 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:189-194 — 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/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:75— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:75-80 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:112-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) elixir/palisade/lib/palisade/outbound_url_policy.ex:64— elixir/palisade/lib/palisade/outbound_url_policy.ex:64-69 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex:29-34 — before extracting anything, compare `elixir/palisade/lib/palisade/outbound_url_policy.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex` as WHOLE FILES: this scan already matched 6 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. 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 × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:119— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:119-126 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1795-1802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1793` calls `put` and `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:118` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:185— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:185-192 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:234-241 — both copies are in the same file, so extract the 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:523— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:523-530 | 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 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:523` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:525— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:525-532 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:673-680 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:525` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:317— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:317-324 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:777-784 — both copies are in the same file, so extract the 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/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 11 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:49` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:47` calls `get` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:44` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher/ash_adapter.ex:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:523— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:523-530 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:994-1001 — 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 11 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:523` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:182— elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:182-189 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:423-430 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:76— elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:76-83 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:62— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:62-69 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:467— elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:467-474 | elixir/serviceradar_core/lib/serviceradar/credentials/secret_broker.ex:546-553 — both copies are in the same file, so extract the 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/event_writer/processors/logs.ex:737— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:737-744 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1934-1941 — 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/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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1056` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:823` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:95— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:95-102 | 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 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:102` calls `map_value` and `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:130` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:984— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:984-991 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:981-988 — 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/plugins/alert_rule_catalog.ex:174— elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:174-181 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:315-322 — 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/dashboards/packages.ex:797— elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:797-804 | elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:367-374 — 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/devices/manual_device_creator.ex:346— elixir/web-ng/lib/serviceradar_web_ng/devices/manual_device_creator.ex:346-353 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_resource_data.ex:79-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/devices/manual_device_creator.ex:346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:234— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:234-241 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:164-171 — 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 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 (8 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:748— elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:748-755 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:859-866 — 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:77— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:77-84 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:124-131 — 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 8 separate duplicated blocks between them, totalling at least 67 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: rust/srql/src/query/starrocks.rs rust/srql/src/query/starrocks.rs:2437— rust/srql/src/query/starrocks.rs changed 86 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in srql::query::starrocks::field_sql at line 2437. 14 of those changes were fix/bug commits, and the other 72 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/srql/src/query/starrocks.rs`: 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 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 152 in RemoteAccessSSHConsole.Component at line 386. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06: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: rust/srql/src/query/translate.rs rust/srql/src/query/translate.rs:20— rust/srql/src/query/translate.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in srql::query::translate::translate_request at line 20. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/srql/src/query/translate.rs`: 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: rust/flow-collector/src/netflow/converter.rs rust/flow-collector/src/netflow/converter.rs:875— rust/flow-collector/src/netflow/converter.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in Converter::convert_ipfix at line 875. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/flow-collector/src/netflow/converter.rs`: 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/WorldMapRenderer.js elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:565— elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in WorldMapRenderer.syncMembership at line 565. 16 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.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/native/god_view_nif/src/bitmap_index.rs elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:462— elixir/web-ng/native/god_view_nif/src/bitmap_index.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in Index::publish_complete at line 462. 14 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/native/god_view_nif/src/bitmap_index.rs`: 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: go/pkg/edge/spool/spool.go go/pkg/edge/spool/spool.go:477— go/pkg/edge/spool/spool.go changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in Spool.commit at line 477. 8 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/edge/spool/spool.go`: 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/world_tile_layer.js elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:328— elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in WorldTileLayer.renderSubLayers at line 328. 9 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/assets/js/lib/god_view/world_tile_layer.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/inventory/identity/merge_engine.ex elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:441— elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in MergeEngine.do_merge_devices at line 441. 6 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06: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/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 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in layout_elk_scene.validateTopologyScene at line 1030. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06: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: go/pkg/agent/push_loop_capabilities.go go/pkg/agent/push_loop_capabilities.go:1026— go/pkg/agent/push_loop_capabilities.go changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in agent.parseSystemdUnitStatusOutputForUnit at line 1026. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/agent/push_loop_capabilities.go`: 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/analytics/starrocks/rows.ex elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:171— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in Rows.encode_row at line 171. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.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: REDACTED REDACTED:10— REDACTED changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in god_view_million_browser.main at line 10. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:330— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in HypervisorEnrichmentIngestor.persist_records at line 330. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_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.
Hotspot: rust/flow-collector/src/config.rs rust/flow-collector/src/config.rs:566— rust/flow-collector/src/config.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Config::validate at line 566. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/flow-collector/src/config.rs`: 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: rust/srql/src/query/devices/filters.rs rust/srql/src/query/devices/filters.rs:68— rust/srql/src/query/devices/filters.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in srql::query::devices::filters::apply_filter at line 68. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/srql/src/query/devices/filters.rs`: 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_bitmap_gpu_harness.js elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:11— elixir/web-ng/assets/god_view_bitmap_gpu_harness.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in god_view_bitmap_gpu_harness.mountBitmapGpuHarness at line 11. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/assets/god_view_bitmap_gpu_harness.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: go/pkg/agent/control_stream.go go/pkg/agent/control_stream.go:229— go/pkg/agent/control_stream.go changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PushLoop.controlStreamLoop at line 229. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/agent/control_stream.go`: 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: integration_tests/srql_parity/src/fixture.rs integration_tests/srql_parity/src/fixture.rs:400— integration_tests/srql_parity/src/fixture.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in srql_parity::fixture::metrics at line 400. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- integration_tests/srql_parity/src/fixture.rs`: 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: go/pkg/sweeper/sweeper_run.go go/pkg/sweeper/sweeper_run.go:248— go/pkg/sweeper/sweeper_run.go changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in NetworkSweeper.runSweep at line 248. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/sweeper/sweeper_run.go`: 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: go/pkg/agent/push_loop_addons.go go/pkg/agent/push_loop_addons.go:326— go/pkg/agent/push_loop_addons.go changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks at line 326. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/agent/push_loop_addons.go`: 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: go/pkg/agent/push_loop_config.go go/pkg/agent/push_loop_config.go:152— go/pkg/agent/push_loop_config.go changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in PushLoop.applyConfigResponseWithSequence at line 152. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/agent/push_loop_config.go`: 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/addon_fleet.ex elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.ex:416— elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.ex changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in AddonFleet.build_row at line 416. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.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: rust/topology-atlas/src/tiles.rs rust/topology-atlas/src/tiles.rs:379— rust/topology-atlas/src/tiles.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in World::plan at line 379. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/topology-atlas/src/tiles.rs`: 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:119— elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in rendering_graph_data_methods.deterministicRelationPresentation at line 119. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06: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.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:822— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:822-826 | elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1139-1143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:822` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:602— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:602-606 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:521-525 — 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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: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:242-247 — 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 10 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_reaper.ex:140— elixir/serviceradar_core/lib/serviceradar/camera/relay_session_reaper.ex:140-144 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/execution_reaper.ex:140-144 — 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/edge/nats_leaf_server.ex:368— elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:368-372 | elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:399-403 — both copies are in the same file, so extract the 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/bumblebee_catalog_refresh_worker.ex:324— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_worker.ex:324-328 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_worker.ex:384-388 — both copies are in the same file, so extract the 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:478— elixir/serviceradar_core/lib/serviceradar/inventory/identity/ids.ex:478-482 | 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:91— elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:91-95 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:102-106 — both copies are in the same file, so extract the 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/plugin_result_ingestor.ex:372— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:372-376 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1196-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:372` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:60— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:60-64 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/router.ex:143-147 — 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/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:83— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:83-87 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:104-108 — both copies are in the same file, so extract the 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/live/admin/cluster_live/index.ex:89— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:89-93 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:100-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:417— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:417-421 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:409-413 — `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 125 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:417` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:292— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:292-296 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1651-1655 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_data/availability.ex:80— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_data/availability.ex:80-84 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_data/availability.ex:91-95 — both copies are in the same file, so extract the 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/live/device_live/index_events/selection.ex:35— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/selection.ex:35-39 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_view.ex:29-33 — 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/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:566— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:566-570 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:611-615 — both copies are in the same file, so extract the 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/live/netflow_live/visualize/events.ex:299— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:299-304 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:321-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 (5 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1657— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1657-1661 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1753-1757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1657` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:893— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:893-897 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:903-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:893` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/palisade/lib/palisade/outbound_url_policy.ex:128— elixir/palisade/lib/palisade/outbound_url_policy.ex:128-132 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex:93-97 — before extracting anything, compare `elixir/palisade/lib/palisade/outbound_url_policy.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex` as WHOLE FILES: this scan already matched 6 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/palisade/lib/palisade/outbound_url_policy.ex:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:376— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:376-385 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:341-345 — 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 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) elixir/palisade/lib/palisade/outbound_url_policy.ex:93— elixir/palisade/lib/palisade/outbound_url_policy.ex:93-101 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex:58-66 — before extracting anything, compare `elixir/palisade/lib/palisade/outbound_url_policy.ex` and `elixir/serviceradar_core/lib/serviceradar/policies/outbound_url_policy.ex` as WHOLE FILES: this scan already matched 6 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. 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 × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:234— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:234-242 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:252-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/mix/tasks/serviceradar.hardware_serial_backfill.ex:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:705— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:705-713 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1139-1147 — 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 11 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) 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 163 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/controller_provenance.ex:767— elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:767-775 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:814-822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:767` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) 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 10 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:183— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:183-191 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:213-221 — 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 10 separate duplicated blocks between them, totalling at least 76 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:156` calls `suppress_invocation` and `elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:129` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_installation.ex:136— elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_installation.ex:136-144 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_preparation.ex:142-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_installation.ex:136` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:446— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:446-454 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:486-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:157— elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:157-169 | elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:285-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:339— elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:339-347 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_capabilities.ex:105-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1171` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/remote_access_ssh_identity_issuer.ex:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) 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/inventory/bumblebee_ingestor.ex:539— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:539-547 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_payload.ex:213-221 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:536` calls `datetime_value` and `elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_payload.ex:210` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/dpi.ex:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:2007— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:2007-2015 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:3107-3116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:406` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/monitoring/alert_generator.ex:96` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2787— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2787-2795 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:3024-3032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2787` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_addon_id.ex:50— elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_addon_id.ex:50-58 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_addon_assignment.ex:64-72 — 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_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:50— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:50-59 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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/automation_result_sanitizer.ex:269— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:269-278 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:283-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:219— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:219-228 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/lifecycle.ex:159-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:839` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 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_command_result_coordinator.ex:2535— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2535-2544 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1532-1541 — 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 163 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/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 11 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:404` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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:1305-1314 — 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/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/ephemeral_device_expiry.ex:345— elixir/serviceradar_core/lib/serviceradar/inventory/ephemeral_device_expiry.ex:345-354 | elixir/serviceradar_core/lib/serviceradar/inventory/source_retired_expiry.ex:273-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/ephemeral_device_expiry.ex:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:1330— elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:1330-1339 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:971-980 — 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/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 17 separate duplicated blocks between them, totalling at least 269 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/jobs/refresh_trace_summaries_worker.ex:521— elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:521-530 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass_worker.ex:201-210 — 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/observability/netflow_oui_dataset_refresh_worker.ex:181— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:181-190 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:203-212 — 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 151 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:129— elixir/serviceradar_core/lib/serviceradar/observability/oban_failure_event_reporter.ex:129-138 | elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex:81-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/oban_failure_event_reporter.ex:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex` and `elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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_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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:217` calls `map_value` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:263` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:51— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:51-60 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:78-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:861` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1058— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1058-1067 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1071-1080 — both copies are in the same file, so extract the 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
+ 87 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×102
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/history_repair.ex:133— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/history_repair.ex:133-142 | elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/history_repair.ex:146-153 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:111— elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:111-118 | elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:137-144 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:49— elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:49-56 | elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:76-84 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:2099— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:2099-2106 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:2110-2121 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/batch_resolver.ex:343— elixir/serviceradar_core/lib/serviceradar/inventory/identity/batch_resolver.ex:343-353 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/batch_resolver.ex:418-425 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:46— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:46-54 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:69-76 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/resolver.ex:734— elixir/serviceradar_core/lib/serviceradar/inventory/identity/resolver.ex:734-742 | elixir/serviceradar_core/lib/serviceradar/plugins/native_addon_importer.ex:339-346 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/native/dgraph_nif/src/call.rs:157— elixir/serviceradar_core/native/dgraph_nif/src/call.rs:157-164 | elixir/serviceradar_core/native/topology_atlas_nif/src/async_read.rs:100-107 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1488— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1488-1504 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:589-596 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:382— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:382-391 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:744-751 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:498— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:498-505 | elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:225-233 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1069— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1069-1076 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1080-1087 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:292— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:292-308 | elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/status_ingestor.ex:259-266 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/mtr_baseline_scheduler.ex:192— elixir/serviceradar_core/lib/serviceradar/observability/mtr_baseline_scheduler.ex:192-199 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_ip_enrichment.ex:39-47 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:115— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:115-122 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:126-133 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/recorder_ownership.ex:168— elixir/serviceradar_core/lib/serviceradar/camera/recorder_ownership.ex:168-179 | elixir/serviceradar_core/lib/serviceradar/camera/recording_blocks.ex:137-144 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/alias_guard.ex:184— elixir/serviceradar_core/lib/serviceradar/inventory/identity/alias_guard.ex:184-191 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/duplicate_sweep.ex:1134-1141 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/interface_macs.ex:68— elixir/serviceradar_core/lib/serviceradar/inventory/identity/interface_macs.ex:68-75 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/interface_macs.ex:86-97 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/topology_query_controller.ex:36— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/topology_query_controller.ex:36-43 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/topology_tile_controller.ex:281-288 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:3148— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:3148-3160 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:3171-3178 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/integrations/integration_source.ex:706— elixir/serviceradar_core/lib/serviceradar/integrations/integration_source.ex:706-720 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:2921-2928 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/sweep_correlate.ex:229— elixir/serviceradar_core/lib/serviceradar/edge/sweep_correlate.ex:229-236 | elixir/serviceradar_core/lib/serviceradar/edge/sweep_correlate.ex:269-279 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/census.ex:61— elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/census.ex:61-69 | elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/mdns.ex:48-55 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:348— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:348-355 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:359-368 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:944— elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:944-951 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:959-968 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 77 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×99
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:275— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:275-281 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:473-479 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:325— elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:325-332 | elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:536-542 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3442— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3442-3449 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:1060-1066 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/cluster/cluster_health.ex:485— elixir/serviceradar_core/lib/serviceradar/cluster/cluster_health.ex:485-492 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/edge_pipeline.ex:108-114 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:719— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:719-730 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1129-1135 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:144— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:144-151 | elixir/serviceradar_nvr/lib/serviceradar_nvr/session.ex:66-72 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/source_facts/reports.ex:26— elixir/serviceradar_core/lib/serviceradar/inventory/source_facts/reports.ex:26-34 | elixir/serviceradar_core/lib/serviceradar/inventory/source_facts/reports.ex:39-45 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/ocsf.ex:309— elixir/serviceradar_core/lib/serviceradar/event_writer/ocsf.ex:309-315 | elixir/serviceradar_core/lib/serviceradar/event_writer/ocsf.ex:334-340 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:204— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:204-210 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:242-252 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/plugin_input_payload_builder.ex:28— elixir/serviceradar_core/lib/serviceradar/plugins/plugin_input_payload_builder.ex:28-34 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authorization_live.ex:711-719 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:84— elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:84-90 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_direct_leaf_access.ex:110-116 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:89— elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:89-95 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/state_events.ex:99-106 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/managed_component_controller.ex:51— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/managed_component_controller.ex:51-57 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/managed_component_controller.ex:61-67 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/managed_component_controller.ex:81— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/managed_component_controller.ex:81-87 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/managed_component_controller.ex:91-97 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:167— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:167-173 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/source_queries.ex:269-275 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) rust/srql/src/query/otel_metrics.rs:363— rust/srql/src/query/otel_metrics.rs:363-370 | rust/srql/src/query/traces.rs:209-215 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/identity/privileged_membership.ex:102— elixir/serviceradar_core/lib/serviceradar/identity/privileged_membership.ex:102-114 | elixir/serviceradar_core/lib/serviceradar/identity/role_profile_policy.ex:92-98 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1124— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1124-1130 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1357-1363 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1419— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1419-1426 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1430-1436 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowDecoder.swift:266— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowDecoder.swift:266-272 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowDecoder.swift:369-375 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:320— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:320-326 | elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:330-341 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_instance_target.ex:24— elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_instance_target.ex:24-30 | elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_target.ex:24-30 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/ingestion/status_ingestor.ex:252— elixir/serviceradar_core/lib/serviceradar/ingestion/status_ingestor.ex:252-258 | elixir/serviceradar_core/lib/serviceradar/ingestion/status_ingestor.ex:382-389 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_worker.ex:211— elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_worker.ex:211-217 | elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_worker.ex:221-227 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6001— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6001-6007 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6108-6114 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 74 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×89
Edited copy of a member (12 corresponding lines) rust/dgraph-topology/src/reads.rs:356— rust/dgraph-topology/src/reads.rs:356-378 | rust/dgraph-topology/src/reads.rs:407-418 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:660— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:660-673 | elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl:135-146 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) 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-2446 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1363-1374 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:220— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:220-231 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_trace.ex:390-401 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:55— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:55-66 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/router.ex:138-149 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:160— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:160-171 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:135-151 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:440— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:440-454 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:483-494 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:102— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:102-113 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:110-121 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:815— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:815-834 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:838-849 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) 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-862 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1871-1882 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:182— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:182-193 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:201-212 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:80— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:80-91 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:80-94 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) config/manager_secret/elixir/lib/serviceradar_secret.ex:58— config/manager_secret/elixir/lib/serviceradar_secret.ex:58-69 | elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:252-264 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:43— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:43-54 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:58-70 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:206— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:206-217 | elixir/serviceradar_core/lib/serviceradar/notifications/template_seeder.ex:115-126 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:647— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:647-658 | elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl:113-133 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:1198— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:1198-1209 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:1213-1224 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:656— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:656-671 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass.ex:290-301 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:19— elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:19-30 | elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:61-73 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) rust/srql/src/query/dashboard_service_views.rs:17— rust/srql/src/query/dashboard_service_views.rs:17-28 | rust/srql/src/query/dashboards.rs:18-29 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1372— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1372-1383 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:230-244 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:188— elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:188-199 | elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:206-217 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/prefix_tags/trie.ex:285— elixir/serviceradar_core/lib/serviceradar/prefix_tags/trie.ex:285-296 | elixir/serviceradar_core/lib/serviceradar/types/cidr.ex:53-66 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery.ex:73— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery.ex:73-84 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery.ex:58-69 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:961— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:961-972 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1934-1946 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
FunctionTooLong: exposure-reconciliation-audit.openspec.html.Archify.guidedViews docs/architecture/exposure-reconciliation-audit.openspec.html:10335— FunctionTooLong — Archify.guidedViews runs 1393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1293 over it, 13.93× 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: exposure-source-validation.openspec.html.Archify.guidedViews docs/architecture/exposure-source-validation.openspec.html:9590— FunctionTooLong — Archify.guidedViews runs 1393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1293 over it, 13.93× 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: exposure-reconciliation-audit.openspec.html.Archify.focus docs/architecture/exposure-reconciliation-audit.openspec.html:8689— FunctionTooLong — Archify.focus runs 1232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1132 over it, 12.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: exposure-source-validation.openspec.html.Archify.focus docs/architecture/exposure-source-validation.openspec.html:7944— FunctionTooLong — Archify.focus runs 1232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1132 over it, 12.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: 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: exposure-reconciliation-audit.openspec.html.Archify.routeProbe docs/architecture/exposure-reconciliation-audit.openspec.html:14078— FunctionTooLong — Archify.routeProbe runs 879 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 779 over it, 8.79× 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: exposure-source-validation.openspec.html.Archify.routeProbe docs/architecture/exposure-source-validation.openspec.html:13333— FunctionTooLong — Archify.routeProbe runs 879 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 779 over it, 8.79× 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: exposure-reconciliation-audit.openspec.html.Archify.semanticLens docs/architecture/exposure-reconciliation-audit.openspec.html:15113— FunctionTooLong — Archify.semanticLens runs 573 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 473 over it, 5.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.
FunctionTooLong: exposure-source-validation.openspec.html.Archify.semanticLens docs/architecture/exposure-source-validation.openspec.html:14368— FunctionTooLong — Archify.semanticLens runs 573 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 473 over it, 5.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.
FunctionTooLong: exposure-reconciliation-audit.openspec.html.Archify.radar docs/architecture/exposure-reconciliation-audit.openspec.html:13109— FunctionTooLong — Archify.radar runs 540 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 440 over it, 5.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: exposure-source-validation.openspec.html.Archify.radar docs/architecture/exposure-source-validation.openspec.html:12364— FunctionTooLong — Archify.radar runs 540 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 440 over it, 5.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: 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: god_view_million_browser.main REDACTED:10— FunctionTooLong — main runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.31× 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_elk_scene_harness.start elixir/web-ng/assets/god_view_elk_scene_harness.js:106— FunctionTooLong — start runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× 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: exposure-reconciliation-audit.openspec.html.Archify.finder docs/architecture/exposure-reconciliation-audit.openspec.html:13811— FunctionTooLong — Archify.finder runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: exposure-source-validation.openspec.html.Archify.finder docs/architecture/exposure-source-validation.openspec.html:13066— FunctionTooLong — Archify.finder runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: god_view_nif::core::arrow_serde::encode_snapshot_with_metadata elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:107— FunctionTooLong — god_view_nif::core::arrow_serde::encode_snapshot_with_metadata runs 209 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 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: srql::query::devices::filters::apply_filter rust/srql/src/query/devices/filters.rs:68— FunctionTooLong — srql::query::devices::filters::apply_filter runs 206 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 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RemoteAccessTerminal.Component elixir/web-ng/assets/component/src/RemoteAccessTerminal.jsx:125— FunctionTooLong — Component runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: srql::query::timeseries_metrics::build_interface_profile_hour_of_week_query REDACTED:1221— 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: 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: god_view_bitmap_gpu_harness.mountBitmapGpuHarness elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:11— FunctionTooLong — mountBitmapGpuHarness runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× 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.
+ 63 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×88
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1230— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1230-1243 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1249-1261 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1306— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1306-1318 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:633-645 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) rust/dgraph-migrate/src/utils/schema.rs:122— rust/dgraph-migrate/src/utils/schema.rs:122-134 | rust/dgraph-migrate/src/utils/schema.rs:136-148 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1415— swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1415-1427 | swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1480-1492 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:655— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:655-677 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:685-697 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:88— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:88-102 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:71-83 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/service.ex:17— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/service.ex:17-29 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/service.ex:41-53 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/attribution.ex:39— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/attribution.ex:39-51 | elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:123-136 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:1402— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:1402-1415 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:1448-1460 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) go/pkg/agent/camera_relay_control.go:197— go/pkg/agent/camera_relay_control.go:197-209 | go/pkg/agent/camera_relay_control.go:335-347 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) rust/srql/src/query/mtr_hops.rs:308— rust/srql/src/query/mtr_hops.rs:308-320 | rust/srql/src/query/mtr_hops.rs:347-359 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/session.ex:124— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/session.ex:124-136 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/session.ex:147-161 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/ids.ex:478— elixir/serviceradar_core/lib/serviceradar/inventory/identity/ids.ex:478-490 | elixir/serviceradar_core/lib/serviceradar/observability/service_identity.ex:59-74 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:286— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:286-298 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:413-430 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:176— elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:176-188 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rule_matcher.ex:87-102 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:498— elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:498-510 | elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:514-526 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:543— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:543-555 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:535-547 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:89— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:89-105 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/router.ex:153-165 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:615— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:615-627 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:635-647 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9541— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9541-9553 | elixir/web-ng/lib/serviceradar_web_ng_web/netflow_visualize/query.ex:286-298 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) rust/anomaly-disposition/src/disposition/capacity/holt_winters.rs:333— rust/anomaly-disposition/src/disposition/capacity/holt_winters.rs:333-345 | rust/anomaly-disposition/src/disposition/capacity/linear.rs:156-170 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_identity_issuer.ex:236— elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_identity_issuer.ex:236-248 | elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_identity_issuer.ex:255-267 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/consumer_reconciler.ex:298— elixir/serviceradar_core/lib/serviceradar/event_writer/consumer_reconciler.ex:298-321 | elixir/serviceradar_core/lib/serviceradar/event_writer/consumer_reconciler.ex:325-337 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex:763— elixir/web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex:763-775 | elixir/web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex:779-791 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) rust/srql/src/query/endpoint_package_catalog.rs:101— rust/srql/src/query/endpoint_package_catalog.rs:101-113 | REDACTED:765-782 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 63 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×86
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.
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/canvas_state.ex:205— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/canvas_state.ex:205-211 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:329-334 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/BitUtility.swift:27— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/BitUtility.swift:27-32 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/BitUtility.swift:34-39 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9618— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9618-9623 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9664-9678 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:426— elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:426-431 | elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:498-503 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:1168— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:1168-1173 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:590-595 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:339— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:339-345 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1203-1208 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/resolved_prefix.ex:210— elixir/serviceradar_core/lib/serviceradar/edge/resolved_prefix.ex:210-231 | elixir/serviceradar_core/lib/serviceradar/edge/resolved_prefix.ex:258-263 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:1180— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:1180-1188 | elixir/serviceradar_nvr/lib/serviceradar_nvr/disk.ex:72-77 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:504— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:504-509 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:939-944 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/source_queries.ex:111— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/source_queries.ex:111-116 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/source_queries.ex:140-145 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:162— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:162-174 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:198-203 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/service_health.ex:234— elixir/serviceradar_core/lib/serviceradar/observability/service_health.ex:234-239 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/metrics.ex:156-162 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/ansible_automation.ex:73— elixir/web-ng/lib/serviceradar_web_ng/ansible_automation.ex:73-78 | elixir/web-ng/lib/serviceradar_web_ng/ansible_automation.ex:112-117 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mtr_jobs.ex:30— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mtr_jobs.ex:30-35 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mtr_jobs.ex:41-46 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:1216— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:1216-1221 | elixir/serviceradar_core/lib/serviceradar/plugins/secret_refs.ex:495-506 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_recovery_control.ex:80— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_recovery_control.ex:80-91 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_recovery_copy_grants.ex:92-97 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:602— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:602-607 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:521-526 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:133— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:133-138 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:146-153 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:648— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:648-653 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:658-663 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/integration_identity.ex:473— elixir/serviceradar_core/lib/serviceradar/inventory/integration_identity.ex:473-478 | elixir/serviceradar_core/lib/serviceradar/plugins/payload_utils.ex:26-31 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:738— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:738-744 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:568-573 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/ingestor_ash_actions.ex:113— elixir/serviceradar_core/lib/serviceradar/automation/ansible/ingestor_ash_actions.ex:113-118 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:215-220 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:830— elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:830-842 | elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:707-712 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:349— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:349-355 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:385-390 — 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.
+ 61 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×84
Edited copy of a member (10 corresponding lines) rust/kvutil/src/lib.rs:135— rust/kvutil/src/lib.rs:135-144 | rust/kvutil/src/lib.rs:168-180 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:292— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:292-301 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1650-1663 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_storage_config.ex:21— elixir/serviceradar_core/lib/serviceradar/camera/archive_storage_config.ex:21-30 | elixir/serviceradar_core/lib/serviceradar/camera/archive_storage_config.ex:71-80 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:2131— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:2131-2140 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:2153-2162 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/catalog.ex:166— elixir/serviceradar_core/lib/serviceradar/automation/northbound/catalog.ex:166-175 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/catalog.ex:179-193 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:190— elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:190-199 | elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:209-226 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/anomaly_addon_profile_seeder.ex:109— elixir/serviceradar_core/lib/serviceradar/plugins/anomaly_addon_profile_seeder.ex:109-118 | elixir/serviceradar_core/lib/serviceradar/plugins/anomaly_addon_profile_seeder.ex:138-147 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_qualifications.ex:157— elixir/serviceradar_core/lib/serviceradar/camera/archive_qualifications.ex:157-166 | elixir/serviceradar_core/lib/serviceradar/camera/recording_control.ex:183-192 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:783— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:783-801 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:810-819 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/stream_reader.ex:300— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/stream_reader.ex:300-312 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/stream_reader.ex:316-325 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:418— elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:418-427 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery/authority.ex:114-124 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/index.ex:553— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/index.ex:553-570 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/index.ex:574-583 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/events.ex:249— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/events.ex:249-262 | elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:672-681 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:327— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:327-336 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:497-506 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/recovery_validate.ex:304— elixir/serviceradar_core/lib/serviceradar/edge/recovery_validate.ex:304-313 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_validate.ex:671-687 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:58— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:58-68 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/reference_analysis_worker.ex:57-66 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1752— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1752-1761 | elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:424-434 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) rust/fieldsurvey-sidekick/src/api/handlers.rs:203— rust/fieldsurvey-sidekick/src/api/handlers.rs:203-212 | rust/fieldsurvey-sidekick/src/api/handlers.rs:219-229 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:943— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:943-952 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:956-965 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) 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-94 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/gateway_auth.ex:390-401 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:1007— elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:1007-1022 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/single_enabled_addon_profile.ex:89-98 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:73— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:73-82 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:123-136 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) go/pkg/agent/kv.go:61— go/pkg/agent/kv.go:61-72 | go/pkg/config/kvgrpc/client.go:48-57 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:137— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:137-146 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:150-159 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) rust/srql/src/query/mtr_hops.rs:968— rust/srql/src/query/mtr_hops.rs:968-977 | rust/srql/src/query/mtr_traces.rs:1346-1359 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (11 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:323— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:323-334 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:511-521 — both copies are in the same file, so extract the 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:161— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:161-171 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:179-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 (11 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:376— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:376-386 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:831-841 — both copies are in the same file, so extract the 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_launch_orchestrator.ex:385— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:385-395 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:769-779 — 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/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:554— elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:554-564 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:587-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:554` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:686— elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:686-696 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:708-718 — both copies are in the same file, so extract the 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/edge/agent_config_generator.ex:1251— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1251-1261 | elixir/serviceradar_core/lib/serviceradar/edge/agent_release_manager.ex:1024-1034 — 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/event_writer/processors/falco_events.ex:532— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:532-542 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1611-1621 — 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 12 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/integrations/armis_northbound_runner.ex:206— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:206-216 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:170-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_artifact.ex:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_history.ex:82— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_history.ex:82-92 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:710-720 — 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:1358— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1358-1368 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1430-1440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1358` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:418— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:418-428 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:385-395 — 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 170 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/object_store/native_addon_artifact_retention.ex:310— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:310-320 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:216-226 — 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 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-190 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:665-675 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:296— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:296-306 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_investigation.ex:315-325 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_investigation.ex:315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:72— elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:72-82 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:73-83 — 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 12 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:52— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:52-62 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:78-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:52` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:519— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:519-529 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:544-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:519` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1097— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1097-1107 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1120-1130 — both copies are in the same file, so extract the 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:173— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:173-183 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:206-216 — `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 7 separate duplicated blocks between them, totalling at least 60 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/edge/enrollment_token.ex:266— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:266-276 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:196-206 — 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 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 (11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:109— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:109-119 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:409-419 — 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 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
+ 58 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×81
Edited copy of a member (9 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/component_identity_resolver.ex:454— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/component_identity_resolver.ex:454-466 | elixir/serviceradar_core/lib/serviceradar/spiffe.ex:476-487 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_recording/lib/serviceradar_recording/spool.ex:183— elixir/serviceradar_recording/lib/serviceradar_recording/spool.ex:183-191 | elixir/serviceradar_recording/lib/serviceradar_recording/spool.ex:219-228 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2256— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2256-2264 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:1044-1060 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_usage.ex:573— elixir/serviceradar_core/lib/serviceradar/credentials/credential_usage.ex:573-586 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_usage.ex:590-598 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:1280— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:1280-1289 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:155-163 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_srql/native/srql_nif/src/lib.rs:31— elixir/serviceradar_srql/native/srql_nif/src/lib.rs:31-39 | elixir/serviceradar_srql/native/srql_nif/src/lib.rs:280-292 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:136— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:136-144 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_secret_controller.ex:70-80 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/topology_tile_channel.ex:276— elixir/web-ng/lib/serviceradar_web_ng_web/channels/topology_tile_channel.ex:276-284 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/topology_tile_controller.ex:256-264 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:962— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:962-970 | elixir/web-ng/lib/serviceradar_web_ng/nvr_publication_listener.ex:61-69 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rust/flow-collector/src/netflow/converter.rs:1351— rust/flow-collector/src/netflow/converter.rs:1351-1359 | rust/flow-collector/src/netflow/converter.rs:1361-1369 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:72— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:72-80 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:84-92 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rust/anomaly-core/src/esd.rs:211— rust/anomaly-core/src/esd.rs:211-219 | rust/anomaly-core/src/scorecard.rs:130-139 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:173— elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:173-181 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:314-322 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:84— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:84-92 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:210-221 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/zen/normalizer.ex:229— elixir/serviceradar_core/lib/serviceradar/observability/zen/normalizer.ex:229-237 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:680-691 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:109— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:109-118 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/scan_controller.ex:122-130 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/plugin_assignment_recovery.ex:1034— elixir/serviceradar_core/lib/serviceradar/plugins/plugin_assignment_recovery.ex:1034-1043 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_assignment_recovery.ex:1047-1055 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1982— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1982-1990 | elixir/serviceradar_core/lib/serviceradar/inventory/device_snmp_fact_writer.ex:197-211 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/notification_callback_app_controller.ex:128— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/notification_callback_app_controller.ex:128-136 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:473-483 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/ingress_id.ex:21— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/ingress_id.ex:21-29 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/otlp_relay.ex:420-429 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:299— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:299-307 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:311-322 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rust/fieldsurvey-sidekick/src/adaptive_scan.rs:328— rust/fieldsurvey-sidekick/src/adaptive_scan.rs:328-336 | rust/fieldsurvey-sidekick/src/capture.rs:260-268 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_interfaces.ex:62— elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_interfaces.ex:62-71 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_topology.ex:61-69 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:241— elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:241-249 | elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:268-276 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:77— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:77-85 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:57-65 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 56 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×79
Edited copy of a member (15 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-147 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:167-182 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1241— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1241-1257 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1261-1277 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:240— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArrayBuilder.swift:240-254 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowDecoder.swift:154-173 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:34— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:34-48 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_evidence.ex:106-122 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:143— elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:143-176 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:647-661 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:241— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:241-259 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:331-345 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:308— elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:308-322 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:357-372 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) 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-173 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:177-191 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:233— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:233-247 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:251-265 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:322— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:322-341 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:447-461 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/auth/authorization_audit.ex:108— elixir/web-ng/lib/serviceradar_web_ng_web/auth/authorization_audit.ex:108-124 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/authorization_audit.ex:128-142 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:161— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:161-178 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:182-196 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:22— elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:22-39 | elixir/web-ng/lib/serviceradar_web_ng_web/nvr_publication_router.ex:23-37 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/record.ex:166— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/record.ex:166-180 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/record.ex:225-240 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:24— elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:24-39 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:28-42 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) 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-45 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:51-65 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:628— elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:628-642 | elixir/web-ng/native/god_view_nif/src/lib.rs:150-169 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:66— elixir/serviceradar_core/lib/serviceradar/plugins/alert_rule_catalog.ex:66-80 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:80-94 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:52— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:52-66 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:51-66 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:137— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:137-154 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:158-172 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) rust/srql/src/query/downsample.rs:23— rust/srql/src/query/downsample.rs:23-46 | rust/srql/src/query/security_events.rs:26-40 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_host_keys.ex:93— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_host_keys.ex:93-107 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_host_keys.ex:113-127 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:18— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:18-33 | elixir/web-ng/lib/serviceradar_web_ng_web/live/flows/attributed_live.ex:350-364 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:239— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:239-253 | elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:313-329 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:863— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:863-877 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:1270-1288 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 54 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×76
Edited copy of a member (14 corresponding lines) swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1295— swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1295-1312 | swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1314-1327 — 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/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-2478 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1393-1406 — 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/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:1330— elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:1330-1343 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:969-992 — 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/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:401— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:401-414 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:444-466 — 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/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:43— elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:43-56 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:67-80 — 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/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-90 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:87-100 — 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/components/promotion_rule_builder.ex:561— elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:561-576 | elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:598-611 — 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/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2529— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2529-2544 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1528-1541 — 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) rust/fieldsurvey-sidekick/src/arrow_stream.rs:69— rust/fieldsurvey-sidekick/src/arrow_stream.rs:69-82 | rust/fieldsurvey-sidekick/src/arrow_stream.rs:84-97 — 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/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1670— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1670-1685 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1689-1702 — 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/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1600— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1600-1613 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1617-1630 — 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/channels/remote_access_stream_handler.ex:697— elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:697-714 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:718-731 — 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/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_nodes.ex:101— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_nodes.ex:101-114 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_public_endpoints.ex:104-120 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_delivery.ex:618— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_delivery.ex:618-631 | elixir/web-ng/lib/serviceradar_web_ng/ansible_automation/history.ex:231-244 — 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/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass.ex:206— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass.ex:206-219 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:415-431 — 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) go/pkg/agent/push_loop_endpoint_inventory_edge.go:164— go/pkg/agent/push_loop_endpoint_inventory_edge.go:164-179 | go/pkg/agent/push_loop_endpoint_inventory_edge.go:184-197 — 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/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:92— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:92-105 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pubsub_sink.ex:29-44 — 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) go/pkg/agent/proxmox_console_ssh.go:464— go/pkg/agent/proxmox_console_ssh.go:464-477 | go/pkg/agent/remoteaccess/ssh.go:403-416 — 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/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:516— elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:516-529 | elixir/web-ng/lib/serviceradar_web_ng/plugins/upload_signature.ex:132-145 — 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/network_credential_rules_live.ex:1641— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1641-1654 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1658-1673 — 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) rust/srql/src/query/sweep_groups.rs:82— rust/srql/src/query/sweep_groups.rs:82-95 | rust/srql/src/query/sweep_profiles.rs:129-154 — 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) go/pkg/agent/desktop_media_sender.go:404— go/pkg/agent/desktop_media_sender.go:404-417 | go/pkg/agent/desktop_media_sender.go:419-434 — 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/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:209— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:209-223 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:231-244 — 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/serviceradar_core/lib/serviceradar/network_discovery/route_analyzer.ex:209— elixir/serviceradar_core/lib/serviceradar/network_discovery/route_analyzer.ex:209-222 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:147-160 — 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) REDACTED:291— REDACTED:291-304 | REDACTED:392-405 — 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.
Duplicated block (12 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:210— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:210-221 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:257-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_server.ex:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) 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:501— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:501-512 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:501-512 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:501` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) 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 163 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 163 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/event_ingestor.ex:697— elixir/serviceradar_core/lib/serviceradar/automation/ansible/event_ingestor.ex:697-708 | elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:1079-1090 — 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) 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:460— elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:460-471 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:847-858 — 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/camera/inventory_ingestor.ex:1835— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:1835-1846 | elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:1926-1937 — both copies are in the same file, so extract the 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:1478-1489 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:604— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:604-615 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1760-1771 — 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 12 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 (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/stream_reader.ex:137— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/stream_reader.ex:137-148 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/stream_reader.ex:161-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:399— elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:399-410 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:463-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:438— elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:438-449 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_retirement.ex:955-966 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) 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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:231— elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:231-242 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_data.ex:102-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) 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 17 separate duplicated blocks between them, totalling at least 269 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:1385— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1385-1396 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:865-876 — 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 17 separate duplicated blocks between them, totalling at least 269 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/prefix_tags/loader.ex:229— elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex:229-240 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/loader.ex:257-268 — both copies are in the same file, so extract the 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_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-40 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:59-70 — both copies are in the same file, so extract the 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/controllers/api/ansible_controller_controller.ex:79— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:79-90 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:87-98 — 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/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:145— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:145-156 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:113-124 — 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/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:378— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:378-389 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:428-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 51 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×75
Edited copy of a member (11 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:575— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:575-585 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:590-603 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:190— elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:190-200 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:576-586 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:509— elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:509-519 | elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:582-592 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:157— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:157-167 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:2044-2054 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:245— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:245-264 | elixir/serviceradar_core/lib/serviceradar/plugins/latest_approved_plugin_package.ex:39-49 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_usage.ex:144— elixir/serviceradar_core/lib/serviceradar/credentials/credential_usage.ex:144-154 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_usage.ex:602-612 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:101— elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:101-111 | elixir/serviceradar_core/src/serviceradar_otel_log_handler_v2.erl:118-137 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:284— swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:284-294 | swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:296-306 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) rust/srql/src/query/dashboard_service_views.rs:577— rust/srql/src/query/dashboard_service_views.rs:577-587 | rust/srql/src/query/dashboards.rs:204-218 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) go/pkg/edge/spool/recovery_completion.go:243— go/pkg/edge/spool/recovery_completion.go:243-257 | go/pkg/edge/spool/recovery_phase.go:92-102 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:249— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:249-259 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:374-384 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) rust/flow-collector/src/publisher.rs:1853— rust/flow-collector/src/publisher.rs:1853-1863 | rust/flow-collector/src/publisher.rs:2102-2112 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:543— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:543-553 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:795-806 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:705— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:705-715 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1139-1149 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/platform_service_certificates.ex:98— elixir/serviceradar_core/lib/serviceradar/edge/platform_service_certificates.ex:98-115 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:385-395 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/authority.ex:124— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/authority.ex:124-138 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/authority.ex:158-168 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards/group_access.ex:227— elixir/web-ng/lib/serviceradar_web_ng/dashboards/group_access.ex:227-237 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/group_access.ex:241-252 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:589— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:589-599 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:489-500 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/nats/static_identity_grants.ex:137— elixir/serviceradar_core/lib/serviceradar/nats/static_identity_grants.ex:137-147 | elixir/serviceradar_core/lib/serviceradar/nats/static_identity_grants.ex:173-183 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_ingress_session.ex:112— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_ingress_session.ex:112-128 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_ingress_session.ex:132-142 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/spatial_live/field_survey_review.ex:69— elixir/web-ng/lib/serviceradar_web_ng_web/live/spatial_live/field_survey_review.ex:69-84 | elixir/web-ng/lib/serviceradar_web_ng_web/live/spatial_live/field_survey_review.ex:88-98 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:206— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:206-218 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:372-382 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1185— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1185-1195 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:549-560 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:81— elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:81-92 | elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:97-107 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:109— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:109-119 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/runtime_config.ex:181-191 — 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.
+ 50 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×71
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:58— elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:58-77 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:81-96 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:220— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:220-235 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_metrics_ingestor.ex:264-283 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:501— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:501-521 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:549-564 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowWriter.swift:177— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowWriter.swift:177-192 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowWriter.swift:194-216 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rust/srql/src/query/device_graph.rs:11— rust/srql/src/query/device_graph.rs:11-26 | rust/srql/src/query/graph_dql.rs:9-24 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) 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-210 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:214-229 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:277— elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:277-292 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:362-377 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) go/cmd/wasm-plugins/awx/main.go:3880— go/cmd/wasm-plugins/awx/main.go:3880-3895 | go/cmd/wasm-plugins/netbox/main.go:631-647 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:69— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:69-84 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:91-106 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:30— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:30-45 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:75-93 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) go/pkg/edge/edgerecord/plan.go:171— go/pkg/edge/edgerecord/plan.go:171-186 | go/pkg/edge/edgerecord/recovery.go:82-100 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:280— swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:280-295 | swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:298-313 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:928— elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:928-943 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1315-1330 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/cli_auth_controller.ex:81— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/cli_auth_controller.ex:81-96 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/cli_auth_controller.ex:130-154 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/identity/device_lookup.ex:655— elixir/serviceradar_core/lib/serviceradar/identity/device_lookup.ex:655-670 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/history.ex:215-232 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) go/pkg/db/cnpg_batch.go:10— go/pkg/db/cnpg_batch.go:10-25 | go/pkg/db/pgx_batch_helper.go:10-29 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:326— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:326-341 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:391-410 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:361— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:361-379 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:533-548 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/contract_registry.ex:226— elixir/serviceradar_core/lib/serviceradar/edge/contract_registry.ex:226-241 | elixir/serviceradar_core/lib/serviceradar/edge/contract_registry.ex:377-392 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rust/srql/src/query/device_sweep_overlap.rs:215— rust/srql/src/query/device_sweep_overlap.rs:215-231 | rust/srql/src/query/field_survey.rs:629-644 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:210— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:210-225 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:145-160 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:169— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:169-184 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:188-204 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1024— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1024-1040 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1044-1059 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_authorize_controller.ex:19— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_authorize_controller.ex:19-34 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_backchannel_logout_controller.ex:18-33 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) elixir/serviceradar_nvr/lib/serviceradar_nvr/delivery.ex:116— elixir/serviceradar_nvr/lib/serviceradar_nvr/delivery.ex:116-131 | elixir/serviceradar_nvr/lib/serviceradar_nvr/reads.ex:46-63 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 46 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×66
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:464— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:464-485 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_succession.ex:771-797 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) rust/flow-collector/src/netflow/converter.rs:1315— rust/flow-collector/src/netflow/converter.rs:1315-1331 | rust/flow-collector/src/netflow/converter.rs:1333-1349 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/dpi.ex:54— elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/dpi.ex:54-71 | elixir/serviceradar_core/lib/serviceradar/inventory/discovery/decoders/fingerprint.ex:74-90 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:325— elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:325-341 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/camera_relay_stream_handler.ex:346-362 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:122— elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:122-138 | elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:262-283 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1233— swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1233-1249 | swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:1628-1645 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards/first_party_packages.ex:127— elixir/web-ng/lib/serviceradar_web_ng/dashboards/first_party_packages.ex:127-143 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/system_reports.ex:146-171 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:174— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:174-200 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:221-237 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:283— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:283-299 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:438-454 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:57— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:57-73 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:77-100 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/contract_registry_epoch_document.ex:152— elixir/serviceradar_core/lib/serviceradar/edge/contract_registry_epoch_document.ex:152-168 | elixir/serviceradar_core/lib/serviceradar/edge/contract_registry_epoch_document.ex:202-221 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) go/pkg/mtr/socket_darwin.go:77— go/pkg/mtr/socket_darwin.go:77-93 | go/pkg/mtr/socket_darwin.go:95-111 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_context/map_markers.ex:64— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_context/map_markers.ex:64-80 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_context/map_markers.ex:84-100 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:180— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_runtime.ex:180-196 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:831-847 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) rust/srql/src/query/field_survey.rs:514— rust/srql/src/query/field_survey.rs:514-531 | rust/srql/src/query/wifi_map.rs:353-369 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/package_assignment_lifecycle.ex:14— elixir/serviceradar_core/lib/serviceradar/plugins/package_assignment_lifecycle.ex:14-34 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:685-701 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) go/pkg/k8sinventory/controller.go:248— go/pkg/k8sinventory/controller.go:248-264 | go/pkg/k8sinventory/controller.go:266-282 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:693— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:693-709 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:797-814 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:159— elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:159-175 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_assignment_reconciler.ex:248-277 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:463— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:463-479 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:483-506 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) go/pkg/agent/push_loop_mtr_traces_edge.go:131— go/pkg/agent/push_loop_mtr_traces_edge.go:131-147 | go/pkg/agent/push_loop_mtr_traces_edge.go:178-194 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:260— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:260-276 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:311-330 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:393— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:393-409 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1810-1828 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) go/cmd/wasm-plugins/proxmox/details_json.go:161— go/cmd/wasm-plugins/proxmox/details_json.go:161-178 | go/cmd/wasm-plugins/proxmox/details_json.go:302-318 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_package_live/index.ex:181— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_package_live/index.ex:181-200 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_package_live/index.ex:204-220 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 41 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×64
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:267— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:267-271 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:464-469 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/presentation.ex:230— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/presentation.ex:230-234 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/test_send.ex:348-355 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/admission/lane.ex:234— elixir/serviceradar_core/lib/serviceradar/admission/lane.ex:234-238 | elixir/serviceradar_core/lib/serviceradar/admission/lane.ex:245-249 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_config/downparser.ex:18— elixir/serviceradar_core/lib/serviceradar/network_config/downparser.ex:18-22 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:1353-1365 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/nvd_applicability.ex:768— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/nvd_applicability.ex:768-772 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_package_identity.ex:197-201 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/netflow_visualize/state.ex:114— elixir/web-ng/lib/serviceradar_web_ng_web/netflow_visualize/state.ex:114-118 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:565-571 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation_worker.ex:134— elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation_worker.ex:134-140 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/oban_support.ex:108-112 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_scopes.ex:62— elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_scopes.ex:62-79 | elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_state.ex:37-41 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:672— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:672-676 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:680-684 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_template_binding.ex:903— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_template_binding.ex:903-907 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:628-635 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:477— elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:477-481 | elixir/serviceradar_core/lib/serviceradar/integrations/composite_northbound_values.ex:66-70 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:75— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:75-80 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:151-155 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:157— elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:157-161 | elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:179-192 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1710— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1710-1714 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2511-2515 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2070— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2070-2074 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/mapper_promotion.ex:104-113 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/mcp/identity_diagnostics.ex:276— elixir/web-ng/lib/serviceradar_web_ng/mcp/identity_diagnostics.ex:276-280 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/processes.ex:27-44 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:296— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:296-300 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_data/composite.ex:53-57 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_succession.ex:931— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_succession.ex:931-935 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex:1564-1569 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:770— elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:770-775 | elixir/web-ng/lib/serviceradar_web_ng_web/metric_series.ex:43-47 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1424— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1424-1428 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:280-287 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ocsf_components.ex:127— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ocsf_components.ex:127-137 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/normalize.ex:523-527 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/analysis_result_ingestor.ex:21— elixir/serviceradar_core/lib/serviceradar/camera/analysis_result_ingestor.ex:21-27 | elixir/serviceradar_core/lib/serviceradar/camera/relay_health_event_router.ex:77-81 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:511— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:511-515 | elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:705-714 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/vulnerability_advisory_ingestor.ex:395— elixir/serviceradar_core/lib/serviceradar/inventory/vulnerability_advisory_ingestor.ex:395-399 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_scanner_worker.ex:174-178 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:60— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:60-65 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:161-165 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 39 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×64
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/native_addon_artifact_mirror.ex:89— elixir/serviceradar_core/lib/serviceradar/plugins/native_addon_artifact_mirror.ex:89-91 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_artifact_mirror.ex:86-88 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:2127— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:2127-2133 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/tls_certificate_fingerprint.ex:80-82 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:313— elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:313-315 | elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:502-507 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/certificate_lifetime_policy.ex:151— elixir/serviceradar_core/lib/serviceradar/edge/certificate_lifetime_policy.ex:151-153 | elixir/serviceradar_core/lib/serviceradar/edge/infrastructure_certificate_adoption.ex:259-261 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:828— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:828-830 | elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl:285-287 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:118— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:118-123 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:168-170 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:812— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:812-814 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1129-1131 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:429— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/webrtc_signaling_manager.ex:429-431 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:747-749 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:702— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:702-704 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_vulnerability_risk.ex:589-591 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/components/northbound_action_components.ex:558— elixir/web-ng/lib/serviceradar_web_ng_web/components/northbound_action_components.ex:558-560 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/log_components.ex:192-194 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention_worker.ex:73— elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention_worker.ex:73-75 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention_worker.ex:51-53 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1570— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1570-1577 | elixir/web-ng/lib/serviceradar_web_ng_web/observability/event_device_reference.ex:136-138 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:214— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:214-216 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_components.ex:1731-1734 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:203— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:203-205 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:138-140 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:110— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:110-112 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:205-207 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_preview.ex:77— elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_preview.ex:77-79 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:556-558 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/recovery_effects.ex:272— elixir/serviceradar_core/lib/serviceradar/edge/recovery_effects.ex:272-279 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_operations.ex:121-123 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:889— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:889-891 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:938-940 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:415— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:415-417 | elixir/serviceradar_nvr/lib/serviceradar_nvr/publication_recovery.ex:29-31 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:195— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:195-197 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:233-235 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex:1585— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex:1585-1591 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/command_status.ex:605-607 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_rotation.ex:194— elixir/serviceradar_core/lib/serviceradar/credentials/credential_rotation.ex:194-197 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live/credential_management.ex:339-341 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:590— elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:590-592 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live/credential_management.ex:347-349 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/mtr_baseline_scheduler.ex:283— elixir/serviceradar_core/lib/serviceradar/observability/mtr_baseline_scheduler.ex:283-285 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_state_trigger_worker.ex:148-150 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:476— elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:476-478 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_assignment_reconciler.ex:204-206 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 39 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×60
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:138— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:138-156 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:73-92 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:118— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:118-136 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:135-157 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:32— elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:32-50 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:56-79 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) rust/srql/src/query/advisory_coordinates.rs:119— rust/srql/src/query/advisory_coordinates.rs:119-139 | rust/srql/src/query/vulnerability_advisories.rs:118-136 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:308— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:308-330 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:440-458 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review_preferences.ex:19— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review_preferences.ex:19-37 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_session_metadata.ex:33-65 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) rust/srql/src/query/mtr_hops.rs:163— rust/srql/src/query/mtr_hops.rs:163-181 | rust/srql/src/query/mtr_traces.rs:78-96 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) docker/images/extract_rootfs.py:91— docker/images/extract_rootfs.py:91-111 | docker/images/overlay_deb_packages.py:51-69 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:2075— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:2075-2095 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_resource_data.ex:79-97 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) 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-123 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:264-282 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:697— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:697-715 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:528-550 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:165— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:165-183 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:226-244 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/composite_checks/validation/orchestrator.ex:31— elixir/serviceradar_core/lib/serviceradar/composite_checks/validation/orchestrator.ex:31-55 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_scanner_worker.ex:78-96 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:838— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:838-856 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:860-887 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:186— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:186-204 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:210-229 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/operations_index.ex:225— elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/operations_index.ex:225-243 | elixir/web-ng/lib/serviceradar_web_ng_web/live/deduplication_live/index.ex:170-188 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:391— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:391-409 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:413-436 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_state.ex:177— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_state.ex:177-195 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_state.ex:212-230 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) rust/srql/src/query/dashboard_service_views.rs:611— rust/srql/src/query/dashboard_service_views.rs:611-629 | rust/srql/src/query/identity/mod.rs:277-298 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) go/pkg/scan/syn_scanner_replies.go:114— go/pkg/scan/syn_scanner_replies.go:114-132 | go/pkg/scan/syn_scanner_replies.go:134-152 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/components/srql_components.ex:571— elixir/web-ng/lib/serviceradar_web_ng_web/components/srql_components.ex:571-589 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:162-180 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2229— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2229-2251 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1452-1470 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher/ash_adapter.ex:78— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher/ash_adapter.ex:78-101 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority_ash_source.ex:88-106 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/telemetry_batch.ex:107— elixir/serviceradar_core/lib/serviceradar/edge/projectors/telemetry_batch.ex:107-125 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/wasm_plugin_result.ex:86-104 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) rust/srql/src/query/gateways.rs:32— rust/srql/src/query/gateways.rs:32-50 | rust/srql/src/query/virtualization.rs:33-52 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) elixir/palisade/lib/palisade/outbound_fetch.ex:84— elixir/palisade/lib/palisade/outbound_fetch.ex:84-96 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:52-64 — 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 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/palisade/lib/palisade/outbound_fetch.ex:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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/dispatcher.ex:440— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:440-452 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:470-482 — both copies are in the same file, so extract the 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/edge/projectors/flow_attribution.ex:88— elixir/serviceradar_core/lib/serviceradar/edge/projectors/flow_attribution.ex:88-100 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/otlp_relay.ex:103-115 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/edge/projectors/flow_attribution.ex` and `elixir/serviceradar_core/lib/serviceradar/edge/projectors/otlp_relay.ex` as WHOLE FILES: this scan already matched 3 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. 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/edge/projectors/scheduled_mtr_trace.ex:121— elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:121-133 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/unleased_sweep_results.ex:97-109 — 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/edge/projectors/sweep_observation.ex:159— elixir/serviceradar_core/lib/serviceradar/edge/projectors/sweep_observation.ex:159-171 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/edge_record.ex:489-501 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/projectors/sweep_observation.ex:159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:427— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:427-439 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1274-1286 — 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 12 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:647— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:647-659 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:700-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:698` calls `trivy_agent_id`, `trivy_device_uid` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:646` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/network_config/interface_check_ingestor.ex:200— elixir/serviceradar_core/lib/serviceradar/network_config/interface_check_ingestor.ex:200-212 | elixir/serviceradar_core/lib/serviceradar/network_config/plugin_ingestor.ex:366-378 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/network_config/interface_check_ingestor.ex:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:101— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:101-113 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.ex:94-106 — `elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.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 40 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 (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1306— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1306-1318 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.ex:993-1005 — `elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.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 40 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:57— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:57-69 | 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 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/repo_url.ex:74— elixir/serviceradar_core/lib/serviceradar/plugins/repo_url.ex:74-86 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:170-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/repo_url.ex:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 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-87 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:46-58 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex` and `elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:83` calls `decode_capture_with_boombox`, `value` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/reference_analysis_worker.ex:82` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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/live/admin/addon_package_live/index.ex:1909— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:1909-1921 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:1569-1581 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:1909` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:1907` calls `catalog_platforms` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:1568` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 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-135 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:396-408 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_components/formatters.ex:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:588— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_user_live/show.ex:588-600 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_users_live.ex:550-562 — 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/settings/device_enrichment_rules_live.ex:462— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:462-474 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:1470-1482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:462` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:168— elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:168-180 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:623-635 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:622` calls `trim` and `elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:167` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:139— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:139-151 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:247-259 — both copies are in the same file, so extract the 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/diagnostics_live/mtr_compare.ex:235— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:235-247 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_trace.ex:455-467 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_audit_lookup.ex:11— elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_audit_lookup.ex:11-23 | elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_request_lookup.ex:11-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 (13 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:80— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:80-92 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/media_identity.ex:7-19 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
+ 30 more in this group — see findings.md.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×52
Edited copies of one member (3 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:162— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:162-170 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1155-1163 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:142-145 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/anomaly_episode_stale_close_worker.ex:83— elixir/serviceradar_core/lib/serviceradar/observability/anomaly_episode_stale_close_worker.ex:83-87 | elixir/serviceradar_core/lib/serviceradar/observability/anomaly_ingest_silence_worker.ex:174-177 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:228-232 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/data.ex:59— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/data.ex:59-66 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:937-944 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:369-372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex:962— elixir/serviceradar_core/lib/serviceradar/event_writer/producer.ex:962-965 | elixir/serviceradar_core/lib/serviceradar/security/events.ex:256-259 | elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_hints.ex:84-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:29— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:29-32 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_forwarder.ex:25-32 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/remote_capture_forwarder.ex:20-24 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:6016— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:6016-6019 | elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1212-1215 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.ex:978-981 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:85— elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:85-88 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:201-204 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:160-163 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:315— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:315-321 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_succession.ex:821-824 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/availability_data.ex:287-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:702— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:702-706 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/bumblebee_data.ex:39-42 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_data.ex:264-267 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/wifi.ex:284— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/wifi.ex:284-287 | elixir/web-ng/lib/serviceradar_web_ng_web/live/flows/attributed_live.ex:570-573 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8361-8364 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:378— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:378-381 | elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_preview.ex:217-220 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:824-827 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial.ex:155— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial.ex:155-158 | elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:1234-1237 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:1098-1101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_commands/pubsub.ex:125— elixir/serviceradar_core/lib/serviceradar/agent_commands/pubsub.ex:125-128 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:128-131 | elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:2087-2090 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:526— elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:526-529 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac.ex:70-74 | elixir/web-ng/lib/serviceradar_web_ng_web/live/scan_live.ex:314-318 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_changes/projector.ex:40— elixir/serviceradar_core/lib/serviceradar/network_changes/projector.ex:40-43 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:666-669 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:247-250 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/callback_worker.ex:190— elixir/serviceradar_core/lib/serviceradar/notifications/callback_worker.ex:190-193 | elixir/serviceradar_core/lib/serviceradar/notifications/callbacks/pager_duty.ex:284-287 | elixir/serviceradar_core/lib/serviceradar/notifications/callbacks/slack.ex:142-145 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:776— elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:776-779 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/generic_webhook.ex:461-464 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/stream.ex:502-505 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:256— elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:256-260 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_packages.ex:166-169 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_profiles.ex:165-168 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:421— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:421-424 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1550-1553 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/show/history_table.ex:166-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_instance_target.ex:41— elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_instance_target.ex:41-44 | elixir/serviceradar_core/lib/serviceradar/dashboards/checks/actor_can_edit_dashboard_target.ex:41-44 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2635-2638 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_source_scope_resolver.ex:135— elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_source_scope_resolver.ex:135-138 | elixir/serviceradar_core/lib/serviceradar/notifications/callbacks/slack.ex:242-245 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/notification_callback_app_controller.ex:154-157 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:94— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:94-97 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:104-107 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:400-403 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/interface_components.ex:671— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/interface_components.ex:671-676 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/index.ex:349-352 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1992-1995 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:82— elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:82-85 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_package_context.ex:280-283 | elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:190-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:582— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:582-585 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex:761-764 | elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor.ex:432-435 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (14 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:197— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:197-210 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:216-229 — both copies are in the same file, so extract the 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/callback_command_dispatcher.ex:450— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:450-463 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:532-545 — 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/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/execution_lifecycle.ex:434— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:434-447 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:524-537 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) 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 11 separate duplicated blocks between them, totalling at least 115 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/ansible_action_sync.ex:71— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:71-84 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:93-106 — 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 10 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:683— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:683-696 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_vulnerability_risk.ex:570-583 — 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/inventory/identity/hardware_serial_backfill.ex:369— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:369-382 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:341-354 — 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 170 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/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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:205— elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:205-218 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_data.ex:76-89 — 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/notifications/transports/discord.ex:182— elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:182-195 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex:252-265 — 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 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:345— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:345-358 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:281-294 — 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 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:108— elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:108-121 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/authorization_settings_controller.ex:61-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/admin_api/local.ex:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:92— elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:92-105 | elixir/web-ng/lib/serviceradar_web_ng/nvr_publication_listener.ex:80-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:280— elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:280-293 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:210-223 — 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 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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:169— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:169-182 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:200-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:169` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:254— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:254-267 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_trace.ex:474-487 — 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_web/live/log_live/index.ex:9877— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9877-9890 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:10012-10025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9877` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9893` calls `reject`, `is_binary`, `trim` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:10028` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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/cluster_live/index.ex:110— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:110-123 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:269-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 (14 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/custom_templates.ex:193— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/custom_templates.ex:193-206 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/target_oids.ex:44-57 — 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_web/live/settings/snmp_profiles_live/index/events/targets.ex:86— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/targets.ex:86-99 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/targets.ex:123-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 25 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×49
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:299— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:299-317 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:321-338 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:43— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:43-60 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:64-87 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:47— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:47-67 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/query_data.ex:151-168 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) go/pkg/agent/plugin_runtime_host_authority.go:1616— go/pkg/agent/plugin_runtime_host_authority.go:1616-1642 | go/pkg/agent/plugin_runtime_host_authority.go:1644-1661 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:73— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:73-90 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:81-98 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) go/pkg/mapper/snmp_l2_bridge.go:466— go/pkg/mapper/snmp_l2_bridge.go:466-483 | go/pkg/mapper/snmp_l2_bridge.go:489-511 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:110— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:110-127 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:113-130 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rust/srql/src/query/dashboard_service_views.rs:503— rust/srql/src/query/dashboard_service_views.rs:503-520 | rust/srql/src/query/dashboard_service_views.rs:522-539 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) 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-57 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/bmp_settings_controller.ex:35-57 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1896— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1896-1922 | elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:2861-2878 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rust/srql/src/query/starrocks/bmp_events.rs:107— rust/srql/src/query/starrocks/bmp_events.rs:107-124 | rust/srql/src/query/starrocks/otel_metrics.rs:277-294 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:1924— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:1924-1942 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1414-1431 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) 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-158 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:162-185 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1477— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1477-1494 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1474-1499 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_preview.ex:107— elixir/serviceradar_core/lib/serviceradar/credentials/network_credential_rule_preview.ex:107-124 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:376-394 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) go/pkg/agent/endpoint_inventory_convert.go:296— go/pkg/agent/endpoint_inventory_convert.go:296-313 | go/pkg/agent/endpoint_inventory_convert.go:317-335 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_ingest_server.ex:245— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_ingest_server.ex:245-264 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/remote_capture_server.ex:62-79 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:539— elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:539-556 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:560-577 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rust/netprobe/src/server.rs:436— rust/netprobe/src/server.rs:436-453 | rust/netprobe/src/server.rs:469-489 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:38— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:38-55 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:77-96 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) REDACTED:413— REDACTED:413-437 | go/pkg/agent/syncsources/armis/driver.go:390-407 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:155— elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:155-172 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/producer_assignments.ex:76-97 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) go/cmd/wasm-plugins/proxmox/details_json.go:17— go/cmd/wasm-plugins/proxmox/details_json.go:17-34 | go/cmd/wasm-plugins/proxmox/result.go:206-223 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:224— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:224-241 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:399-416 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rust/workload-identity/src/bin/workload-identity.rs:230— rust/workload-identity/src/bin/workload-identity.rs:230-247 | rust/workload-identity/src/bin/workload-identity.rs:250-267 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 24 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×47
Edited copy of a member (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/stable_id.ex:19— elixir/serviceradar_core/lib/serviceradar/event_writer/stable_id.ex:19-20 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/execution_slots.ex:29-31 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1142— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1142-1143 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:547-548 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:594— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:594-595 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:515-516 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/mtr_causal_signal_emitter.ex:186— elixir/serviceradar_core/lib/serviceradar/observability/mtr_causal_signal_emitter.ex:186-187 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_worker.ex:350-351 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/recorder_ownership.ex:299— elixir/serviceradar_core/lib/serviceradar/camera/recorder_ownership.ex:299-302 | elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_frame.ex:142-143 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_awx_launch_preflight_evidence.ex:249— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_awx_launch_preflight_evidence.ex:249-250 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_template_binding.ex:885-886 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/events.ex:81— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/events.ex:81-82 | elixir/serviceradar_core/lib/serviceradar/ingestion/status_ingestor.ex:349-350 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_secret_builder.ex:275— elixir/serviceradar_core/lib/serviceradar/credentials/credential_secret_builder.ex:275-276 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live/credential_inventory_components.ex:509-510 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_target_policy.ex:378— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_target_policy.ex:378-379 | elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:331-332 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/observability/signal_display.ex:406— elixir/web-ng/lib/serviceradar_web_ng/observability/signal_display.ex:406-411 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/query_data.ex:190-191 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/components/camera_relay_components.ex:69— elixir/web-ng/lib/serviceradar_web_ng_web/components/camera_relay_components.ex:69-70 | elixir/web-ng/lib/serviceradar_web_ng_web/live/topology_live/god_view_camera_relay_components.ex:408-409 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/palisade/lib/palisade/network_address_policy.ex:143— elixir/palisade/lib/palisade/network_address_policy.ex:143-144 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:138-139 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/palisade/lib/palisade/network_address_policy.ex:146— elixir/palisade/lib/palisade/network_address_policy.ex:146-147 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:141-142 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1136— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1136-1137 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_target_policy.ex:383-384 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:276— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:276-277 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:403-404 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1735— elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1735-1738 | elixir/web-ng/lib/serviceradar_web_ng_web/components/plugin_config_form.ex:396-397 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:540— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:540-545 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1329-1330 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:333— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:333-334 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:461-462 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:673— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:673-674 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1110-1111 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:504— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:504-505 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:399-400 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:599— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:599-600 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1069-1070 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:304— elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:304-305 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/authored/visuals.ex:110-111 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2998— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2998-3004 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1903-1904 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_package_identity.ex:121— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_package_identity.ex:121-122 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:892-893 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor_queue.ex:695— elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor_queue.ex:695-696 | elixir/web-ng/lib/serviceradar_web_ng/configuration_request.ex:120-121 — These two members are one piece of code written twice and then edited apart: 2 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.
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::translate::translate_request (cyclomatic 64) rust/srql/src/query/translate.rs:20— srql::query::translate::translate_request has cyclomatic complexity 64 (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:219— 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::devices::filters::apply_filter (cyclomatic 60) rust/srql/src/query/devices/filters.rs:68— srql::query::devices::filters::apply_filter 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::stats::filters::build_grouped_stats_filter_clause (cyclomatic 49) rust/srql/src/query/devices/stats/filters.rs:8— srql::query::devices::stats::filters::build_grouped_stats_filter_clause has cyclomatic complexity 49 (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_filter (cyclomatic 43) rust/srql/src/query/agents.rs:133— srql::query::agents::apply_filter has cyclomatic complexity 43 (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::sysmon::to_sql_and_params (cyclomatic 43) rust/srql/src/query/sysmon.rs:565— srql::query::sysmon::to_sql_and_params 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.
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::devices::filters::params::collect_filter_params (cyclomatic 38) rust/srql/src/query/devices/filters/params.rs:16— srql::query::devices::filters::params::collect_filter_params 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.
srql::query::sql_placeholders::rewrite_placeholders_with_style (cyclomatic 38) rust/srql/src/query/sql_placeholders.rs:34— srql::query::sql_placeholders::rewrite_placeholders_with_style has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
srql::query::agents::apply_single_order (cyclomatic 37) rust/srql/src/query/agents.rs:472— srql::query::agents::apply_single_order has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. 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 37) rust/srql/src/query/agents.rs:554— srql::query::agents::apply_secondary_order has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. 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::query::starrocks::field_sql (cyclomatic 36) rust/srql/src/query/starrocks.rs:2437— 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::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::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:560— 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::endpoint_packages::apply_single_order (cyclomatic 23) rust/srql/src/query/endpoint_packages.rs:766— 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::endpoint_packages::apply_secondary_order (cyclomatic 23) rust/srql/src/query/endpoint_packages.rs:820— srql::query::endpoint_packages::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::endpoint_packages::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::query::mtr_traces::apply_primary_order (cyclomatic 23) rust/srql/src/query/mtr_traces.rs:346— 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:405— 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::starrocks::flow_filters::predicate (cyclomatic 22) rust/srql/src/query/starrocks/flow_filters.rs:62— srql::query::starrocks::flow_filters::predicate 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.
srql::query::downsample::sql::build_sql (cyclomatic 21) rust/srql/src/query/downsample/sql.rs:49— srql::query::downsample::sql::build_sql 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.
srql::query::endpoint_inventory_scans::apply_single_order (cyclomatic 21) rust/srql/src/query/endpoint_inventory_scans.rs:279— srql::query::endpoint_inventory_scans::apply_single_order has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (srql::query::endpoint_inventory_scans::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.
Repeated repair: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.ex elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.ex:92— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.ex changed 27 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 10 (its worst body is JetStreamPublisher.publish_record at line 92), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(edge): switch edge-record JetStream streams to DiscardNew with 72h max_age (#6426)”; “fix(edge): preserve recovery holds through publication and retention”; “fix(edge): make the lane ledger outlive its transport, and fail closed without one”; “fix(edge): abandon only PROVISIONAL attempts; scope the remaining window 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.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/publish_window.ex elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:267— elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex changed 20 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 6 (its worst body is PublishWindow.admit at line 267), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(edge): make the lane ledger outlive its transport, and fail closed without one”; “fix(edge): address review -- leaking bystander, stale doc arities, grammar”; “fix(edge): fence a retry on the previous REQUEST, never on its deadline”; “fix(edge): abandon only PROVISIONAL attempts; scope the remaining window 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/edge/publish_window.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/analytics/starrocks/stream_load.ex elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex:155— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex changed 25 times in last 90 days and 14 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 StreamLoad.load_once at line 155), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(starrocks): decouple Stream Load DNS lookup from TCP connect timer and close state sockets”; “fix(starrocks): remove shadow dual-writes; write each dataset to one store”; “fix(starrocks): load labels must not enumerate struct values”; “fix(starrocks): load labels must name row content, not only ids”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.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/publisher_pool.ex elixir/serviceradar_core/lib/serviceradar/edge/publisher_pool.ex:602— elixir/serviceradar_core/lib/serviceradar/edge/publisher_pool.ex changed 18 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 PublisherPool.revoke at line 602), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(edge): preserve recovery holds through publication and retention”; “fix(edge): make transport registration a bounded, explicit transition”; “fix(edge): make the lane ledger outlive its transport, and fail closed without one”; “fix(edge): fence a retry on the previous REQUEST, never on its deadline”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/edge/publisher_pool.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/topology/bitmap_queries.ex elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_queries.ex:236— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_queries.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 10 (its worst body is BitmapQueries.query at line 236), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(atlas): preserve exact filtered aggregate connections”; “no-mistakes(ci): ci-1 not fixed: cause unproven, diagnostics added. f909d7e6: 29 zero-frame, 776 query_busy, 0 timeouts. Under FIFO saturation some late starts would also time out, so admission expiry looks unlikely as main source (inferred). Pins <=7 at registration (stale entries counted only when successor slots are free), readers <=8, success peak 87MB rules out a single memory reservation; none measured. Change: every query_busy origin emits [:serviceradar,:topology,:bitmap_query,:busy] with a fixed source: admission_expired/full, stream_occupied, watch_tasks_full, world_cache_busy, pin/reader/native_memory budget, publisher/reader/native/catalog busy. Admitted work emits :admission wait_ms/run_ms. The task now sends started before its result, so fast queries are timed. Scale Meter reports queries.busy and power-of-2 wait/run buckets per replica, so the next hosted run names the source. No limits, deadlines, RBAC, filtering or FIFO 8/64 changed. Files: bitmap_queries.ex, bitmap_query_admission.ex, bitmap_stream.ex, scale meter.exs, harness test, bitmap_query_control_test.exs, runbook (f909 result, counters; compact failed, sparse unrun, 4.2/4.7 open). Validation (RBE): formatted, quality_check, unit_tests_phoenix_other (806), harness (7) passed (56d0d38b). No-op busy/1 mutation failed both keepers (741be3b7), restored. make test 419 pass, 2 Swift skips (6631abf6). git diff --check clean. Not run: topology_atlas_db_test, hosted compact/sparse. No fix proven; the next compact dispatch must read replicas[].queries”; “no-mistakes(ci): Cause (from code, consistent with a692930f): BitmapQueries.bounded refused every query that arrived while all 8 tasks were busy, with no wait. Sockets join together, so their 5s ticks line up, and the client/browser backoff (1,2,4,8, then 10s) lands each retry on a tick. The 47 starved viewers lost the race on every attempt: 865 of 925 watches got query_busy, none timed out. Fix: new BitmapQueryAdmission is the only starter of BitmapQueryTasks. It runs at most 8 tasks, FIFO, and a waiter queues only until its own 1s deadline. It returns query_busy if work never started, query_timeout if it was killed at the deadline, query_unavailable on a crash. Queue is bounded at 64, with expired or dead waiters pruned. Supervisor is one_for_all. Limits, workload, RBAC, filtering, stale handling and native fix 9fb are unchanged. Files: bitmap_query_admission.ex (new), bitmap_queries.ex, bitmap_query_control_test.exs. Docs: the scale runbook (compact failed twice, sparse not run, 4.2 open), the design.md amendment, the embedded proposal copy, and checksums in topology-bitmap-index-review.md. Tests, run on an RBE db_free shard: 24 newcomers arrive while 8 looping refreshers saturate the slots. The pre-fix admission, extracted unchanged, failed with 24/24 query_busy (f68c109d-abc4-423d-86e9-07cd143a5a7f). With the fix, all 24 are served and the peak stays at 8. A second test checks that a request that cannot start gets query_busy and never runs, and that killed slots are freed. Evidence: unit_tests_phoenix_other, harness and quality passed (a0a9d6a1, f9169589). Full make test passed 419, 2 Swift skips (5877ccc3-ad13-4af0-878f-693aff4335e9). openspec validate passes and git diff --check is clean. Not run: topology_atlas_db_test and hosted compact/sparse. Hosted scale is unproven, and no dispatch, push or config change was made”; “fix(atlas): keep filtering available whenever Atlas is enabled”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_queries.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/topology/bitmap_stream.ex elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_stream.ex:298— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_stream.ex changed 14 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 7 (its worst body is BitmapStream.current_identity at line 298), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(ci): ci-1 (b266c89a): two causes, found in the redacted state of the stopped viewers. 1) Invalid oracle (36 of 39). Those viewers held the current revision of the unhinted server. That server publishes only during reconciliation passes (~3m50s each) and waits a 30s scan_interval between them. Each group stopped 30s after the revision that ended a pass (4402 at tick 16, 6603 at tick 34). 2) Real stall (3, on the hinted server during replacement). Every stopped viewer had resets about equal to frames, with only query_timeout/busy errors. keep_frame? rechecked the binding with the build deadline that was already spent, so every timed-out refresh became a reset plus a backoff rewatch. Sockets that join together also tick in lockstep, consistent with the bimodal wait histogram: 3257 waits under 16ms, 7087 at 256-1023ms. Fixes: bitmap_stream keep_frame? gets its own 1s budget. The channel's first tick falls randomly 5-10s after join, then 5s as before. The harness fails a churning normal viewer that is blank, or behind its server's published revision, for over 30s, measured by a new Revisions sampler. A stopped viewer now fails the driver on the next tick with a safe viewer_failed record. Limits, workload, RBAC and FIFO unchanged. Runbook and choices updated; 4.2/4.7 stay open. Negative: old client with new test fails on the idle-replica case with 'no accepted progress for 31000ms' (2695df38). Positive: harness, unit_tests_phoenix_other and web-ng quality_check passed (d83fc33f). Full make test: 419 passed, 2 Swift skips (66c23695). The new admission-expiry keep-frame case in bitmap_queries_db_test is hosted-only and has not run. The tick-phase change has no local regression test. Hosted compact then sparse are still required, with no fix claimed until both pass”; “no-mistakes(ci): ci-1 not fixed: cause unproven, diagnostics added. f909d7e6: 29 zero-frame, 776 query_busy, 0 timeouts. Under FIFO saturation some late starts would also time out, so admission expiry looks unlikely as main source (inferred). Pins <=7 at registration (stale entries counted only when successor slots are free), readers <=8, success peak 87MB rules out a single memory reservation; none measured. Change: every query_busy origin emits [:serviceradar,:topology,:bitmap_query,:busy] with a fixed source: admission_expired/full, stream_occupied, watch_tasks_full, world_cache_busy, pin/reader/native_memory budget, publisher/reader/native/catalog busy. Admitted work emits :admission wait_ms/run_ms. The task now sends started before its result, so fast queries are timed. Scale Meter reports queries.busy and power-of-2 wait/run buckets per replica, so the next hosted run names the source. No limits, deadlines, RBAC, filtering or FIFO 8/64 changed. Files: bitmap_queries.ex, bitmap_query_admission.ex, bitmap_stream.ex, scale meter.exs, harness test, bitmap_query_control_test.exs, runbook (f909 result, counters; compact failed, sparse unrun, 4.2/4.7 open). Validation (RBE): formatted, quality_check, unit_tests_phoenix_other (806), harness (7) passed (56d0d38b). No-op busy/1 mutation failed both keepers (741be3b7), restored. make test 419 pass, 2 Swift skips (6631abf6). git diff --check clean. Not run: topology_atlas_db_test, hosted compact/sparse. No fix proven; the next compact dispatch must read replicas[].queries”; “fix(atlas): keep filtering available whenever Atlas is enabled”; “no-mistakes(review): Fix catalog labels, rehydrate, and late callbacks”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_stream.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/ingestion/result_ingestor.ex elixir/serviceradar_core/lib/serviceradar/ingestion/result_ingestor.ex:109— elixir/serviceradar_core/lib/serviceradar/ingestion/result_ingestor.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 9 (its worst body is ResultIngestor.handle_sweep_results at line 109), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(edge): redeliver unleased sweep results on transient ingest failure (#6416)”; “fix(core): defer edge-record PubSub and NATS side effects until after commit (#6399)”; “fix(core): record network_sweep service state from leased sweep batches”; “fix(edge): complete unleased sweeps after every chunk arrives”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/ingestion/result_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/topology/bitmap_index.ex elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:89— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.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 BitmapIndex.handle_call at line 89), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(ci): Fixed the sparse WebNgDbDiagnostic failure: the hinted replica refused 23,286 hints at its 3,670,016-byte retained-memory bound during ticks 60 and 66-70. Invariant: when hint resolution is cheap, a slow publication or scan step must not leave UIDs piled up behind it until they hit the retained-memory bound. Scan and catalog service must still get a finite, fixed share of turns. Root cause, from the evidence files: resolving a batch of 500 UIDs costs about 8 ms (11,437 ms over 1,439 batches). Dirty publication costs about 89 ms when stable and 196-251 ms under contention, and a scan page costs 174-227 ms. The old rotation was hints, dirty, hints, dirty, scan, catalog, with a 25-ms pause after every success. That allowed only 2 cheap resolutions per expensive cycle (about 1,300 UIDs/s under contention against 2,200/s arriving). Meanwhile the waiting UIDs held the BitmapHints budget. The native Roaring dirty set has its own 512-KiB serialized bound and asks for a rescan on overflow, so a publication backlog belongs there, not in the UID queue. Change (`elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex`), two small edits: 1. The rotation is now hints, dirty, hints, dirty, hints, scan, hints, catalog. Each cycle gets 4 resolutions, 2 publications of 500 rows, 1 scan page and the catalog. Scan/catalog keep a fixed one-in-eight turn, and missing work is still skipped, so a cold replica without hints scans at the same rate. 2. After a successful step, the next one starts with no pause while BitmapHints still holds UIDs. Otherwise the 25-ms pause applies as before. Estimate under the measured contention: about 2,900 resolved UIDs/s, enough for the 2,200/s arriving. Unchanged: one worker, 500-row batches, the 3.5-MiB/512-KiB limits, native budgets, retries/backoff/timeouts and failure semantics. No new publishers, caches, outbox or leases. Docs: `docs/topology-bitmap-scale-acceptance.md` now records the first compact and sparse results at 183be181f4. Compact is recorded with its limitation: one 5,155-ms tick, so not every tick stayed under 5 s. The file also describes the new scheduler and states it is NOT verified until compact and sparse are rerun on the same published SHA. The scheduler paragraph in `openspec/.../design.md` is updated the same way. No new unit test. The scheduler calls the database through BitmapSource and has no production injection seam, and adding a test-only seam would break the test-audit rule. The real behavioral regression is the hosted sparse acceptance, which failed on the old code. It has to be rerun after publication, along with compact. Verification, all via `--config=remote`: - `//elixir/web-ng:quality_check` (format + Credo) passed: 228bcc86-aa74-430a-be5b-f75bdc3948fc. - `//elixir/web-ng:topology_bitmap_scale_harness_test` passed: e960b8f0-1c54-4403-8dcb-91a0b1400637. The command itself exited with a pattern-parse error because I first gave a wrong `:quality` target name, then I ran `quality_check` on its own. - `openspec validate --strict` passed and `git diff --check` is clean. Not run: the full `make test`, the hosted DB lifecycle, and the compact/sparse scale workloads. Those need publication. I made no commit. If you commit locally, use `SERVICERADAR_SKIP_ELIXIR_FORMAT=1`, since formatting was already checked remotely”; “fix(atlas): drain hint bursts within memory bounds”; “no-mistakes(review): Fix catalog scheduler sentinel and execute workflow compile contracts”; “fix(atlas): preserve progress across index and projection retries”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_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.
Repeated repair: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex:431— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.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 8 (its worst body is Inbox.place at line 431), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): send Ash notifications from the edge ledger transaction after commit (#6378)”; “fix(alerts): admit only on-subject events to anomaly-open rules”; “no-mistakes(review): Fix versioned pending-close test; count oversized skips once”; “fix(alerts): never let alert admission backpressure drop a batch or its signal”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.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/topology/bitmap_view.ex elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_view.ex:83— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_view.ex changed 12 times in last 90 days and 7 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 BitmapView.project at line 83), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(atlas): preserve exact filtered aggregate connections”; “fix(atlas): preserve filtered links across tile boundaries”; “no-mistakes(ci): ci-1: sparse 715453e4 failed at tick 92. Viewer 14 on hinted server A held revision 12713 for 30.5s; the sampler had coverage, so the oracle held. Meters: from tick 77 most of A's queries ran 512-1023ms (B 256-511), and A's auth query and pool waits rose at the same tick, i.e. load across all of A. Compact showed the same step at tick 44 but stayed under the deadline. Refreshes near the 1s deadline miss it, keep the frame silently, and repeat the full build on the next tick. Cause: each scale tile has about 127 device glyphs, and BitmapView called TopologyAtlas.device_ordinals once per glyph. That is about 8,128 dirty-NIF calls per refresh, about 81k/s per replica on 4 dirty CPU schedulers that A shares with publication. Temporary RBE probe (real NIF, 8 concurrent views, not committed), c6111415: per-glyph p50 172-185ms vs per-tile 2-3ms. Fix: resolve a tile's device glyphs in one call (128 rows max, within the 8,192-ID bound). Row order, device_ordinals_busy and source_changed are unchanged. No limit, deadline, workload, RBAC or cleanup change. No committed test: a call count needs a test-only seam, and DB tests own leaf-row correctness. Files: elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_view.ex, docs/topology-bitmap-scale-acceptance.md (compact de9f2325 pass and sparse failure recorded), openspec/changes/add-topology-bitmap-query-index/tasks.md (4.2 note), docs/architecture/topology-bitmap-index-proposal.html and topology-bitmap-index-review.md (mirror, SHA and size receipts). Validation (RBE): web-ng quality_check, harness and all unit shards passed, 9b0e3579. make test 419 passed, 2 Swift skipped, f9df0eee. Not run: topology_atlas_db (hosted only), hosted sparse then compact. That the fix clears the stall is unproven. Tasks 4.2/4.7 stay open. Not committed by me”; “no-mistakes(review): Fix mapper rehydrate, tile reasons, and cleanup”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_view.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/native/topology_atlas_nif/src/ordinals.rs elixir/serviceradar_core/native/topology_atlas_nif/src/ordinals.rs:51— elixir/serviceradar_core/native/topology_atlas_nif/src/ordinals.rs changed 7 times in last 90 days and 7 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 topology_atlas_nif::ordinals::engine_error at line 51), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(atlas): preserve exact filtered aggregate connections”; “fix(atlas): preserve filtered links across tile boundaries”; “Fix Atlas index admission, ownership, and membership”; “Fix Atlas review defects in admission, filters, and citations”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/native/topology_atlas_nif/src/ordinals.rs`: 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/agent_links.ex elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex:340— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex changed 11 times in last 90 days and 6 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 AgentLinks.finalize_plan at line 340), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(atlas): preserve progress across index and projection retries”; “no-mistakes(review): Fix mapper rehydrate, tile reasons, and cleanup”; “no-mistakes(review): Fix pending headroom, delivery fences, and restores”; “no-mistakes(review): Fix purge restore, membership fences, and pending rescan”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.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/config_sync_forwarder.ex elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/config_sync_forwarder.ex:94— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/config_sync_forwarder.ex changed 10 times in last 90 days and 6 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 ConfigSyncForwarder.fetch_config_if_changed at line 94), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sweep): cheap lease re-issue with hello digests, bounded lock, worker rescue”; “fix(sweep): run a session's lease refresh on core without a caller deadline”; “fix(cluster): handle mixed-version :undef RPC calls across rolling upgrades”; “fix(gateway): deliver reconnect config push to the owning session directly”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/config_sync_forwarder.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: rust/topology-atlas/src/ordinals.rs rust/topology-atlas/src/ordinals.rs:93— rust/topology-atlas/src/ordinals.rs changed 6 times in last 90 days and 6 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 CanonicalOrdinals::apply at line 93), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(atlas): preserve exact filtered aggregate connections”; “fix(atlas): preserve filtered links across tile boundaries”; “no-mistakes(review): Fix pending headroom, delivery fences, and restores”; “fix(atlas): preserve canonical projection progress and identity”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- rust/topology-atlas/src/ordinals.rs`: 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/topology/bitmap_expression.ex elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_expression.ex:11— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_expression.ex changed 7 times in last 90 days and 5 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 BitmapExpression.parse at line 11), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(review): Fix mapper rehydrate, tile reasons, and cleanup”; “Fix Atlas index admission, ownership, and membership”; “Fix Atlas review defects in admission, filters, and citations”; “fix(topology): bound query replacement and scale cleanup”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_expression.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/observability/service_state_registry/status_normalizer.ex elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/status_normalizer.ex:174— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/status_normalizer.ex changed 6 times in last 90 days and 5 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 StatusNormalizer.message_summary at line 174), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): keep service state messages whole instead of cutting them at 2048 characters”; “fix(plugins): per-assignment result identity and AWX command routing”; “fix(services): drop action-only plugin assignments from plugin service state”; “fix(core): isolate result ingestion in bounded keyed workers”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/status_normalizer.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: go/pkg/agent/release_runtime.go go/pkg/agent/release_runtime.go:111— go/pkg/agent/release_runtime.go changed 6 times in last 90 days and 5 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 agent.activateStagedRelease at line 111), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): keep the release behind a rollback alias when pruning”; “fix(agent): keep only the current and previous release on disk”; “fix(agent): pass --addon-binary to the agent-updater for systemd add-on installs”; “fix(agent): prevent launcher crash loop on unwritable seed-installed dir”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- go/pkg/agent/release_runtime.go`: 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/native/god_view_nif/src/bitmap_pending.rs elixir/web-ng/native/god_view_nif/src/bitmap_pending.rs:67— elixir/web-ng/native/god_view_nif/src/bitmap_pending.rs changed 5 times in last 90 days and 5 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 Index::mark_dirty at line 67), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(ci): I checked the tree and made no edits. The six-file diff from the previous CI fix is still in the worktree uncommitted (6 files, +182/-35), and git diff --check is clean. Changes: - Native contention fix (bitmap_index/pending/staging.rs): lock sections are short, so a busy native writer no longer starves readers into query_busy. Budgets, deadlines and limits are the same. - Acceptance test: when a wait fails it reports bounded stats for all 100 clients and metrics for both replicas, with session secrets left out. - Fixture cleanup: bulk deletion skips the rollup and recounts once. This applies only to the scale fixture. - docs/topology-bitmap-scale-acceptance.md: records the failed hosted compact run (e578c706) honestly. It claims no pass. - All earlier fixes are kept: role seeder, ConnectionPool, upgrade preflight, Meter. Evidence: full make test 8cae9d97-d152-487f-9ace-2a84e867dc8b passed 419, with 2 Swift tests skipped. Native repeat 79b66852-bd4b-485b-952e-580eb0f09d5c passed 10/10. The negative controls 709e2f19 and 528b74c0 failed before the fix. The focused final run's ID begins 59a35a9f. Its full UUID was not in this session's records or the diff, so I could not confirm it. Still pending: hosted compact, then sparse WebNgDbDiagnostic. Tasks 4.2 and 4.7 stay open. No merge or rollout. Nothing was committed, published or reconfigured, and no credentials were printed”; “no-mistakes(review): Fix pending headroom, delivery fences, and restores”; “no-mistakes(review): Fix purge restore, membership fences, and pending rescan”; “fix(topology): include dirty bitmap in address capacity”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/native/god_view_nif/src/bitmap_pending.rs`: 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/discovery_ingestor.ex elixir/serviceradar_core/lib/serviceradar/inventory/discovery_ingestor.ex:145— elixir/serviceradar_core/lib/serviceradar/inventory/discovery_ingestor.ex changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is DiscoveryIngestor.decode_and_enqueue at line 145), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(ci): BazelCI failed only on //elixir/serviceradar_core:unit_tests_serviceradar_inventory with 9 failures, all ServiceRadar.Inventory.DiscoveryIngestorTest crashing on undefined function ServiceRadar.Inventory.Discovery.Buffer.offer/1 (Buffer only defines offer/2,3). Root cause is a PR-caused rebase regression: commit be8fe4f79f reverted staging's producer-scoping fix (c63189b244) by changing route/3 back to Buffer.offer(envelope) and deleting producer_scope/1. Invariant violated: snapshot reassembly/supersession state must always be keyed by the gateway-attested producer scope (partition, gateway, agent, producer_type, producer_id), and Buffer.offer requires that scope at every call; the single production call site is discovery_ingestor.ex:97. Fix restores Buffer.offer(envelope, producer_scope(attested)) plus the producer_scope/1 helper (byte-identical to staging for that hunk) and corrects the stale offer/1 test comment to offer/2. Verified statically (single call site, helper present, git diff --check clean); no local Mix/Bazel compile per pipeline directive — PR BazelCI must re-run as the final gate”; “fix(core): isolate result ingestion in bounded keyed workers”; “fix(core): isolate result ingestion in bounded keyed workers”; “fix(discovery): scope snapshot state by producer”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/inventory/discovery_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/serviceradar_core/lib/serviceradar/identity/changes/record_role_change.ex elixir/serviceradar_core/lib/serviceradar/identity/changes/record_role_change.ex:18— elixir/serviceradar_core/lib/serviceradar/identity/changes/record_role_change.ex changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is RecordRoleChange.change at line 18), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(gate.lint.elixir-quality): Fix Elixir alias order for quality gate”; “no-mistakes(review): Fix RecordRoleChange actor lookup via AshContext contract”; “no-mistakes(ci): BazelCI failed in //elixir/serviceradar_core:integration_tests_async: RoleChangeAuditDbTest 'admin updating a user's role writes exactly one audit event' asserted metadata["actor"] == admin.email but got the admin's UUID. Root cause: User.email is :ci_string, so loaded users carry %Ash.CiString{}, but every email-extracting format_actor clause in record_role_change.ex guarded on is_binary(email). The guard rejected CiString, fell through to the %User{id: id} clause, and the audit row recorded the UUID instead of the email. Invariant: all email-extracting format_actor clauses must accept Ash.CiString as well as binary. Fixed all 5 sibling clauses with the same small correction (or is_struct(email, Ash.CiString) + to_string(email), matching the codebase's established email_string pattern); binary behavior is unchanged since to_string/1 is identity on binaries. Also fixed the test assertion to to_string(admin.email) because metadata round-trips through JSONB as plain strings and can never == a CiString struct. Verified: mix format clean, mix compile with 0 compilation errors; traced the failing sequence (now yields the email string) and the system-actor/binary paths (unchanged)”; “fix(identity): safely resolve actor from context struct and unpack paginated auth events”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/identity/changes/record_role_change.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/retired_status_sources.ex elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/retired_status_sources.ex:68— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/retired_status_sources.ex changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is RetiredStatusSources.refusal_family at line 68), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(plugins,agent): surface add-on install failures, recover paused rollouts, and bound status fields”; “fix(agent,gateway): bound status summaries by construction; report oversized summaries apart from upgrades”; “fix(agent-gateway): do not acknowledge status pushes that carried refused durable data”; “no-mistakes(review): Refuse oversized status summaries without RPC errors; fix docs”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/retired_status_sources.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/observability/stateful_alert_engine/owner.ex elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/owner.ex:125— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/owner.ex changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is Owner.cleanup_owned at line 125), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): send Ash notifications from the edge ledger transaction after commit (#6378)”; “fix(core): name and harden short-timeout DB callers (#6087)”; “fix(alerts): send alert-engine notifications after commit instead of dropping them”; “fix(core): delete stale rule snapshots whose alert was already removed”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/owner.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/native/god_view_nif/src/bitmap_staging.rs elixir/web-ng/native/god_view_nif/src/bitmap_staging.rs:115— elixir/web-ng/native/god_view_nif/src/bitmap_staging.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is Index::begin_publish at line 115), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “no-mistakes(ci): I checked the tree and made no edits. The six-file diff from the previous CI fix is still in the worktree uncommitted (6 files, +182/-35), and git diff --check is clean. Changes: - Native contention fix (bitmap_index/pending/staging.rs): lock sections are short, so a busy native writer no longer starves readers into query_busy. Budgets, deadlines and limits are the same. - Acceptance test: when a wait fails it reports bounded stats for all 100 clients and metrics for both replicas, with session secrets left out. - Fixture cleanup: bulk deletion skips the rollup and recounts once. This applies only to the scale fixture. - docs/topology-bitmap-scale-acceptance.md: records the failed hosted compact run (e578c706) honestly. It claims no pass. - All earlier fixes are kept: role seeder, ConnectionPool, upgrade preflight, Meter. Evidence: full make test 8cae9d97-d152-487f-9ace-2a84e867dc8b passed 419, with 2 Swift tests skipped. Native repeat 79b66852-bd4b-485b-952e-580eb0f09d5c passed 10/10. The negative controls 709e2f19 and 528b74c0 failed before the fix. The focused final run's ID begins 59a35a9f. Its full UUID was not in this session's records or the diff, so I could not confirm it. Still pending: hosted compact, then sparse WebNgDbDiagnostic. Tasks 4.2 and 4.7 stay open. No merge or rollout. Nothing was committed, published or reconfigured, and no credentials were printed”; “Fix Atlas index admission, ownership, and membership”; “Fix Atlas review defects in admission, filters, and citations”; “fix(topology): validate scalar facets and share catalog reads”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/native/god_view_nif/src/bitmap_staging.rs`: 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/camera_relay_webrtc_signaling_manager.ex elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc_signaling_manager.ex:47— elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc_signaling_manager.ex changed 5 times in last 90 days and 3 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 CameraRelayWebRTCSignalingManager.rpc at line 47), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cluster): handle mixed-version :undef RPC calls across rolling upgrades”; “fix(camera): route WebRTC signaling to the core-elx node hosting the relay”; “fix(camera): deliver core-elx ICE candidates to the browser viewer”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc_signaling_manager.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/edge/gateway_certificate_issuer.ex elixir/web-ng/lib/serviceradar_web_ng/edge/gateway_certificate_issuer.ex:83— elixir/web-ng/lib/serviceradar_web_ng/edge/gateway_certificate_issuer.ex changed 5 times in last 90 days and 3 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 GatewayCertificateIssuer.rpc_issue at line 83), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cluster): handle mixed-version :undef RPC calls across rolling upgrades”; “fix(audit): publish gateway certificate-mint audits from the requesting node”; “no-mistakes(review): Fix certificate renewal tracking, lifetime validation, aliases, and scheduling”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 22:52:00 -06:00' --until='2026-11-12 22:52:00 -06:00' --full-history --no-merges -- elixir/web-ng/lib/serviceradar_web_ng/edge/gateway_certificate_issuer.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 (15 lines × 2) elixir/palisade/lib/palisade/network_address_policy.ex:62— elixir/palisade/lib/palisade/network_address_policy.ex:62-76 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:39-53 — 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 53 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/agent_runtime_metadata.ex:162— elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex:162-176 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:984-998 — 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/automation/ansible/live_awx_launch_preflight.ex:573— elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:573-587 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:634-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:573` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/dashboards/manifest.ex:525— elixir/serviceradar_core/lib/serviceradar/dashboards/manifest.ex:525-539 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1982-1996 — 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/edge/projectors/flow_attribution.ex:126— elixir/serviceradar_core/lib/serviceradar/edge/projectors/flow_attribution.ex:126-140 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/otlp_relay.ex:147-161 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/edge/projectors/flow_attribution.ex` and `elixir/serviceradar_core/lib/serviceradar/edge/projectors/otlp_relay.ex` as WHOLE FILES: this scan already matched 3 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. 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/edge/proxmox_console_sessions.ex:266— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:266-280 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:499-513 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:625— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:625-639 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1781-1795 — 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 12 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/integrations/armis_northbound_runner.ex:2137— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2137-2151 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2160-2174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1467— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1467-1481 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1494-1508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:107— elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:107-121 | elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:282-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:107` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:466— elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:466-480 | elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:498-512 — both copies are in the same file, so extract the 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/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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 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-110 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:92-106 — 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 10 separate duplicated blocks between them, totalling at least 125 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/plugins/netprobe_addon_package_seeder.ex:94— elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:94-108 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:95-109 — 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 12 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/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 10 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:259— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:259-273 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:477-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:259` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:258` calls `to_string`, `effective_package_id` and `elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:476` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) 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-24 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:10-24 — 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:4587— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4587-4601 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4654-4668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4587` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:285— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:285-299 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:440-454 — both copies are in the same file, so extract the 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:750-764 — 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/interface_live/show.ex:1925— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1925-1939 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2301-2315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:1925` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 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-140 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:148-162 — both copies are in the same file, so extract the 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.
+ 18 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×39
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:629— elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:629-629 | elixir/serviceradar_core/lib/serviceradar/edge/plan_validate.ex:535-536 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read.ex:61— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read.ex:61-62 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/upload.ex:197-197 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_picker.ex:33— elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_picker.ex:33-34 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/group_access.ex:407-407 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:2032— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:2032-2032 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2780-2780 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/state_change_publisher.ex:189— elixir/serviceradar_core/lib/serviceradar/event_writer/state_change_publisher.ex:189-189 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:283-284 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:340— elixir/serviceradar_core/lib/serviceradar/registry/process_registry.ex:340-340 | elixir/serviceradar_core/lib/serviceradar/telemetry.ex:1568-1568 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:165— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:165-165 | elixir/serviceradar_nvr/lib/serviceradar_nvr/session.ex:87-88 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_nvr/lib/serviceradar_nvr/publication.ex:152— elixir/serviceradar_nvr/lib/serviceradar_nvr/publication.ex:152-152 | elixir/serviceradar_recording_metadata/lib/serviceradar_recording_metadata/local_publication_intent.ex:56-58 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:735— elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:735-735 | elixir/serviceradar_core/lib/serviceradar/notifications/validations/schedule_windows.ex:145-145 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_picker.ex:44— elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_picker.ex:44-49 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/group_access.ex:414-414 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_picker.ex:56— elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_picker.ex:56-61 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/group_access.ex:418-418 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_finding_emitter.ex:370— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_finding_emitter.ex:370-374 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/bulk.ex:66-66 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:231— elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:231-231 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:228-228 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards.ex:226— elixir/web-ng/lib/serviceradar_web_ng/dashboards.ex:226-226 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_hub_live/index.ex:495-498 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:164— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:164-164 | elixir/serviceradar_nvr/lib/serviceradar_nvr/session.ex:85-85 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/user_groups_live.ex:414— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/user_groups_live.ex:414-414 | elixir/web-ng/lib/serviceradar_web_ng_web/live/user_live/settings.ex:534-534 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:265— elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:265-266 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9253-9253 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_sources_components.ex:446— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_sources_components.ex:446-446 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:1572-1572 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:1247— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:1247-1248 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2700-2700 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_reaper.ex:80— elixir/serviceradar_core/lib/serviceradar/camera/relay_session_reaper.ex:80-80 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/execution_reaper.ex:154-154 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:290— elixir/serviceradar_core/lib/serviceradar/plugins/snmp_requirement_catalog.ex:290-290 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/edge_pipeline.ex:425-425 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:172— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/worker.ex:172-172 | elixir/serviceradar_nvr/lib/serviceradar_nvr/session.ex:90-91 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2871— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2871-2871 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:2300-2300 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/binding_review.ex:743— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/binding_review.ex:743-743 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/membership_review.ex:887-887 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/membership_review.ex:818— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/membership_review.ex:818-818 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/security_live/vulnerability_feeds.ex:419-419 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 14 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×37
Members sharing a duplicated core (4 members, 50+ identical tokens) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1286— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1286-1294 | elixir/serviceradar_core/lib/serviceradar/agent_tracker.ex:292-300 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1975-1983 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:372-380 — 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-1671 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2450-2461 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1378-1389 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1438-1448 — 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-463 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:522-530 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:927-934 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:993-1001 — 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-478 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:541-553 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:938-949 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1012-1024 — 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) REDACTED:30— REDACTED:30-67 | REDACTED:84-123 | REDACTED:209-255 | REDACTED:409-450 — 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:588-594 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1744-1750 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:1488-1494 — 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:354— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:354-380 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:424-439 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1185-1204 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1208-1223 — 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-58 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:40-64 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:41-65 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:34-54 — 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-70 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:68-82 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:69-83 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:58-66 — 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-92 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:93-108 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:94-109 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:77-88 — 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-110 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:118-138 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:119-139 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:92-106 — 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:123— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:123-375 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:380-525 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:530-661 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:666-768 — 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_media_session_tracker.ex:130— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:130-165 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:208-259 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:468-504 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:516-541 — 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:293-305 | 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:144-156 — 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:301— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:301-317 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:448-471 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:554-570 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:88-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/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2297— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2297-2311 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:8-37 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mail_live.ex:368-388 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:979-1010 — 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:579— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:579-585 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:479-485 | elixir/web-ng/lib/serviceradar_web_ng_web/live/metric_live/show.ex:398-404 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:1087-1093 — 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:457— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:457-486 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:662-713 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:717-745 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:749-786 — 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:1687— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1687-1696 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:24-36 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:29-42 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1021-1034 — 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:357-393 — 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:988-996 — 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) go/cmd/wasm-plugins/axis/main.go:823— go/cmd/wasm-plugins/axis/main.go:823-839 | go/pkg/agent/push_loop_addons.go:596-614 | go/pkg/devicealias/alias.go:138-157 | go/pkg/endpointinventory/hashes.go:598-615 — 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) go/pkg/agent/desktop_media_sender.go:436— go/pkg/agent/desktop_media_sender.go:436-456 | go/pkg/agent/desktop_rdp_helper_adapter.go:299-319 | REDACTED:506-526 | go/pkg/agent/remoteaccess/desktop_adapter_probe.go:209-229 — 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) go/pkg/agent/plugin_runtime_wazero.go:38— go/pkg/agent/plugin_runtime_wazero.go:38-111 | go/pkg/agent/plugin_runtime_wazero.go:122-187 | go/pkg/agent/plugin_runtime_wazero.go:195-253 | go/pkg/agent/proxmox_console_plugin.go:241-294 — 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) go/pkg/agent/push_loop_discovery_edge.go:187— go/pkg/agent/push_loop_discovery_edge.go:187-201 | go/pkg/agent/push_loop_plugin_results_edge.go:161-175 | go/pkg/agent/push_loop_telemetry_edge.go:195-210 | go/pkg/agent/push_loop_workload_identity_edge.go:86-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.
+ 12 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×37
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:136— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:136-165 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/verdict_emitter.ex:169-190 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:573— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:573-645 | elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl:90-111 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:57— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:57-83 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:78-99 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:553— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:553-579 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1338-1359 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:213— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:213-234 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:300-322 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) go/cmd/tools/ubuntu-feed-merge/projector.go:1861— go/cmd/tools/ubuntu-feed-merge/projector.go:1861-1882 | go/cmd/tools/ubuntu-feed-merge/projector.go:1884-1914 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) go/pkg/mtr/socket_linux.go:77— go/pkg/mtr/socket_linux.go:77-100 | go/pkg/mtr/socket_linux.go:102-123 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1109— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1109-1130 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:659-690 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:695— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:695-716 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:709-730 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1154— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1154-1179 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1183-1204 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:858— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:858-879 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:885-906 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) go/pkg/agent/addon_activation.go:564— go/pkg/agent/addon_activation.go:564-589 | go/pkg/agent/addon_systemd.go:809-830 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:97— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:97-118 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:144-165 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/operations_index.ex:48— elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/operations_index.ex:48-69 | elixir/web-ng/lib/serviceradar_web_ng_web/live/deduplication_live/index.ex:34-58 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:161— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:161-182 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:186-210 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:226— elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:226-248 | elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:257-278 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1360— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1360-1381 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:836-861 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/security_live/vulnerability_feeds.ex:92— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/security_live/vulnerability_feeds.ex:92-113 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/security_live/vulnerability_feeds.ex:118-142 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:33— elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:33-54 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/ocsf_mapper.ex:64-86 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/auth/token_revocation.ex:25— elixir/web-ng/lib/serviceradar_web_ng/auth/token_revocation.ex:25-47 | elixir/web-ng/lib/serviceradar_web_ng/auth/token_revocation.ex:62-83 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6047— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6047-6068 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6081-6102 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:153— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:153-176 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_action_runtime.ex:180-201 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex:715— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex:715-738 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex:773-794 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:569— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:569-593 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:593-614 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) go/pkg/agent/control_stream.go:2011— go/pkg/agent/control_stream.go:2011-2032 | go/pkg/agent/mtr_bulk.go:552-573 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 12 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×37
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:42— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:42-62 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:67-88 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) go/pkg/mtr/socket_darwin.go:117— go/pkg/mtr/socket_darwin.go:117-139 | go/pkg/mtr/socket_linux.go:241-261 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:331— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:331-353 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:314-334 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1354— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1354-1374 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1435-1455 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:168— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:168-188 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:188-208 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:116— rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:116-136 | rust/rdp-connector-probe/src/probe/support.rs:97-123 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:461— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:461-481 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:486-506 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:195— elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:195-215 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_importer.ex:254-275 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/changes/release_rollout_override.ex:77— elixir/serviceradar_core/lib/serviceradar/plugins/changes/release_rollout_override.ex:77-97 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/roll_back_revoked_candidate.ex:40-70 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/installed_live.ex:28— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/installed_live.ex:28-50 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/updates_live.ex:23-43 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) go/pkg/edge/edgerecord/publication_identity.go:151— go/pkg/edge/edgerecord/publication_identity.go:151-171 | go/pkg/edge/edgerecord/publication_identity.go:184-204 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:104— swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:104-124 | swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:126-148 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex:153— elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex:153-176 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:978-998 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:399— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:399-419 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:831-851 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:1461— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:1461-1482 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:1486-1506 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1984— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1984-2011 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:2017-2037 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rust/fieldsurvey-sidekick/src/api/streams.rs:91— rust/fieldsurvey-sidekick/src/api/streams.rs:91-111 | rust/fieldsurvey-sidekick/src/api/streams.rs:188-208 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) go/pkg/agent/remoteaccess/desktop_session_guard.go:107— go/pkg/agent/remoteaccess/desktop_session_guard.go:107-130 | go/pkg/agent/remoteaccess/desktop_session_guard.go:139-159 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/notifications/firehose_replay.ex:342— elixir/web-ng/lib/serviceradar_web_ng/notifications/firehose_replay.ex:342-362 | elixir/web-ng/lib/serviceradar_web_ng/notifications/firehose_replay.ex:394-415 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rust/correlation-engine/src/subscriber.rs:74— rust/correlation-engine/src/subscriber.rs:74-95 | rust/correlation-engine/src/subscriber.rs:100-120 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rust/netprobe/ebpf/src/lib.rs:662— rust/netprobe/ebpf/src/lib.rs:662-682 | rust/netprobe/ebpf/src/lib.rs:725-745 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rust/workload-identity/src/lib.rs:879— rust/workload-identity/src/lib.rs:879-899 | rust/workload-identity/src/lib.rs:1065-1085 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/targets.ex:12— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/targets.ex:12-32 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/targets.ex:36-63 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:654— elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:654-674 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:763-787 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) go/pkg/agent/plugin_runtime_host_authority.go:1172— go/pkg/agent/plugin_runtime_host_authority.go:1172-1193 | go/pkg/agent/plugin_runtime_host_authority.go:2014-2034 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
srql::query::sql_placeholders::rewrite_placeholders_with_style (cognitive 83) rust/srql/src/query/sql_placeholders.rs:34— srql::query::sql_placeholders::rewrite_placeholders_with_style has cognitive complexity 83 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 8 (24 pts), boolean chains 9, match/switch 4 (9 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
srql::query::sysmon::to_sql_and_params (cognitive 62) rust/srql/src/query/sysmon.rs:565— srql::query::sysmon::to_sql_and_params has cognitive complexity 62 (threshold 15). Drivers by points: if/else 34 (51 pts), boolean chains 5, match/switch 3 (5 pts), loops 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.
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::virtualization::filter_predicate (cognitive 39) rust/srql/src/query/virtualization.rs:219— 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::devices::filters::apply_filter (cognitive 35) rust/srql/src/query/devices/filters.rs:68— srql::query::devices::filters::apply_filter has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 4 (7 pts) (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.
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::logs::stats::build_stats_query (cognitive 29) rust/srql/src/query/logs/stats.rs:70— srql::query::logs::stats::build_stats_query has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (6 pts), loops 4 (5 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.
srql::query::starrocks::dataset_sql (cognitive 28) rust/srql/src/query/starrocks.rs:272— srql::query::starrocks::dataset_sql has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (18 pts), match/switch 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
srql::query::downsample::sql::build_sql (cognitive 25) rust/srql/src/query/downsample/sql.rs:49— srql::query::downsample::sql::build_sql has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 5, match/switch 3 (4 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.
srql::query::timeseries_metrics::build_stats_query_with_source (cognitive 24) REDACTED:1524— srql::query::timeseries_metrics::build_stats_query_with_source has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 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::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::starrocks::profile_sql (cognitive 22) rust/srql/src/query/starrocks.rs:1699— srql::query::starrocks::profile_sql has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 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, 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::starrocks::field_sql (cognitive 21) rust/srql/src/query/starrocks.rs:2437— srql::query::starrocks::field_sql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
srql::query::agents::apply_single_order (cognitive 20) rust/srql/src/query/agents.rs:472— srql::query::agents::apply_single_order has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 19 (20 pts) (nesting depth added 1). 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. 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 (cognitive 20) rust/srql/src/query/agents.rs:554— srql::query::agents::apply_secondary_order has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 19 (20 pts) (nesting depth added 1). 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. 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::query::bmp_events::apply_ordering (cognitive 20) rust/srql/src/query/bmp_events.rs:269— 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::mtr_hops::parse_single_agg (cognitive 20) rust/srql/src/query/mtr_hops.rs:755— 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::services::apply_ordering (cognitive 20) rust/srql/src/query/services.rs:492— 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:3136— 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::virtualization::order_column (cognitive 20) rust/srql/src/query/virtualization.rs:560— 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::starrocks::stats_select (cognitive 19) rust/srql/src/query/starrocks.rs:1455— srql::query::starrocks::stats_select has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
srql::parser::filters::build_filter (cognitive 18) rust/srql/src/parser/filters.rs:5— srql::parser::filters::build_filter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 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.
srql::query::device_graph::extract_params (cognitive 18) rust/srql/src/query/device_graph.rs:51— srql::query::device_graph::extract_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 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.
srql::query::logs::time::apply_ordering (cognitive 18) rust/srql/src/query/logs/time.rs:23— 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:875— MethodTooLong — convert_ipfix runs 218 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 118 over it, 2.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: 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: Index.publish_complete elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:462— MethodTooLong — publish_complete runs 188 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 88 over it, 1.88× 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:144— MethodTooLong — handleMtrBulkRun runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× 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:1002— MethodTooLong — connect_once runs 182 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 82 over it, 1.82× 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:105— MethodTooLong — run runs 180 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 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.
MethodTooLong: Publisher.publish_pending rust/flow-collector/src/publisher.rs:732— MethodTooLong — publish_pending runs 175 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 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
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: 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:99— MethodTooLong — Sync runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.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.
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: QueryEngine.execute_query rust/srql/src/query/engine.rs:38— MethodTooLong — execute_query 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.
MethodTooLong: SweepService.GetSweepResults go/pkg/agent/sweep_service.go:504— MethodTooLong — GetSweepResults runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RPerfTestOrchestrator.start rust/rperf-client/src/server.rs:78— MethodTooLong — start runs 131 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 31 over it, 1.31× 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: Config.validate rust/flow-collector/src/config.rs:566— MethodTooLong — validate 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: 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: Converter.convert_v9 rust/flow-collector/src/netflow/converter.rs:707— MethodTooLong — convert_v9 runs 119 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 19 over it, 1.19× 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.
+ 8 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×33
Edited copy of a member (20 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:793— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:793-812 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:816-835 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:115— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:115-138 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:123-142 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:428— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle.ex:428-447 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:518-537 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:670— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:670-689 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:774-793 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_reaper.ex:131— elixir/serviceradar_core/lib/serviceradar/camera/relay_session_reaper.ex:131-150 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/execution_reaper.ex:129-150 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1004— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1004-1023 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1304-1324 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:224— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:224-243 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:296-315 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:118— elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:118-139 | elixir/serviceradar_core/src/serviceradar_otel_log_handler_v2.erl:144-163 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1260— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1260-1283 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1288-1307 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) rust/srql/src/query/identity/decisions.rs:113— rust/srql/src/query/identity/decisions.rs:113-132 | rust/srql/src/query/identity/deduplication_tasks.rs:113-136 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:513— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:513-532 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:459-479 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:121— elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:121-140 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/unleased_sweep_results.ex:97-123 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:519— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:519-538 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:544-565 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:593— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:593-616 | elixir/web-ng/lib/serviceradar_web_ng/ansible_automation/history.ex:208-227 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) rust/rdp-adapter/src/backend_ironrdp/planning.rs:51— rust/rdp-adapter/src/backend_ironrdp/planning.rs:51-73 | rust/rdp-connector-probe/src/probe/model.rs:416-435 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:180— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:180-199 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:205-225 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) rust/srql/src/query/interfaces/filters.rs:211— rust/srql/src/query/interfaces/filters.rs:211-230 | rust/srql/src/query/interfaces/filters.rs:237-263 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2132— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2132-2151 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2155-2174 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) go/pkg/k8sinventory/runtime.go:112— go/pkg/k8sinventory/runtime.go:112-131 | go/pkg/trivysidecar/runtime.go:65-89 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:168— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:168-187 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:213-233 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) go/pkg/agent/addon_systemd.go:266— go/pkg/agent/addon_systemd.go:266-285 | go/pkg/agent/addon_systemd.go:744-769 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:16— elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:16-35 | elixir/web-ng/lib/serviceradar_web_ng/nvr_publication_listener.ex:14-37 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:283— elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:283-304 | elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:316-335 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) go/pkg/agent/server.go:359— go/pkg/agent/server.go:359-378 | go/pkg/agent/server.go:394-413 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5540— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5540-5559 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5697-5721 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:701— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:701-717 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:919-935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:701` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:372— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:372-388 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:956-972 — 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 12 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 (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:532— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:532-548 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:677-693 — both copies are in the same file, so extract the 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/inventory/identity/registrar.ex:247— elixir/serviceradar_core/lib/serviceradar/inventory/identity/registrar.ex:247-263 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/agent_links.ex:596-612 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/registrar.ex:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:469— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:469-485 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_succession.ex:781-797 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:412— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:412-428 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/link_local_alias_archive.ex:156-193 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/link_local_alias_archive.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) 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-58 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery.ex:198-214 — 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 (17 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-219 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:50-66 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/template_browser.ex:46` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/template_browser.ex:99` calls `put_flash` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/template_browser.ex:63` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:174— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:174-190 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/form_state.ex:221-237 — both copies are in the same file, so extract the 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/event_writer/processors/trivy_reports.ex:775— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:775-791 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:805-821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:775` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:697— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:697-713 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:729-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:697` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:130— elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:130-146 | elixir/web-ng/lib/serviceradar_web_ng_web/live/node_live/show.ex:103-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) elixir/serviceradar_core/lib/serviceradar/dashboards/dashboard_access_grant.ex:273— elixir/serviceradar_core/lib/serviceradar/dashboards/dashboard_access_grant.ex:273-289 | elixir/serviceradar_core/lib/serviceradar/dashboards/dashboard_instance_access_grant.ex:250-266 — 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/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-362 | elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/index.ex:392-408 — 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/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:194— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:194-210 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1187-1203 — 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 13 separate duplicated blocks between them, totalling at least 143 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 lines × 2) go/cmd/wasm-plugins/axis/config_envelope.go:82— go/cmd/wasm-plugins/axis/config_envelope.go:82-98 | go/cmd/wasm-plugins/unifi-protect/config_envelope.go:85-101 — `go/cmd/wasm-plugins/axis/config_envelope.go` and `go/cmd/wasm-plugins/unifi-protect/config_envelope.go` 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 7 separate duplicated blocks between them, totalling at least 93 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) go/cmd/wasm-plugins/proxmox/summaries.go:211— go/cmd/wasm-plugins/proxmox/summaries.go:211-227 | go/pkg/agent/host_identity.go:204-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) go/pkg/agent/addon/manager.go:684— go/pkg/agent/addon/manager.go:684-700 | go/pkg/agent/addon/metric_feed.go:94-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/addon/manager.go:684` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) go/pkg/agent/bumblebee_spool_service.go:334— go/pkg/agent/bumblebee_spool_service.go:334-350 | go/pkg/agent/endpoint_inventory_spool_service.go:160-176 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) go/pkg/cli/edge_onboarding.go:50— go/pkg/cli/edge_onboarding.go:50-66 | go/pkg/models/edge_onboarding.go:87-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/cli/edge_onboarding.go:50` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) go/pkg/scan/icmp_scanner_unix.go:243— go/pkg/scan/icmp_scanner_unix.go:243-259 | go/pkg/scan/icmp_scanner_windows.go:151-167 — before extracting anything, compare `go/pkg/scan/icmp_scanner_unix.go` and `go/pkg/scan/icmp_scanner_windows.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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 (17 lines × 2) go/pkg/scan/icmp_scanner_unix.go:392— go/pkg/scan/icmp_scanner_unix.go:392-408 | go/pkg/scan/icmp_scanner_windows.go:270-286 — before extracting anything, compare `go/pkg/scan/icmp_scanner_unix.go` and `go/pkg/scan/icmp_scanner_windows.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/scan/icmp_scanner_unix.go:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) rust/fieldsurvey-sidekick/src/api/streams.rs:133— rust/fieldsurvey-sidekick/src/api/streams.rs:133-149 | rust/fieldsurvey-sidekick/src/api/streams.rs:226-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/fieldsurvey-sidekick/src/api/streams.rs:133` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/fieldsurvey-sidekick/src/api/streams.rs:132` calls `send_spectrum_batch` and `rust/fieldsurvey-sidekick/src/api/streams.rs:225` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) rust/rdp-adapter/src/backend_ironrdp/planning.rs:57— rust/rdp-adapter/src/backend_ironrdp/planning.rs:57-73 | rust/rdp-connector-probe/src/probe/model.rs:419-435 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/rdp-adapter/src/backend_ironrdp/planning.rs:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
+ 6 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×30
No test reaches this file elixir/web-ng/assets/god_view_world_gpu.playwright.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/god_view_elk_scene_harness.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/camera_recording.playwright.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/camera_codec_capability.playwright.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/god_view_world_gpu_harness.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/component/src/SrqlEditor.jsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/component/src/JdmEditor.jsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/god_view_world_transport_harness.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file js/topology-layout/worker.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/god_view_scene_test_runner.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/cli_bundle.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/browser_fixture_bundle.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/timestamp_formatter_test_runner.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/test-draw-uniforms.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/js/lib/god_view/layout_methods.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/camera_archive_player_harness.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file js/topology-layout/bundle.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/test-deck-layer-2.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/test-deck-layer.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file elixir/web-ng/assets/test-deck-props.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:64— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:64-70 | 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:64— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:64-70 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:272-278 | 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/trivy_reports.ex:740— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:740-746 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:774-780 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:804-810 — 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:103` calls `map_value` and `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:117` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:379— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:379-385 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1988-1994 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:2009-2015 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:379` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 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-77 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/notification_callback_app_controller.ex:130-136 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:477-483 — 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/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:2767-2773 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_package_live/index.ex:1368-1374 — 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 13 separate duplicated blocks between them, totalling at least 143 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/credentials/plugin_assignment_materializer.ex:814— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:814-820 | elixir/serviceradar_core/lib/serviceradar/plugins/value_utils.ex:8-14 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/authored/visuals.ex:288-294 — 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/falco_events.ex:643— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:643-649 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:795-801 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1799-1805 — 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 12 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:643` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:474— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:474-480 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/link_local_alias_archive.ex:197-203 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/netprobe_alias_debris.ex:109-115 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/link_local_alias_archive.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:42— elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:42-48 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_packages.ex:147-153 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_profiles.ex:35-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:67— elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:67-73 | elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:54-60 | elixir/web-ng/lib/serviceradar_web_ng/plugins/registry.ex:31-37 — 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/controllers/api/remote_access_session_controller.ex:1215— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:1215-1221 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex:113-119 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:224-230 — 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 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 (7 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:86— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:86-92 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:201-207 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:108-114 — `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 125 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 × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:150— go/cmd/wasm-plugins/axis/metric_telemetry.go:150-156 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:177-183 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:133-139 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 3) go/cmd/wasm-plugins/axis/signal_schema.go:35— go/cmd/wasm-plugins/axis/signal_schema.go:35-41 | go/cmd/wasm-plugins/proxmox/signal_schema.go:35-41 | go/cmd/wasm-plugins/unifi-protect/signal_schema.go:35-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/axis/signal_schema.go:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) go/pkg/mapper/mikrotik_poller.go:79— go/pkg/mapper/mikrotik_poller.go:79-85 | go/pkg/mapper/proxmox_poller.go:101-107 | go/pkg/mapper/ubnt_helpers.go:32-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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mapper/mikrotik_poller.go:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) go/cmd/wasm-plugins/axis/config_envelope.go:71— go/cmd/wasm-plugins/axis/config_envelope.go:71-77 | go/cmd/wasm-plugins/netbox/config_envelope.go:24-31 | go/cmd/wasm-plugins/unifi-protect/config_envelope.go:74-80 — `go/cmd/wasm-plugins/axis/config_envelope.go` and `go/cmd/wasm-plugins/unifi-protect/config_envelope.go` 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 7 separate duplicated blocks between them, totalling at least 93 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 × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:183— go/cmd/wasm-plugins/axis/metric_telemetry.go:183-189 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:210-216 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:166-172 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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 × 3) go/pkg/agent/push_loop_bumblebee_edge.go:89— go/pkg/agent/push_loop_bumblebee_edge.go:89-95 | go/pkg/agent/push_loop_k8s_public_endpoints_edge.go:137-143 | go/pkg/agent/push_loop_workload_identity_edge.go:190-196 — 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) go/pkg/cli/edge_onboarding.go:521— go/pkg/cli/edge_onboarding.go:521-527 | go/pkg/cli/edge_onboarding.go:646-652 | REDACTED:88-94 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/cli/edge_onboarding.go:521` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 3) rust/edge-onboarding/src/lib.rs:191— rust/edge-onboarding/src/lib.rs:191-198 | rust/edge-onboarding/src/lib.rs:246-252 | rust/edge-onboarding/src/lib.rs:282-288 — 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.
+ 4 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium CVE · ×28
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:117— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:117-132 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:456-471 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:117` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex:69— elixir/serviceradar_core/lib/serviceradar/edge/crypto.ex:69-84 | elixir/web-ng/lib/serviceradar_web_ng/edge/crypto.ex:61-76 — 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 35 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 (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:310— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:310-325 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:505-520 — 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 12 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:310` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/device_hostname_rdns.ex:559— elixir/serviceradar_core/lib/serviceradar/inventory/device_hostname_rdns.ex:559-574 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:220-235 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/device_hostname_rdns.ex:559` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 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-310 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:278-293 — 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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1106— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1106-1121 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:530-545 — 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 17 separate duplicated blocks between them, totalling at least 269 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/notifications/provider_seeder.ex:577— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:577-593 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:626-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:577` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 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-221 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:175-190 — 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:253— elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:253-268 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_vantage_selector.ex:248-263 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:272— elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:272-287 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_vantage_selector.ex:267-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/mtr_consensus_evaluator.ex:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:482— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:482-497 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:530-545 — both copies are in the same file, so extract the 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) elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:80— elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:80-95 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/netbox_import_worker.ex:100-115 — both copies are in the same file, so extract the 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) 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-241 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:270-285 — both copies are in the same file, so extract the 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) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:29— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:29-44 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:50-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 170 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/inventory/hypervisor_enrichment_ingestor.ex:3360— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:3360-3375 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:1032-1047 — 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 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:3378` calls `maybe_put`, `put` and `elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:1050` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/dispatch_schedule.ex:205— elixir/serviceradar_core/lib/serviceradar/notifications/dispatch_schedule.ex:205-220 | elixir/serviceradar_core/lib/serviceradar/observability/production_schedule.ex:243-258 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/dispatch_schedule.ex:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/notifications/dispatch_schedule.ex:198` calls `present`, `reject`, `is_nil` and `elixir/serviceradar_core/lib/serviceradar/observability/production_schedule.ex:240` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) REDACTED:391— REDACTED:391-406 | go/cmd/wasm-plugins/proxmox/console_ssh_go.go:85-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) go/pkg/agent/bumblebee_spool_service.go:215— go/pkg/agent/bumblebee_spool_service.go:215-230 | go/pkg/agent/bumblebee_spool_service.go:284-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/bumblebee_spool_service.go:215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) go/pkg/agent/sweep_config_gateway.go:666— go/pkg/agent/sweep_config_gateway.go:666-681 | go/pkg/agent/sweep_config_gateway.go:702-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/sweep_config_gateway.go:666` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) go/pkg/edge/edgerecord/publication_identity.go:506— go/pkg/edge/edgerecord/publication_identity.go:506-521 | go/pkg/edge/edgerecord/publication_identity.go:528-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) go/pkg/mtr/socket_darwin.go:338— go/pkg/mtr/socket_darwin.go:338-353 | go/pkg/mtr/socket_linux.go:404-419 — before extracting anything, compare `go/pkg/mtr/socket_darwin.go` and `go/pkg/mtr/socket_linux.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) go/pkg/agent/plugin_runtime_manager.go:297— go/pkg/agent/plugin_runtime_manager.go:297-312 | go/pkg/agent/plugin_runtime_manager.go:341-356 — both copies are in the same file, so extract the 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) go/cmd/wasm-plugins/proxmox/summaries.go:193— go/cmd/wasm-plugins/proxmox/summaries.go:193-208 | go/pkg/agent/host_identity.go:186-201 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) go/pkg/agent/addon/manager.go:706— go/pkg/agent/addon/manager.go:706-721 | go/pkg/agent/addon/metric_feed.go:116-131 — 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 (16 lines × 2) elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:144— elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:144-159 | elixir/serviceradar_core/src/serviceradar_otel_log_handler_v2.erl:168-183 — before extracting anything, compare `elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl` and `elixir/serviceradar_core/src/serviceradar_otel_log_handler_v2.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:270— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:270-277 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:282-289 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:243-250 — 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 65 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/automation_result_sanitizer.ex:708— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:708-715 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:1142-1149 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:138-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:708` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:147— elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:147-154 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_assignment_evidence.ex:33-40 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_operation.ex:103-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1972— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1972-1979 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2112-2119 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2621-2628 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1972` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 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-37 | elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:59-66 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:30-37 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex` and `elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:30` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/notifications/action_redemption.ex:289— elixir/serviceradar_core/lib/serviceradar/notifications/action_redemption.ex:289-296 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/alert_lifecycle.ex:243-250 | elixir/web-ng/lib/serviceradar_web_ng/alert_actions.ex:410-417 — 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/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 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:137` calls `load` and `elixir/serviceradar_core/lib/serviceradar/observability/seasonal_baseline_freshness_worker.ex:124` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:83— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:83-90 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:93-100 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:270-277 — 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 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:39— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:39-46 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:44-51 | 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 125 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:42` calls `assign` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:65— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:65-72 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:86-93 | 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 125 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:77` calls `assign`, `build_signal_display` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:64` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9703— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9703-9713 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9913-9920 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:10170-10177 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9703` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 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-114 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/git_catalog_sync_worker.ex:351-358 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_pulse_worker.ex:170-177 — 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 (8 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:286— elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:286-293 | elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:1881-1888 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/data/vulnerable_assets.ex:82-89 — 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/edge/release_artifact_mirror.ex:445— elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:445-452 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_artifact.ex:102-109 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_store.ex:98-105 — 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/object_store/retention_worker.ex:22— elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:22-29 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention_worker.ex:30-37 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention_worker.ex:21-28 — 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/camera_multiview.ex:280— elixir/web-ng/lib/serviceradar_web_ng_web/camera_multiview.ex:280-287 | 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/live/settings/audit_live/event_show.ex:37— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/event_show.ex:37-44 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/events.ex:150-157 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/history.ex:93-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/event_show.ex:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) 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-254 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1249-1256 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:202-209 — 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 13 separate duplicated blocks between them, totalling at least 143 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_core/lib/serviceradar/event_writer/processors/logs.ex:453— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:453-460 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/otel_metrics.ex:320-327 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/otel_traces.ex:270-277 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:130— go/cmd/wasm-plugins/axis/metric_telemetry.go:130-137 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:133-140 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:113-120 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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) go/cmd/wasm-plugins/axis/metric_telemetry.go:165— go/cmd/wasm-plugins/axis/metric_telemetry.go:165-172 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:192-199 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:148-155 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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) go/cmd/wasm-plugins/axis/metric_telemetry.go:174— go/cmd/wasm-plugins/axis/metric_telemetry.go:174-181 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:201-208 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:157-164 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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) go/pkg/agent/cert_renewal.go:530— go/pkg/agent/cert_renewal.go:530-540 | go/pkg/edge/spool/spool.go:1098-1105 | go/pkg/grpc/security.go:560-570 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 3) go/pkg/bumblebee/spool.go:74— go/pkg/bumblebee/spool.go:74-81 | REDACTED:619-626 | go/pkg/endpointinventory/spool.go:157-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/bumblebee/spool.go:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
+ 1 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×25
Edited copy of a member (26 corresponding lines) rust/flow-collector/src/publisher.rs:1806— rust/flow-collector/src/publisher.rs:1806-1851 | rust/flow-collector/src/publisher.rs:2114-2139 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:418— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:418-457 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1272-1297 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:961— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:961-996 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:193-218 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:166— elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:166-193 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:620-645 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:285— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:285-310 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:268-293 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) go/pkg/agent/remoteaccess/enhanced_recording_ebpf.go:79— go/pkg/agent/remoteaccess/enhanced_recording_ebpf.go:79-104 | go/pkg/agent/remoteaccess/enhanced_recording_ebpf.go:106-134 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:350— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:350-375 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:400-431 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:429— elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:429-454 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_retirement.ex:946-971 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_addon_assignment.ex:31— elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_addon_assignment.ex:31-56 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_assignment.ex:37-69 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle_ash_actions.ex:126— elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle_ash_actions.ex:126-151 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_lifecycle_ash_actions.ex:163-188 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) REDACTED:435— REDACTED:435-460 | REDACTED:367-392 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) rust/rdp-adapter/src/backend_ironrdp/connector_handshake/tls_and_kerberos.rs:140— rust/rdp-adapter/src/backend_ironrdp/connector_handshake/tls_and_kerberos.rs:140-165 | rust/rdp-connector-probe/src/probe/tls.rs:97-130 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_graph/canonical_rebuild.ex:543— elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_graph/canonical_rebuild.ex:543-569 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:201-226 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:626— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:626-651 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:873-898 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/custom_templates.ex:185— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/custom_templates.ex:185-210 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/target_oids.ex:36-61 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) go/pkg/agent/sweep_config_gateway.go:665— go/pkg/agent/sweep_config_gateway.go:665-696 | go/pkg/agent/sweep_config_gateway.go:701-726 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1068— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1068-1105 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2911-2936 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_dispatch_worker.ex:276— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_dispatch_worker.ex:276-305 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_probe_manager.ex:224-249 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:213— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:213-241 | elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:138-163 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1713— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1713-1740 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1744-1769 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/recovery_worker.ex:80— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/recovery_worker.ex:80-105 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rollout.ex:140-171 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1378— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1378-1403 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1922-1950 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:724— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:724-766 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:734-759 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:209— elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:209-237 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rule_matcher.ex:160-185 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) REDACTED:272— REDACTED:272-297 | REDACTED:359-392 — These two members are one piece of code written twice and then edited apart: 26 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.
Duplicated block (6 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:160— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:160-165 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:178-183 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:170-175 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 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 11 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:47` calls `get` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:44` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:138— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:138-143 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/invocation_service.ex:155-160 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:173-178 — 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 10 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 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 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 3) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:432— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:432-437 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1197-1202 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1216-1221 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:432` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:116— elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:116-121 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:62-67 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:117-123 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/plugins/changes/issue_direct_leaf_access.ex:93` calls `revoke_previous_identity` and `elixir/serviceradar_core/lib/serviceradar/plugins/changes/revoke_direct_leaf_access.ex:32` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 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-137 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8221-8226 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1981-1986 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex` as WHOLE FILES: this scan already matched 5 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 × 3) elixir/palisade/lib/palisade/outbound_fetch.ex:49— elixir/palisade/lib/palisade/outbound_fetch.ex:49-54 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:28-33 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/outbound_fetch.ex:28-33 — 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 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. 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 × 3) elixir/serviceradar_core/lib/serviceradar/automation/ansible/northbound_bridge.ex:59— elixir/serviceradar_core/lib/serviceradar/automation/ansible/northbound_bridge.ex:59-64 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/command_result_handler.ex:260-265 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:90-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/northbound_bridge.ex:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 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-130 | elixir/serviceradar_core/lib/serviceradar/notifications/validations/provider_package_approved.ex:91-96 | elixir/serviceradar_core/lib/serviceradar/notifications/validations/provider_transport_contract.ex:52-57 — 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/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 151 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/camera_analysis_worker_assignments.ex:28— elixir/web-ng/lib/serviceradar_web_ng/camera_analysis_worker_assignments.ex:28-33 | elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc_signaling_manager.ex:107-112 | elixir/web-ng/lib/serviceradar_web_ng/remote_desktop_webrtc_signaling_manager.ex:63-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/metadata_data.ex:79— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/metadata_data.ex:79-84 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ocsf_components.ex:475-480 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:1461-1466 — 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/ansible/awx_launch_contract.ex:1218— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:1218-1223 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:328-333 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex:389-394 — 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/inventory/remediation/armis_unmerge.ex:499— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:499-504 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/awx_proxmox_unmerge.ex:961-966 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:300-305 — 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 17 separate duplicated blocks between them, totalling at least 269 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/inventory/visibility_profile_srql_target_resolver.ex:43— elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile_srql_target_resolver.ex:43-48 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/srql_target_resolver.ex:100-105 | elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/srql_target_resolver.ex:66-71 — 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) go/cmd/wasm-plugins/axis/metric_telemetry.go:140— go/cmd/wasm-plugins/axis/metric_telemetry.go:140-145 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:143-148 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:123-128 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `go/cmd/wasm-plugins/proxmox/metric_telemetry.go:149` calls `metricThresholds`, `appendMessage`, `encodeMetricStringMapEntry` and `go/cmd/wasm-plugins/axis/metric_telemetry.go:146` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:158— go/cmd/wasm-plugins/axis/metric_telemetry.go:158-163 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:185-190 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:141-146 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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) rust/srql/src/query/starrocks/bmp_events.rs:108— rust/srql/src/query/starrocks/bmp_events.rs:108-113 | rust/srql/src/query/starrocks/mtr.rs:370-375 | rust/srql/src/query/starrocks/otel_metrics.rs:278-283 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `plan` to `&QueryPlan) -> (Vec<String>` in one and `&QueryPlan` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) REDACTED:211— REDACTED:211-216 | REDACTED:213-218 | REDACTED:223-228 — `REDACTED` and `REDACTED` 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 11 separate duplicated blocks between them, totalling at least 178 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) rust/srql/src/query/otel_metric_points.rs:311— rust/srql/src/query/otel_metric_points.rs:311-316 | rust/srql/src/query/otel_metrics.rs:300-305 | rust/srql/src/query/traces.rs:674-679 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/otel_metric_points.rs:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×23
Edited copy of a member (23 corresponding lines) 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-275 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_worker_resolver.ex:207-233 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:435— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:435-457 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:461-498 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:368— elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:368-394 | elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_server.ex:399-421 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) go/pkg/edge/edgerecord/compiled_assignment.go:126— go/pkg/edge/edgerecord/compiled_assignment.go:126-148 | go/pkg/edge/edgerecord/plan.go:119-142 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:665— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:665-687 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:723-750 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) rust/srql/src/query/mtr_hops.rs:1035— rust/srql/src/query/mtr_hops.rs:1035-1057 | rust/srql/src/query/mtr_traces.rs:1115-1139 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:54— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:54-76 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:50-88 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) REDACTED:195— REDACTED:195-217 | rust/srql/src/query/events/filters.rs:832-854 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_interfaces.ex:91— elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_interfaces.ex:91-115 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_topology.ex:84-106 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:817— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:817-839 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:911-939 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:118— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:118-142 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:249-271 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) rust/srql/src/query/field_survey.rs:605— rust/srql/src/query/field_survey.rs:605-627 | rust/srql/src/query/wifi_map.rs:605-627 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:227— elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:227-250 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:416-438 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:93— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:93-115 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:109-131 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:368— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:368-394 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:398-420 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/event_ingestor.ex:350— elixir/serviceradar_core/lib/serviceradar/automation/ansible/event_ingestor.ex:350-374 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/event_ingestor.ex:428-450 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:242— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:242-264 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:376-401 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/plugin_inputs.ex:134— elixir/serviceradar_core/lib/serviceradar/plugins/plugin_inputs.ex:134-164 | elixir/serviceradar_core/lib/serviceradar/plugins/target_batch_params.ex:120-142 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:399— elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:399-422 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_retirement.ex:722-744 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) go/pkg/mapper/discovery_schedule.go:98— go/pkg/mapper/discovery_schedule.go:98-120 | go/pkg/mapper/discovery_schedule.go:123-150 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/storage_usage.ex:38— elixir/web-ng/lib/serviceradar_web_ng/storage_usage.ex:38-60 | elixir/web-ng/lib/serviceradar_web_ng/storage_usage.ex:81-117 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) go/cmd/wasm-plugins/axis/config_envelope.go:12— go/cmd/wasm-plugins/axis/config_envelope.go:12-42 | go/cmd/wasm-plugins/unifi-protect/config_envelope.go:19-41 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2630— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2630-2652 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:841-919 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×23
Edited copy of a member (25 corresponding lines) rust/srql/src/query/addon_statuses.rs:184— rust/srql/src/query/addon_statuses.rs:184-208 | rust/srql/src/query/addon_statuses.rs:214-238 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) rust/srql/src/query/sweep_groups.rs:255— rust/srql/src/query/sweep_groups.rs:255-279 | rust/srql/src/query/sweep_groups.rs:285-309 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:241— elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:241-265 | elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:319-343 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:69— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:69-93 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/verdict_emitter.ex:99-125 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) go/pkg/agent/addon_otlp_relay_edge.go:103— go/pkg/agent/addon_otlp_relay_edge.go:103-127 | go/pkg/agent/push_loop_flow_attribution_edge.go:111-137 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:237— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:237-270 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:272-296 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/dashboard_package_live/index.ex:242— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/dashboard_package_live/index.ex:242-269 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/dashboard_package_live/index.ex:304-328 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core/lib/serviceradar/core/result_processor.ex:256— elixir/serviceradar_core/lib/serviceradar/core/result_processor.ex:256-284 | elixir/serviceradar_core/lib/serviceradar/ingestion/result_ingestor.ex:472-496 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) go/cmd/wasm-plugins/awx/main.go:2752— go/cmd/wasm-plugins/awx/main.go:2752-2776 | go/cmd/wasm-plugins/awx/main.go:2811-2839 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:27— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:27-51 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/telemetry_onboarding_live.ex:40-66 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:87— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:87-112 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:116-140 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:138— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:138-171 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:336-360 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:263— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:263-287 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:291-315 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:261— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:261-290 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:244-268 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) go/pkg/edge/spool/reserve.go:851— go/pkg/edge/spool/reserve.go:851-875 | go/pkg/edge/spool/reserve_resume.go:234-262 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) go/pkg/endpointinventory/packages.go:40— go/pkg/endpointinventory/packages.go:40-67 | go/pkg/endpointinventory/packages.go:79-103 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:646— go/cmd/wasm-plugins/proxmox/inventory_fetch.go:646-673 | go/cmd/wasm-plugins/proxmox/inventory_fetch.go:675-699 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:278— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/assignment_lifecycle.ex:278-302 | elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/status_ingestor.ex:143-172 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:776— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:776-800 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1852-1882 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) go/pkg/agent/dynamic_spool_services.go:24— go/pkg/agent/dynamic_spool_services.go:24-48 | go/pkg/agent/dynamic_spool_services.go:50-74 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:574— elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:574-598 | elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:602-626 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) rust/srql/src/query/endpoint_packages.rs:289— rust/srql/src/query/endpoint_packages.rs:289-320 | rust/srql/src/query/endpoint_packages.rs:322-346 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1821— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1821-1845 | elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:2169-2268 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (9 lines × 3) elixir/palisade/lib/palisade/outbound_fetch.ex:72— elixir/palisade/lib/palisade/outbound_fetch.ex:72-80 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:40-48 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/outbound_fetch.ex:40-48 — 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 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. 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/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:165— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:165-173 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:183-191 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:207-215 — 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 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:165` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1173— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1173-1181 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1310-1318 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:637-645 — 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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1173` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4593— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4593-4601 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4660-4668 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4694-4702 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4593` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 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:362-370 | 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 76 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:367— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:367-375 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:422-430 | 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 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 (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:263— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:263-271 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:365-373 | 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 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 (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:751— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:751-759 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1249-1257 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1269-1277 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:751` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 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-247 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:257-265 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:230-238 — 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 65 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/edge/release_source_importer.ex:314— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:314-322 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:416-424 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:684-692 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex` and `elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.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 (9 lines × 3) elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:90— elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:90-98 | elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:119-127 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/severity.ex:71-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/authored_dashboard_export_controller.ex:126— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/authored_dashboard_export_controller.ex:126-134 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_components.ex:414-422 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:1111-1119 — 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 (9 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8415— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8415-8423 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:2032-2040 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:1043-1052 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex` as WHOLE FILES: this scan already matched 5 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 (9 lines × 3) REDACTED:93— REDACTED:93-101 | go/pkg/agent/proxmox_console_ssh.go:113-121 | go/pkg/agent/remoteaccess/ssh.go:103-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:120— go/cmd/wasm-plugins/axis/metric_telemetry.go:120-128 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:123-131 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:103-111 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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) go/cmd/wasm-plugins/axis/metric_telemetry.go:199— go/cmd/wasm-plugins/axis/metric_telemetry.go:199-207 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:226-234 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:182-190 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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) rust/srql/src/query/endpoint_inventory_scans.rs:312— rust/srql/src/query/endpoint_inventory_scans.rs:312-320 | rust/srql/src/query/endpoint_package_catalog.rs:302-310 | rust/srql/src/query/endpoint_packages.rs:807-815 — before extracting anything, compare `rust/srql/src/query/endpoint_inventory_scans.rs` and `rust/srql/src/query/endpoint_package_catalog.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_inventory_scans.rs:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) rust/srql/src/query/endpoint_inventory_scans.rs:362— rust/srql/src/query/endpoint_inventory_scans.rs:362-370 | rust/srql/src/query/endpoint_package_catalog.rs:352-360 | rust/srql/src/query/endpoint_packages.rs:861-869 — before extracting anything, compare `rust/srql/src/query/endpoint_inventory_scans.rs` and `rust/srql/src/query/endpoint_package_catalog.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_inventory_scans.rs:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) rust/srql/src/query/logs/filters.rs:124— rust/srql/src/query/logs/filters.rs:124-132 | rust/srql/src/query/logs/filters.rs:237-245 | rust/srql/src/query/logs/filters.rs:361-369 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/filters.rs:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) rust/srql/src/query/otel_metric_points.rs:331— rust/srql/src/query/otel_metric_points.rs:331-339 | rust/srql/src/query/otel_metrics.rs:328-336 | rust/srql/src/query/services.rs:538-546 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 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) rust/srql/src/query/devices/stats/clauses.rs:15— rust/srql/src/query/devices/stats/clauses.rs:15-23 | rust/srql/src/query/devices/stats/clauses.rs:69-77 | rust/srql/src/query/devices/stats/clauses.rs:124-132 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices/stats/clauses.rs:15` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) rust/otel/src/agent_forward/mod.rs:263— rust/otel/src/agent_forward/mod.rs:263-271 | rust/otel/src/agent_forward/mod.rs:307-315 | rust/otel/src/agent_forward/mod.rs:345-353 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/otel/src/agent_forward/mod.rs:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) rust/srql/src/query/logs/stats.rs:88— rust/srql/src/query/logs/stats.rs:88-96 | REDACTED:333-341 | REDACTED:650-658 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/stats.rs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:823— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:823-827 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:110-114 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:823` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:302— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:302-307 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:434-438 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1281-1285 — 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 12 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (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 11 separate duplicated blocks between them, totalling at least 115 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:266-270 — 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 10 separate duplicated blocks between them, totalling at least 76 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/event_writer/processors/falco_events.ex:653— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:653-657 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/logs.ex:805-809 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1809-1813 — 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 12 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:653` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:913— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:913-917 | elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:463-467 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1737-1741 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:913` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:64— elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:64-68 | elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:100-104 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:71-75 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex` and `elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:107— elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:107-111 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention_worker.ex:85-89 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention_worker.ex:63-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1336— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1336-1340 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.ex:1032-1036 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:1024-1028 — `elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/worker.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 40 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/worker.ex:1336` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:524— elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:524-528 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:674-678 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:542-546 — 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/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1319— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1319-1323 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/components.ex:168-172 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1815-1819 — before extracting anything, compare `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/plugins/components.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1332— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1332-1336 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/components.ex:198-202 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1828-1832 — before extracting anything, compare `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/plugins/components.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:631— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:631-635 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:603-607 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:504-508 — `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 125 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/device_live/endpoint_inventory_components.ex:1679— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_components.ex:1679-1683 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_data.ex:523-527 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_match_groups.ex:180-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 all 3 call sites, so a change lands once.
Duplicated block (5 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:85— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:85-89 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/identity.ex:159-163 | elixir/web-ng/lib/serviceradar_web_ng_web/observability/service_filter.ex:135-139 — 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/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_availability.ex:13— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_availability.ex:13-17 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_state.ex:19-23 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/index_events/bulk_tags.ex:13-17 — 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/serviceradar_core/lib/serviceradar/analytics/starrocks/log_event_consumers.ex:120— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/log_event_consumers.ex:120-124 | elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/metric_consumers.ex:27-31 | elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/metric_consumers.ex:46-50 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/log_event_consumers.ex:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 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 (5 lines × 3) go/pkg/agent/push_loop_plugin_results_edge.go:267— go/pkg/agent/push_loop_plugin_results_edge.go:267-271 | go/pkg/agent/push_loop_telemetry_edge.go:300-304 | go/pkg/agent/sync_edge.go:244-248 — 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) integration_tests/srql_parity/src/shape.rs:285— integration_tests/srql_parity/src/shape.rs:285-289 | rust/srql/src/query/mtr_hops.rs:979-984 | rust/srql/src/query/mtr_traces.rs:1141-1145 — before extracting anything, compare `rust/srql/src/query/mtr_hops.rs` and `rust/srql/src/query/mtr_traces.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 238 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) rust/srql/src/query/logs/filters.rs:112— rust/srql/src/query/logs/filters.rs:112-116 | rust/srql/src/query/traces.rs:576-580 | rust/srql/src/query/traces.rs:615-620 — before extracting anything, compare `rust/srql/src/query/logs/filters.rs` and `rust/srql/src/query/traces.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/filters.rs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) rust/srql/src/query/logs/rollup.rs:29— rust/srql/src/query/logs/rollup.rs:29-33 | rust/srql/src/query/traces.rs:245-250 | rust/srql/src/query/traces.rs:290-295 — before extracting anything, compare `rust/srql/src/query/logs/rollup.rs` and `rust/srql/src/query/traces.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/rollup.rs:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) rust/srql/src/query/camera_sources.rs:118— rust/srql/src/query/camera_sources.rs:118-122 | REDACTED:168-172 | REDACTED:147-151 — `REDACTED` and `REDACTED` 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 11 separate duplicated blocks between them, totalling at least 176 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:173` calls `push`, `to_string` and `rust/srql/src/query/camera_sources.rs:123` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
TooManyMethods: PushLoop go/pkg/agent/push_loop.go:86— TooManyMethods — 345 methods, declared across 56 files: agent/control_stream.go (39), agent/push_loop_addons.go (32), agent/push_loop_config.go (26), agent/push_loop_state.go (23), +52 more file(s). The bar is 30 methods; this is 315 over it, 11.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: DiscoveryEngine go/pkg/mapper/types.go:31— TooManyMethods — 193 methods, declared across 43 files: mapper/discovery_dedup.go (12), mapper/snmp_l2_bridge.go (12), mapper/discovery_devices.go (11), mapper/proxmox_poller.go (10), +39 more file(s). The bar is 30 methods; this is 163 over it, 6.43× 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: Spool go/pkg/edge/spool/spool.go:200— TooManyMethods — 93 methods, declared across 12 files: spool/spool.go (26), spool/reclaim.go (15), spool/attribution_commit.go (13), spool/recover.go (10), +8 more file(s). The bar is 30 methods; this is 63 over it, 3.10× 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:119— TooManyMethods — 87 methods, declared across 8 files: agent/plugin_runtime_manager.go (52), agent/plugin_runtime_wazero.go (18), agent/plugin_runtime_http.go (6), agent/plugin_runtime_notify.go (4), +4 more file(s). The bar is 30 methods; this is 57 over it, 2.90× 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 — 84 methods, declared across 13 files: agent/plugin_runtime_network.go (20), agent/plugin_runtime_execution.go (14), agent/plugin_runtime_host_authority.go (11), agent/plugin_runtime_artifact.go (9), +9 more file(s). The bar is 30 methods; this is 54 over it, 2.80× 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:31— TooManyMethods — 67 methods, declared across 13 files: sweeper/sweeper_run.go (16), sweeper/sweeper_lifecycle.go (11), sweeper/sweeper_aggregators.go (6), sweeper/sweeper_banner_grab.go (6), +9 more file(s). The bar is 30 methods; this is 37 over it, 2.23× 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 — 57 methods, declared across 17 files: scan/syn_scanner_scan.go (9), REDACTED (6), REDACTED (6), scan/syn_scanner_mappings.go (5), +13 more file(s). The bar is 30 methods; this is 27 over it, 1.90× 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: TopologyClient rust/dgraph-topology/src/client.rs:37— TooManyMethods — 45 methods, declared across 2 files: src/client.rs (42), src/reads.rs (3). 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: WorldMapRenderer elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:53— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 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.
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: Tracer go/pkg/mtr/tracer.go:68— TooManyMethods — 38 methods, declared across 2 files: mtr/tracer.go (34), mtr/tcp_handshake.go (4). 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: EdgeWrite rust/dgraph-topology/src/types/writes.rs:372— 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: RecoveryOperation go/pkg/edge/spool/recovery_operation.go:26— TooManyMethods — 36 methods, declared across 7 files: spool/recovery_operation.go (8), spool/recovery_publication.go (8), spool/recovery_coverage.go (6), spool/recovery_reclaim.go (6), +3 more file(s). The bar is 30 methods; this is 6 over it, 1.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: 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: RecoveryGrant go/pkg/edge/spool/reserve.go:561— TooManyMethods — 33 methods, declared across 5 files: spool/reserve.go (24), spool/reserve_resume.go (5), spool/recovery_control_reserve.go (2), spool/recovery_completion.go (1), +1 more file(s). The bar is 30 methods; this is 3 over it, 1.10× 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: GatewayClient go/pkg/agentgateway/gateway_client.go:84— 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:73— 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.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×22
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:233— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:233-257 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:265-288 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:195— elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:195-218 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:230-253 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:303— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:303-335 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:339-362 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) rust/srql/src/query/mtr_hops.rs:246— rust/srql/src/query/mtr_hops.rs:246-270 | rust/srql/src/query/mtr_traces.rs:159-182 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:302— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:302-331 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:201-224 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:832— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:832-864 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:868-891 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/auth/oidc_client.ex:125— elixir/web-ng/lib/serviceradar_web_ng_web/auth/oidc_client.ex:125-148 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/oidc_client.ex:176-205 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:395— elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:395-424 | elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:446-469 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:291— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:291-316 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_health.ex:156-179 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1312— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1312-1337 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:1341-1364 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1075— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1075-1098 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:625-648 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:896— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:896-927 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/index.ex:371-394 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_host_key_controller.ex:74— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_host_key_controller.ex:74-100 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_host_key_controller.ex:106-129 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:492— elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:492-515 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass_worker.ex:108-131 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1284— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1284-1308 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/gateway_auth.ex:221-244 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) go/pkg/endpointinventory/hashes.go:140— go/pkg/endpointinventory/hashes.go:140-163 | go/pkg/k8sinventory/build_nodes.go:14-52 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:1522— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:1522-1546 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:1034-1057 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) go/pkg/nats/accounts/operator.go:148— go/pkg/nats/accounts/operator.go:148-171 | go/pkg/nats/accounts/operator.go:174-197 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1261— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1261-1285 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:895-918 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) go/pkg/bumblebee/catalog.go:179— go/pkg/bumblebee/catalog.go:179-202 | go/pkg/mapper/proxmox_poller.go:858-887 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:424— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:424-450 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:461-484 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:155— elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:155-178 | elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:220-244 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
ClassTooLong: DashboardWasmHost elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1— ClassTooLong — 1182 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 782 over it, 2.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Publisher rust/flow-collector/src/publisher.rs:63— ClassTooLong — 862 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-1316. The bar is 400 significant lines; this is 462 over it, 2.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: 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: GatewayClient go/pkg/agentgateway/gateway_client.go:84— ClassTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods, 33 blocks, lines 84-1098. The bar is 400 significant lines; this is 158 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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:73— ClassTooLong — 533 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods, 32 blocks, lines 73-880. 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: Tracer go/pkg/mtr/tracer.go:68— ClassTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods, 35 blocks, lines 68-1157. The bar is 400 significant lines; this is 110 over it, 1.28× 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: World rust/topology-atlas/src/tiles.rs:134— ClassTooLong — 477 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 3 blocks, lines 134-868. The bar is 400 significant lines; this is 77 over it, 1.19× 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 — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods, 35 blocks, lines 42-1085. The bar is 400 significant lines; this is 75 over it, 1.19× 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: Converter rust/flow-collector/src/netflow/converter.rs:600— ClassTooLong — 449 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 600-1247. The bar is 400 significant lines; this is 49 over it, 1.12× 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: CameraRelayViewer elixir/web-ng/assets/js/lib/camera_relay/viewer.js:146— ClassTooLong — 435 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 35 over it, 1.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: 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: Index elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:306— ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 306-858. The bar is 400 significant lines; this is 15 over it, 1.04× 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.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×21
Edited copies of one member (3 members, 8+ corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:112— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:112-119 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:191-198 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:448-455 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:579— elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:579-597 | elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:1087-1094 | elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:1111-1118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:317— elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:317-327 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:346-356 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:372-379 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/log_event_consumers.ex:116— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/log_event_consumers.ex:116-124 | elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/metric_consumers.ex:24-31 | elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/metric_consumers.ex:36-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:87— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:87-94 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:98-105 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:127-138 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/keyed_verifier.ex:81— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/keyed_verifier.ex:81-93 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/keyed_verifier.ex:99-111 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/cipher.ex:52-59 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/event_title.ex:210— elixir/serviceradar_core/lib/serviceradar/observability/event_title.ex:210-217 | elixir/web-ng/lib/serviceradar_web_ng_web/anomaly_series_key.ex:141-150 | elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:1920-1930 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/pipeline_readiness.ex:470— elixir/serviceradar_core/lib/serviceradar/edge/pipeline_readiness.ex:470-477 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention.ex:110-120 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_importer.ex:317-324 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:683— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:683-691 | elixir/serviceradar_core/lib/serviceradar/camera/recording_blocks.ex:227-234 | elixir/serviceradar_core/lib/serviceradar/edge/component_certificate_authority.ex:515-522 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1849— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1849-1856 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1919-1927 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:969-977 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) go/cmd/wasm-plugins/axis/metric_telemetry.go:149— go/cmd/wasm-plugins/axis/metric_telemetry.go:149-156 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:176-183 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:132-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/identity/privileged_membership.ex:256— elixir/serviceradar_core/lib/serviceradar/identity/privileged_membership.ex:256-267 | elixir/serviceradar_core/lib/serviceradar/identity/role_profile_policy.ex:123-131 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:120-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) rust/dgraph-topology/src/client.rs:999— rust/dgraph-topology/src/client.rs:999-1006 | rust/dgraph-topology/src/client.rs:1011-1019 | rust/dgraph-topology/src/reads.rs:182-190 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_config/interface_check_ingestor.ex:77— elixir/serviceradar_core/lib/serviceradar/network_config/interface_check_ingestor.ex:77-84 | elixir/serviceradar_core/lib/serviceradar/network_config/plugin_ingestor.ex:66-73 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:1894-1903 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:72— elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:72-82 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_packages.ex:130-137 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_profiles.ex:62-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:460— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:460-467 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1804-1811 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:576-583 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/stream_route.ex:266— elixir/serviceradar_core/lib/serviceradar/edge/stream_route.ex:266-273 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:916-924 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/dashboard_package_live/index.ex:1178-1193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:555— elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:555-563 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:134-141 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_room_artifacts.ex:114-121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:289— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:289-298 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6271-6283 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ocsf_components.ex:436-443 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:314— elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:314-322 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:592-599 | elixir/serviceradar_core/lib/serviceradar/reference_data/service_ports.ex:177-186 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_stream_controller.ex:83— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_stream_controller.ex:83-90 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_stream_controller.ex:60-67 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_stream_controller.ex:163-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 1+ corresponding lines) · ×21
Edited copies of one member (3 members, 1+ corresponding lines) elixir/palisade/lib/palisade/network_address_policy.ex:158— elixir/palisade/lib/palisade/network_address_policy.ex:158-158 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:176-176 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/discovery_scope.ex:98-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/index.ex:882— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/index.ex:882-882 | elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:2223-2227 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_trace.ex:293-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:535— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:535-535 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:1282-1282 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority_ash_source.ex:165-165 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_storage_config.ex:221— elixir/serviceradar_core/lib/serviceradar/camera/archive_storage_config.ex:221-221 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read.ex:67-67 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/upload.ex:260-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:227— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:227-227 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:281-281 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:288-288 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/plugin_device_attribution.ex:539— elixir/serviceradar_core/lib/serviceradar/event_writer/plugin_device_attribution.ex:539-540 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_source_scope_resolver.ex:351-351 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_result_publisher.ex:111-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/local_storage_binding_config.ex:40— elixir/serviceradar_core/lib/serviceradar/camera/local_storage_binding_config.ex:40-40 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_qualification_document.ex:47-47 | elixir/serviceradar_core/lib/serviceradar/camera/recording_storage_identity.ex:82-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/mcp/runner.ex:200— elixir/web-ng/lib/serviceradar_web_ng/mcp/runner.ex:200-200 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:227-227 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:308-308 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:487— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:487-487 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/desktop_media_ingress_session.ex:133-133 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/media_session_manager.ex:699-699 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:134— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:134-134 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_ops.ex:106-106 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery/lease.ex:199-199 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/capability_signing.ex:224— elixir/serviceradar_core/lib/serviceradar/edge/capability_signing.ex:224-224 | elixir/serviceradar_core/lib/serviceradar/edge/claims_framing.ex:206-206 | elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:678-678 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:509— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:509-509 | elixir/serviceradar_core/lib/serviceradar/inventory/availability/transitions.ex:301-302 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_result_publisher.ex:109-109 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:647— elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:647-647 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:581-582 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1526-1527 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex:1267— elixir/serviceradar_core/lib/serviceradar/inventory/sync/device_writes.ex:1267-1267 | elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:391-391 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_warehouse.ex:1155-1155 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_policy.ex:34— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_policy.ex:34-34 | elixir/serviceradar_core/lib/serviceradar/plugins/notification_credential_requirement.ex:616-616 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_auto_approval.ex:209-209 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_delivery_grants.ex:158— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_delivery_grants.ex:158-158 | REDACTED:159-160 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/edge_record.ex:427-428 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/sweep_plan.ex:270— elixir/serviceradar_core/lib/serviceradar/edge/sweep_plan.ex:270-275 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:181-183 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/discovery_scope.ex:101-101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/auth/narrow_scopes.ex:154— elixir/web-ng/lib/serviceradar_web_ng_web/auth/narrow_scopes.ex:154-154 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/cli_auth_controller.ex:470-470 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_controller.ex:350-350 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/decisions.ex:453— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/decisions.ex:453-454 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:658-658 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:335-336 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:1063— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:1063-1064 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live/credential_inventory_components.ex:475-475 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:1505-1505 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:2890— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:2890-2891 | elixir/web-ng/lib/serviceradar_web_ng/mcp/oauth/server.ex:98-99 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oauth_authorize_controller.ex:150-150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×20
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:444— `html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden])` moves (`animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:494— `.share-chapter-cue[data-state="playing"] .share-chapter-state::before` moves (`animation: archify-share-cue-pulse 1.15s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:809— `html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-motion="running"] .diagram-container::before` moves (`animation: archify-signal-scan 4.8s ease-in-out 1 both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:909— `.diagram-container.is-camera-moving svg` moves (`transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2100— `.diagram-guide-action` moves (`transition: border-color 140ms ease, background 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:3162— `.preset-control-mark` moves (`transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:3561— `.archify-toast` moves (`transition: opacity 0.2s, transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:444— `html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden])` moves (`animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:494— `.share-chapter-cue[data-state="playing"] .share-chapter-state::before` moves (`animation: archify-share-cue-pulse 1.15s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:809— `html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-motion="running"] .diagram-container::before` moves (`animation: archify-signal-scan 4.8s ease-in-out 1 both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:909— `.diagram-container.is-camera-moving svg` moves (`transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2100— `.diagram-guide-action` moves (`transition: border-color 140ms ease, background 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:3162— `.preset-control-mark` moves (`transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:3561— `.archify-toast` moves (`transition: opacity 0.2s, transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:444— `html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden])` moves (`animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:494— `.share-chapter-cue[data-state="playing"] .share-chapter-state::before` moves (`animation: archify-share-cue-pulse 1.15s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:809— `html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-motion="running"] .diagram-container::before` moves (`animation: archify-signal-scan 4.8s ease-in-out 1 both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:909— `.diagram-container.is-camera-moving svg` moves (`transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:2100— `.diagram-guide-action` moves (`transition: border-color 140ms ease, background 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard openspec/changes/replace-age-topology-with-dgraph/diagrams/sr-scrith-architecture.html:3162— `.preset-control-mark` moves (`transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×19
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:19— elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:19-31 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:22-33 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:132-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:101— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:101-118 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:69-92 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:216-227 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/changes/guard_credential_rule_lifecycle.ex:78— elixir/serviceradar_core/lib/serviceradar/credentials/changes/guard_credential_rule_lifecycle.ex:78-94 | elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:110-121 | elixir/web-ng/lib/serviceradar_web_ng/ansible_repositories.ex:84-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/distributions.ex:74— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/distributions.ex:74-91 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/interface_series.ex:85-96 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/summary.ex:66-80 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_target_policy.ex:211— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_target_policy.ex:211-228 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:755-766 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:770-782 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) go/pkg/sweeper/sweeper_run.go:29— go/pkg/sweeper/sweeper_run.go:29-44 | go/pkg/sweeper/sweeper_run.go:62-81 | go/pkg/sweeper/sweeper_run.go:84-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync.ex:771— elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync.ex:771-782 | elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:390-401 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5727-5739 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/availability_source_profiles_live.ex:131— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/availability_source_profiles_live.ex:131-142 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/availability_source_profiles_live.ex:146-158 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/field_survey_live/index.ex:106-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:70— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:70-81 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:108-122 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:201-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:189— elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:189-200 | elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:204-215 | elixir/serviceradar_core/lib/serviceradar/identity/alias_events.ex:219-230 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:73— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:73-84 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:88-104 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:108-124 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:2166— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:2166-2177 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:10444-10457 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/service.ex:146-157 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:171— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:171-182 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:237-249 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:253-265 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:100— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:100-111 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:328-342 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1260-1275 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/prefix_tags/changes/assert_manual_snapshot.ex:62— elixir/serviceradar_core/lib/serviceradar/prefix_tags/changes/assert_manual_snapshot.ex:62-74 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/changes/broadcast_manual_invalidation.ex:81-92 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex:169-192 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:670— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:670-681 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:197-210 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:268-279 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/visibility_compiler.ex:263— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/visibility_compiler.ex:263-274 | elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:307-319 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:945-957 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) rust/edge-onboarding/src/config.rs:37— rust/edge-onboarding/src/config.rs:37-48 | rust/rperf-client/src/config.rs:34-45 | rust/trapd/src/config.rs:32-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) go/pkg/edge/execstate/tracker.go:128— go/pkg/edge/execstate/tracker.go:128-139 | go/pkg/edge/execstate/tracker.go:143-156 | go/pkg/edge/execstate/tracker.go:159-171 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×19
Edited copies of one member (3 members, 3+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/availability_components.ex:452— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/availability_components.ex:452-454 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:185-187 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sweep_components.ex:352-358 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:822— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:822-826 | elixir/serviceradar_nvr/lib/serviceradar_nvr/publication.ex:129-133 | elixir/serviceradar_recording/lib/serviceradar_recording/spool.ex:680-682 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:582— elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:582-584 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/keyed_verifier.ex:59-61 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/runtime_config.ex:144-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:1506— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:1506-1508 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_close_reconciler.ex:129-131 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:569-571 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.ex:597— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/jet_stream_publisher.ex:597-601 | elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:319-321 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8076-8081 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1092— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1092-1097 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/events.ex:137-142 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/loader.ex:1960-1962 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/identity/group_policy.ex:149— elixir/serviceradar_core/lib/serviceradar/identity/group_policy.ex:149-151 | elixir/serviceradar_core/lib/serviceradar/identity/privileged_membership.ex:271-273 | elixir/serviceradar_core/lib/serviceradar/identity/role_profile_policy.ex:221-223 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:215— elixir/serviceradar_core/lib/serviceradar/edge/output_grants.ex:215-217 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_delivery.ex:818-820 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/producer_assignments.ex:47-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_broker.ex:390— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_broker.ex:390-392 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_worker.ex:582-584 | elixir/web-ng/lib/serviceradar_web_ng/remote_access_desktop_targets.ex:377-379 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/renderers/discord_embed.ex:92— elixir/serviceradar_core/lib/serviceradar/notifications/renderers/discord_embed.ex:92-94 | elixir/serviceradar_core/lib/serviceradar/notifications/renderers/markdown.ex:49-51 | elixir/serviceradar_core/lib/serviceradar/notifications/renderers/plain.ex:38-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:591— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:591-594 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_health.ex:290-292 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_loader.ex:385-387 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:563— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:563-565 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:547-549 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:447-449 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1403— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1403-1405 | elixir/serviceradar_core/lib/serviceradar/notifications/stream_publisher.ex:500-502 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:239-241 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2758— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2758-2760 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:1003-1005 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1709-1711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:105— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:105-107 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:162-164 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:163-165 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/changes/redact_invocation_input.ex:36— elixir/serviceradar_core/lib/serviceradar/automation/northbound/changes/redact_invocation_input.ex:36-38 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/changes/redact_invocation_result.ex:44-46 | elixir/serviceradar_core/lib/serviceradar/edge/changes/redact_desktop_target_policy.ex:98-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_audit_writer.ex:15— elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_audit_writer.ex:15-17 | elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_request_dispatcher.ex:15-17 | elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_request_executor.ex:15-17 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1442— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1442-1444 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/cluster_live/index.ex:557-559 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/job_live/show.ex:763-765 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sweep_compiler.ex:841— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sweep_compiler.ex:841-843 | elixir/web-ng/lib/serviceradar_web_ng/dashboards.ex:217-220 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_hub_live/index.ex:486-489 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
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:144-154 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_pulse_worker.ex:187-197 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_catalog_sync_worker.ex:122` calls `interval_seconds` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex:141` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery_worker.ex` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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_result_coordinator.ex:1688— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1688-1698 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1757-1767 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1107-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 163 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/data_service/client.ex:664— elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:664-674 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:727-737 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:777-787 — 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/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_settings_runtime.ex:15— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_settings_runtime.ex:15-25 | elixir/serviceradar_core/lib/serviceradar/observability/bmp_settings_runtime.ex:25-35 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_settings_runtime.ex:20-30 — 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/controllers/api/device_controller.ex:266— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:266-276 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:320-330 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_source_fact_controller.ex:42-52 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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 60 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/settings/networks_live/target_builder.ex:102— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:102-112 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1089-1099 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:99-109 — 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 13 separate duplicated blocks between them, totalling at least 143 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:97` calls `trim`, `replace` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:101` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1364— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1364-1374 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/components.ex:117-127 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1443-1453 — before extracting anything, compare `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/plugins/components.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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/agent_live/show.ex:2173— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:2173-2183 | elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:436-446 | elixir/web-ng/lib/serviceradar_web_ng_web/live/node_live/show.ex:495-505 — `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 38 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 × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:297— elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:297-307 | elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/show.ex:158-168 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index.ex:436-446 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) go/cmd/tools/mapper-baseline/main.go:741— go/cmd/tools/mapper-baseline/main.go:741-751 | REDACTED:422-432 | go/pkg/agent/config_section_state.go:193-203 — 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) go/cmd/wasm-plugins/awx/launch_preflight.go:732— go/cmd/wasm-plugins/awx/launch_preflight.go:732-742 | go/cmd/wasm-plugins/awx/main.go:848-858 | go/pkg/agent/addon/manager.go:441-451 — 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) go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:364— go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:364-374 | go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:376-387 | go/pkg/agent/plugin_runtime_host_authority.go:634-644 — 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 (11 lines × 3) rust/netprobe/ebpf/src/lib.rs:1767— rust/netprobe/ebpf/src/lib.rs:1767-1777 | rust/netprobe/ebpf/src/lib.rs:2340-2350 | rust/netprobe/ebpf/src/lib.rs:2501-2511 — 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) rust/srql/src/query/otel_metric_points.rs:71— rust/srql/src/query/otel_metric_points.rs:71-81 | rust/srql/src/query/otel_metrics.rs:64-74 | rust/srql/src/query/traces.rs:71-81 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/otel_metric_points.rs:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) rust/srql/src/query/composite_results.rs:109— rust/srql/src/query/composite_results.rs:109-119 | rust/srql/src/query/sweep_coverage.rs:68-78 | rust/srql/src/query/sweep_results.rs:65-75 — before extracting anything, compare `rust/srql/src/query/composite_results.rs` and `rust/srql/src/query/sweep_coverage.rs` as WHOLE FILES: this scan already matched 6 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. 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) rust/srql/src/query/viz/fieldsurvey.rs:158— rust/srql/src/query/viz/fieldsurvey.rs:158-168 | rust/srql/src/query/viz/inventory.rs:722-732 | rust/srql/src/query/viz/wifi.rs:142-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 all 3 call sites, so a change lands once.
Duplicated block (11 lines × 3) rust/srql/src/query/bmp_events.rs:96— rust/srql/src/query/bmp_events.rs:96-107 | rust/srql/src/query/otel_metrics.rs:115-125 | rust/srql/src/query/trace_summaries.rs:90-101 — before extracting anything, compare `rust/srql/src/query/bmp_events.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/bmp_events.rs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/bmp_events.rs:94` calls `reject_stats` and `rust/srql/src/query/trace_summaries.rs:89` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×18
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:729— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:729-760 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:764-791 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:36— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:36-63 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:36-71 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:155— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:155-182 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/series_data.ex:186-213 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2117— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2117-2146 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2498-2525 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:779— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:779-807 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:811-838 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:152— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:152-179 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:89-119 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/archive_publication.ex:113— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/archive_publication.ex:113-140 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/media_upload.ex:59-98 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) rust/srql/src/query/devices/filters/jsonb.rs:96— rust/srql/src/query/devices/filters/jsonb.rs:96-123 | rust/srql/src/query/devices/stats/clauses.rs:187-216 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) go/pkg/cli/auth.go:736— go/pkg/cli/auth.go:736-766 | go/pkg/cli/nats_account_limits.go:207-234 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:111— elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:111-141 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:145-172 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:82— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/external_boombox_analysis_worker.ex:82-116 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/reference_analysis_worker.ex:82-109 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/cli_device_authorize_live.ex:65— elixir/web-ng/lib/serviceradar_web_ng_web/live/cli_device_authorize_live.ex:65-92 | elixir/web-ng/lib/serviceradar_web_ng_web/live/cli_device_authorize_live.ex:96-123 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) rust/netprobe/src/runtime_config.rs:236— rust/netprobe/src/runtime_config.rs:236-263 | rust/netprobe/src/runtime_config.rs:266-299 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) REDACTED:473— REDACTED:473-500 | REDACTED:405-432 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:510— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:510-537 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:311-338 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) go/pkg/addon/grpc.go:108— go/pkg/addon/grpc.go:108-135 | go/pkg/addon/grpc.go:140-167 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) rust/srql/src/query/endpoint_packages.rs:224— rust/srql/src/query/endpoint_packages.rs:224-258 | rust/srql/src/query/endpoint_packages.rs:260-287 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) tools/anomaly-proof/gen.py:155— tools/anomaly-proof/gen.py:155-183 | tools/anomaly-proof/gen.py:187-214 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:199— elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:199-217 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:243-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:199` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2180— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2180-2198 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:408-426 — 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 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:427` calls `get_in` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2199` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:200— elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:200-218 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:235-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/reassignments.ex:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:145` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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 6 separate duplicated blocks between them, totalling at least 82 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/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6050— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6050-6068 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6084-6102 — both copies are in the same file, so extract the 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 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-48 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:62-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:30` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1250— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1250-1268 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1290-1308 — both copies are in the same file, so extract the 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 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-394 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:402-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:424` calls `take` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:398` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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/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.
Duplicated block (19 lines × 2) go/cmd/wasm-plugins/proxmox/proxmox_decode_tinygo.go:15— go/cmd/wasm-plugins/proxmox/proxmox_decode_tinygo.go:15-33 | go/cmd/wasm-plugins/proxmox/proxmox_http_std.go:14-32 — before extracting anything, compare `go/cmd/wasm-plugins/proxmox/proxmox_decode_tinygo.go` and `go/cmd/wasm-plugins/proxmox/proxmox_http_std.go` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:16— go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:16-34 | go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:112-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) go/pkg/mapper/discovery_schedule.go:99— go/pkg/mapper/discovery_schedule.go:99-117 | go/pkg/mapper/discovery_schedule.go:124-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) go/pkg/mtr/socket_darwin.go:142— go/pkg/mtr/socket_darwin.go:142-160 | go/pkg/mtr/socket_linux.go:167-185 — before extracting anything, compare `go/pkg/mtr/socket_darwin.go` and `go/pkg/mtr/socket_linux.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mtr/socket_darwin.go:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (19 lines × 2) go/pkg/agent/addon_activation.go:571— go/pkg/agent/addon_activation.go:571-589 | go/pkg/agent/addon_systemd.go:812-830 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/addon_activation.go:571` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) rust/srql/src/models/inventory.rs:389— rust/srql/src/models/inventory.rs:389-407 | rust/srql/src/query/gateways.rs:115-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
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/css/app.css:19— elixir/web-ng/assets/css/app.css:19 reaches into another package with a relative path (../node_modules/mapbox-gl/dist/mapbox-gl.css) — import the package by name instead.
Boundary violation [package:relative-cross-package] elixir/web-ng/assets/css/app.css:20— elixir/web-ng/assets/css/app.css:20 reaches into another package with a relative path (../node_modules/gridstack/dist/gridstack.min.css) — 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.
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:2072— 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::executable_ownership::package_db::read_apk (cognitive 30) rust/netprobe/src/executable_ownership/package_db.rs:214— serviceradar_netprobe::executable_ownership::package_db::read_apk has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 3 (6 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.
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::attribution::socket_owners (cognitive 18) rust/netprobe/src/attribution.rs:3094— 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::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::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::executable_ownership::package_db::read_dpkg (cognitive 17) rust/netprobe/src/executable_ownership/package_db.rs:98— serviceradar_netprobe::executable_ownership::package_db::read_dpkg has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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::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.
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.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×17
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:755— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:755-765 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1141-1158 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1123-1133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:35— elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:35-45 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:150-160 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:107-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:812— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:812-822 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:949-961 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:965-977 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_recording_controller.ex:25— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_recording_controller.ex:25-35 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_recording_controller.ex:39-51 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_recording_controller.ex:82-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:226— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:226-236 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:385-395 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:408-423 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/dgraph.ex:441— elixir/serviceradar_core/lib/serviceradar/dgraph.ex:441-453 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:1489-1503 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8101-8111 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:135— elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:135-145 | elixir/serviceradar_core/lib/serviceradar/inventory/package_url.ex:84-95 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass.ex:655-665 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:212— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:212-223 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:351-364 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:368-378 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:692— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:692-702 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:808-818 | elixir/serviceradar_core/lib/serviceradar/srql_device_matcher.ex:32-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2510— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2510-2522 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3244-3254 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3351-3363 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:116— elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:116-126 | elixir/serviceradar_core/native/topology_atlas_nif/src/ordinals.rs:105-115 | elixir/web-ng/native/god_view_nif/src/bitmap_nif.rs:15-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:931— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:931-941 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:945-955 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/show.ex:523-534 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/dashboards/checks/subject_grant.ex:12— elixir/serviceradar_core/lib/serviceradar/dashboards/checks/subject_grant.ex:12-22 | elixir/serviceradar_core/lib/serviceradar/dashboards/checks/subject_grant.ex:39-49 | elixir/serviceradar_core/lib/serviceradar/dashboards/checks/subject_grant.ex:66-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_access_provisioner.ex:19— elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_access_provisioner.ex:19-32 | elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_access_provisioner.ex:37-47 | elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_access_provisioner.ex:53-65 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/retention_worker.ex:57— elixir/serviceradar_core/lib/serviceradar/automation/ansible/retention_worker.ex:57-71 | elixir/serviceradar_core/lib/serviceradar/credentials/broker_retention_worker.ex:92-102 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:36-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:626— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:626-638 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1328-1338 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1594-1604 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) go/pkg/agent/edge_record_trust.go:57— go/pkg/agent/edge_record_trust.go:57-67 | go/pkg/agent/endpoint_inventory_commands.go:206-218 | go/pkg/agent/push_loop_bumblebee_edge.go:77-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×17
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:588— elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:588-591 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_broker.ex:401-404 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:1713-1716 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1321-1324 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/oban/schema_validator.ex:136— elixir/serviceradar_core/lib/serviceradar/oban/schema_validator.ex:136-149 | REDACTED:243-256 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_misses.ex:146-149 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_coverage_rollup_worker.ex:202-215 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:64— elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:64-67 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_bindings.ex:25-28 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_qualifications.ex:23-29 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_recording_configuration.ex:30-36 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/released_seed_shells.ex:47— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/released_seed_shells.ex:47-50 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_retire.ex:76-79 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:67-70 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_succession_merge.ex:42-45 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:942— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:942-945 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:862-868 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:563-566 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1421-1424 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:316— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:316-329 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:279-282 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:190-193 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_worker.ex:230-233 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_artifacts.ex:232— elixir/serviceradar_core/lib/serviceradar/edge/agent_artifacts.ex:232-235 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_components.ex:2333-2336 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/show/view.ex:126-129 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:2142-2149 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_ioc_exposure.ex:434— elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_ioc_exposure.ex:434-440 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:333-336 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery/executor.ex:413-416 | elixir/web-ng/lib/serviceradar_web_ng/notifications/firehose_replay.ex:591-594 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.ex:509— elixir/serviceradar_core/lib/serviceradar/camera/relay_session_manager.ex:509-515 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:949-952 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:570-573 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1428-1431 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/admin_agent_controller.ex:104— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/admin_agent_controller.ex:104-107 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:671-677 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex:718-724 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_site_controller.ex:170-173 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_rule_consumers.ex:103— elixir/serviceradar_core/lib/serviceradar/credentials/credential_rule_consumers.ex:103-106 | elixir/serviceradar_core/lib/serviceradar/inventory/availability/resolution.ex:426-429 | elixir/serviceradar_core/lib/serviceradar/inventory/deduplication_task.ex:234-237 | elixir/serviceradar_core/lib/serviceradar/inventory/identity_decision.ex:206-209 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:146— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:146-149 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/availability_source_profiles_live.ex:524-527 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/data_retention_live.ex:603-606 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:2466-2469 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_approval.ex:99— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_approval.ex:99-102 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_quarantine_release.ex:107-110 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reviewer.ex:167-170 | elixir/serviceradar_core/lib/serviceradar/identity/current_user_authority.ex:103-106 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:607— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:607-610 | elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:232-235 | REDACTED:805-808 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:619-622 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target_resolver.ex:383— elixir/serviceradar_core/lib/serviceradar/edge/remote_console_target_resolver.ex:383-386 | elixir/serviceradar_core/lib/serviceradar/outbound_mail/smtp_tls.ex:70-73 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:838-841 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2519-2522 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2053— elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2053-2056 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:211-214 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/data.ex:91-94 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:948-951 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:198— elixir/serviceradar_core/lib/serviceradar/automation/ansible/live_awx_launch_preflight.ex:198-201 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/launch_contract.ex:90-93 | elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_eligibility.ex:116-119 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery.ex:85-88 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×16
Edited copies of one member (3 members, 13+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:731— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:731-745 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:753-768 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:776-788 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:763— elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:763-775 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:810-822 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:393-410 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_core/native/topology_atlas_nif/src/model.rs:217— elixir/serviceradar_core/native/topology_atlas_nif/src/model.rs:217-229 | elixir/serviceradar_core/native/topology_atlas_nif/src/model.rs:231-243 | elixir/serviceradar_core/native/topology_atlas_nif/src/model.rs:245-259 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:162— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:162-182 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:334-347 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:450-462 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) rust/srql/src/query/bmp_events.rs:122— rust/srql/src/query/bmp_events.rs:122-135 | rust/srql/src/query/mtr_hops.rs:232-244 | rust/srql/src/query/mtr_traces.rs:145-157 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:355— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:355-368 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:376-389 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:528-540 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:409— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:409-422 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:426-439 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:543-555 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:2287— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:2287-2299 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:2305-2317 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:2323-2335 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) rust/anomaly-addon/src/shed.rs:227— rust/anomaly-addon/src/shed.rs:227-239 | rust/anomaly-addon/src/shed.rs:241-253 | rust/anomaly-addon/src/verdict.rs:662-674 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2642— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2642-2654 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2690-2702 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2906-2921 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) rust/srql/src/query/events/rollup.rs:60— rust/srql/src/query/events/rollup.rs:60-72 | rust/srql/src/query/logs/rollup.rs:13-25 | rust/srql/src/query/traces.rs:228-241 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) go/pkg/datasvc/nats.go:271— go/pkg/datasvc/nats.go:271-283 | go/pkg/datasvc/nats.go:286-301 | go/pkg/datasvc/nats.go:343-355 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) go/pkg/agent/addon_systemd.go:863— go/pkg/agent/addon_systemd.go:863-875 | go/pkg/cli/nats_bootstrap.go:865-882 | go/pkg/edge/edgerecord/principal.go:34-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_certificate_revocation.ex:231— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_certificate_revocation.ex:231-243 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/event_ingestor.ex:695-709 | elixir/serviceradar_core/lib/serviceradar/plugins/credential_broker_delivery.ex:444-456 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:1403— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:1403-1415 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:430-442 | elixir/web-ng/lib/serviceradar_web_ng_web/live/security_live/index.ex:836-848 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:403— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_inventory_sync_reconciler.ex:403-418 | elixir/serviceradar_core/lib/serviceradar/inventory/integration_identity.ex:532-544 | elixir/serviceradar_core/lib/serviceradar/plugins/credential_broker_delivery.ex:414-426 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×16
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/ingress_id.ex:74— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/ingress_id.ex:74-79 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/otlp_relay.ex:433-437 | elixir/serviceradar_core/lib/serviceradar/ingestion/result_ingestor.ex:264-270 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:20— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:20-25 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:29-33 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_secret_controller.ex:21-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/bulk.ex:211— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/bulk.ex:211-217 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:2374-2378 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_forms.ex:138-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/policy_assignment_reconciler.ex:166— elixir/serviceradar_core/lib/serviceradar/plugins/policy_assignment_reconciler.ex:166-176 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery/executor.ex:303-313 | elixir/serviceradar_core/lib/serviceradar/plugins/repository_credentials.ex:136-140 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:227— elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:227-231 | elixir/serviceradar_core/lib/serviceradar/composite_checks/evaluation.ex:235-239 | elixir/serviceradar_core/lib/serviceradar/composite_checks/validation/orchestrator.ex:275-279 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/acquisition.ex:460— elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/acquisition.ex:460-464 | elixir/serviceradar_core/lib/serviceradar/repo/schema_bootstrap.ex:290-300 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:215-224 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:248— elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:248-257 | elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:418-422 | elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:349-353 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:586— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:586-590 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:3041-3045 | elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:445-449 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:2983— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:2983-2988 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/mtr_components.ex:857-861 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/view/helpers.ex:78-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2152— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2152-2156 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8257-8264 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1523-1527 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:46— elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:46-51 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2224-2230 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:1172-1176 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:1135— elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:1135-1139 | elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2319-2323 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:475-479 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:400— elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:400-404 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:429-438 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_status_ingestor.ex:207-211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reviewer.ex:238— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reviewer.ex:238-242 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:289-293 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/password_reset_delivery.ex:92-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3580— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3580-3584 | elixir/serviceradar_core/lib/serviceradar/flow_attribution/pass_metrics.ex:236-240 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/mtr_components.ex:696-700 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) rust/srql/src/query/capacity_forecasts.rs:365— rust/srql/src/query/capacity_forecasts.rs:365-369 | rust/srql/src/query/field_survey.rs:728-732 | rust/srql/src/query/wifi_map.rs:784-788 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (20 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-1854 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1071-1090 — 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 163 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 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-94 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:63-82 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.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 (20 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:306— elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:306-325 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/slack.ex:436-455 — 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 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/transports/discord.ex:306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:246— elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:246-265 | elixir/web-ng/lib/serviceradar_web_ng/packages/repo_client.ex:324-343 — both copies are in the same file, so extract the 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/topology/god_view_stream.ex:1263— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1263-1282 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1288-1307 — both copies are in the same file, so extract the 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:258— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/data.ex:258-277 | 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 (20 lines × 2) go/pkg/agent/plugin_runtime_network.go:58— go/pkg/agent/plugin_runtime_network.go:58-77 | go/pkg/agent/plugin_runtime_network.go:179-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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/plugin_runtime_network.go:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) REDACTED:437— REDACTED:437-456 | REDACTED:369-388 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) go/pkg/k8sinventory/publisher.go:143— go/pkg/k8sinventory/publisher.go:143-162 | go/pkg/trivysidecar/publisher.go:44-63 — `go/pkg/k8sinventory/publisher.go` and `go/pkg/trivysidecar/publisher.go` 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 8 separate duplicated blocks between them, totalling at least 105 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 (20 lines × 2) rust/anomaly-addon/src/shed.rs:88— rust/anomaly-addon/src/shed.rs:88-107 | rust/anomaly-addon/src/shed.rs:181-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/anomaly-addon/src/shed.rs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) rust/rperf-client/src/server.rs:532— rust/rperf-client/src/server.rs:532-551 | rust/rperf-client/src/server.rs:651-670 — both copies are in the same file, so extract the 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) rust/srql/src/query/mtr_hops.rs:1038— rust/srql/src/query/mtr_hops.rs:1038-1057 | rust/srql/src/query/mtr_traces.rs:1120-1139 — before extracting anything, compare `rust/srql/src/query/mtr_hops.rs` and `rust/srql/src/query/mtr_traces.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 238 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/mtr_hops.rs:1038` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `aggs` to `&[HopAgg]` in one and `&[TraceAgg]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) rust/srql/src/query/trace_summaries.rs:638— rust/srql/src/query/trace_summaries.rs:638-657 | rust/srql/src/query/trace_summaries.rs:735-754 — both copies are in the same file, so extract the 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) rust/srql/src/query/viz/metrics.rs:83— rust/srql/src/query/viz/metrics.rs:83-102 | rust/srql/src/query/viz/metrics.rs:151-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/viz/metrics.rs:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) rust/srql/src/query/plan.rs:251— rust/srql/src/query/plan.rs:251-270 | rust/srql/src/query/plan.rs:273-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:577— elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:577-594 | elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:605-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/mix/tasks/serviceradar.dire_remediation.ex:577` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 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-103 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:213-230 — 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/observability/netflow_exporter_cache_refresh_worker.ex:140— elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:140-157 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:213-230 — 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 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 (18 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-262 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:175-192 — 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:363— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:363-380 | 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 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 (18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:264— elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:264-281 | elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:668-685 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 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-29 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/view.ex:11-41 — 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) go/pkg/agent/control_stream.go:2015— go/pkg/agent/control_stream.go:2015-2032 | go/pkg/agent/mtr_bulk.go:556-573 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/control_stream.go:2015` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) go/pkg/agent/plugin_runtime_manager.go:1012— go/pkg/agent/plugin_runtime_manager.go:1012-1029 | go/pkg/agent/proxmox_console_plugin.go:131-148 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) REDACTED:99— REDACTED:99-116 | REDACTED:36-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) go/pkg/mapper/ubnt_topology.go:150— go/pkg/mapper/ubnt_topology.go:150-167 | go/pkg/mapper/ubnt_topology.go:227-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mapper/ubnt_topology.go:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) go/pkg/scan/icmp_scanner_unix.go:412— go/pkg/scan/icmp_scanner_unix.go:412-429 | go/pkg/scan/icmp_scanner_windows.go:290-307 — before extracting anything, compare `go/pkg/scan/icmp_scanner_unix.go` and `go/pkg/scan/icmp_scanner_windows.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/scan/icmp_scanner_unix.go:412` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) REDACTED:233— REDACTED:233-250 | REDACTED: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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:233` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) rust/srql/src/query/otel_metric_points.rs:655— rust/srql/src/query/otel_metric_points.rs:655-672 | rust/srql/src/query/otel_metrics.rs:595-612 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/otel_metric_points.rs:655` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) rust/netprobe/ebpf/src/lib.rs:1164— rust/netprobe/ebpf/src/lib.rs:1164-1181 | rust/netprobe/ebpf/src/lib.rs:1275-1292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/netprobe/ebpf/src/lib.rs:1164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/netprobe/ebpf/src/lib.rs:1182` calls `record_socket_pid_by_address` and `rust/netprobe/ebpf/src/lib.rs:1293` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) rust/srql/src/query/sweep_coverage.rs:163— rust/srql/src/query/sweep_coverage.rs:163-180 | rust/srql/src/query/sweep_executions.rs:123-140 — before extracting anything, compare `rust/srql/src/query/sweep_coverage.rs` and `rust/srql/src/query/sweep_executions.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/sweep_coverage.rs:163` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×15
Edited copy of a member (29 corresponding lines) go/pkg/agent/cert_renewal.go:498— go/pkg/agent/cert_renewal.go:498-528 | go/pkg/grpc/security.go:525-558 — 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.
Edited copy of a member (29 corresponding lines) rust/srql/src/query/otel_metrics.rs:298— rust/srql/src/query/otel_metrics.rs:298-326 | rust/srql/src/query/traces.rs:672-708 — 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.
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:609— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:609-637 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:643-698 — 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.
Edited copy of a member (29 corresponding lines) REDACTED:1069— REDACTED:1069-1097 | REDACTED:1103-1131 — 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.
Edited copy of a member (29 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:17— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:17-48 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:52-80 — 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.
Edited copy of a member (29 corresponding lines) go/pkg/grpc/certs.go:102— go/pkg/grpc/certs.go:102-132 | go/pkg/grpc/certs.go:135-163 — 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.
Edited copy of a member (29 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:681— elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:681-709 | elixir/web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex:713-745 — 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.
Edited copy of a member (29 corresponding lines) go/pkg/endpointinventory/packages.go:170— go/pkg/endpointinventory/packages.go:170-205 | go/pkg/endpointinventory/packages.go:207-235 — 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.
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:57— elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:57-85 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:40-68 — 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.
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/plugin_inputs.ex:172— elixir/serviceradar_core/lib/serviceradar/plugins/plugin_inputs.ex:172-206 | elixir/serviceradar_core/lib/serviceradar/plugins/target_batch_params.ex:149-177 — 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.
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:232— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:232-264 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:236-264 — 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.
Edited copy of a member (29 corresponding lines) rust/srql/src/query/sweep_coverage.rs:152— rust/srql/src/query/sweep_coverage.rs:152-180 | rust/srql/src/query/sweep_executions.rs:112-140 — 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.
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1322— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1322-1350 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:649-677 — 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.
Edited copy of a member (29 corresponding lines) go/pkg/agent/plugin_runtime_manager.go:1580— go/pkg/agent/plugin_runtime_manager.go:1580-1608 | go/pkg/agent/plugin_runtime_notify.go:489-520 — 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.
Edited copy of a member (29 corresponding lines) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:304— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:304-335 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:339-367 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×15
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:851— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:851-860 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:872-880 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:152-161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) rust/srql/src/query/dashboard_service_views.rs:84— rust/srql/src/query/dashboard_service_views.rs:84-92 | rust/srql/src/query/dashboards.rs:82-90 | rust/srql/src/query/devices/stats/bind.rs:20-28 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/ash_store.ex:126— elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/ash_store.ex:126-134 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/ash_store.ex:138-146 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/ash_store.ex:150-162 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2672— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2672-2686 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2771-2779 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_delivery_worker.ex:56-64 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) go/cmd/wasm-plugins/axis/metric_telemetry.go:139— go/cmd/wasm-plugins/axis/metric_telemetry.go:139-147 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:142-153 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:122-130 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:29— elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/changes/stamp_audit_context.ex:29-37 | elixir/serviceradar_core/lib/serviceradar/security/changes/stamp_audit_actor.ex:58-66 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/changes/stamp_audit_context.ex:29-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:269— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:269-277 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:281-289 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:242-250 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:80— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:80-89 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:54-62 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:59-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:204— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:204-212 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:216-225 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:229-238 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_update_policy_backfill_worker.ex:143— elixir/serviceradar_core/lib/serviceradar/plugins/addon_update_policy_backfill_worker.ex:143-151 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_sync_worker.ex:505-513 | elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync_worker.ex:407-415 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:364— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:364-372 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:447-456 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/index.ex:2075-2083 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) swift/FieldSurvey/FieldSurvey/Network/SidekickObservationArrowDecoder.swift:68— swift/FieldSurvey/FieldSurvey/Network/SidekickObservationArrowDecoder.swift:68-76 | swift/FieldSurvey/FieldSurvey/Network/SidekickObservationArrowDecoder.swift:82-90 | swift/FieldSurvey/FieldSurvey/Network/SidekickObservationArrowDecoder.swift:116-124 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) rust/srql/src/query/device_sweep_overlap.rs:254— rust/srql/src/query/device_sweep_overlap.rs:254-262 | rust/srql/src/query/field_survey.rs:740-748 | rust/srql/src/query/identity/mod.rs:132-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) rust/srql/src/query/otel_metric_points.rs:294— rust/srql/src/query/otel_metric_points.rs:294-304 | rust/srql/src/query/trace_summaries.rs:503-513 | rust/srql/src/query/traces.rs:662-670 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/srql_device_matcher.ex:324— elixir/serviceradar_core/lib/serviceradar/srql_device_matcher.ex:324-332 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:1446-1454 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/service.ex:103-111 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
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/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/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:145— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:145-154 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:216-225 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:234-243 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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:34-43 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_file_transfer_controller.ex:67-76 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:27` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 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:838-847 — 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/plugins/show_live.ex:359— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:359-368 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:380-389 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:531-540 — 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/bgp_live/index.ex:363— elixir/web-ng/lib/serviceradar_web_ng_web/live/bgp_live/index.ex:363-372 | elixir/web-ng/lib/serviceradar_web_ng_web/live/bmp_live/index.ex:422-431 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:3932-3941 — 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/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:211— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:211-220 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:265-274 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:272-281 — 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 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1342— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1342-1351 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/components.ex:177-186 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1838-1847 — before extracting anything, compare `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/plugins/components.ex` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:137— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:137-146 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_forwarder.ex:109-118 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/remote_capture_forwarder.ex:98-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:109— go/cmd/wasm-plugins/axis/metric_telemetry.go:109-118 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:112-121 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:92-101 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 3) go/pkg/agent/plugin_runtime_manager.go:298— go/pkg/agent/plugin_runtime_manager.go:298-307 | go/pkg/agent/plugin_runtime_manager.go:342-351 | go/pkg/agent/plugin_runtime_manager.go:910-919 — 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) go/cmd/wasm-plugins/opentext-nom/transport.go:53— go/cmd/wasm-plugins/opentext-nom/transport.go:53-62 | go/pkg/agent/desktop_rdp_helper_adapter.go:505-515 | REDACTED:160-170 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:72— go/cmd/wasm-plugins/axis/metric_telemetry.go:72-81 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:52-61 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:55-64 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/axis/metric_telemetry.go:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) integration_tests/srql_parity/src/fixture/bmp.rs:111— integration_tests/srql_parity/src/fixture/bmp.rs:111-120 | integration_tests/srql_parity/src/fixture/logs.rs:134-143 | integration_tests/srql_parity/src/fixture/mtr.rs:156-165 — before extracting anything, compare `integration_tests/srql_parity/src/fixture/logs.rs` and `integration_tests/srql_parity/src/fixture/mtr.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `integration_tests/srql_parity/src/fixture/bmp.rs:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `rows` to `&[BmpRow]` in one and `&[LogRow]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×14
Edited copy of a member (33 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4570— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4570-4606 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4641-4673 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) go/pkg/mapper/mikrotik_poller.go:95— go/pkg/mapper/mikrotik_poller.go:95-131 | go/pkg/mapper/proxmox_poller.go:117-149 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) rust/srql/src/query/devices/filters/ip.rs:89— rust/srql/src/query/devices/filters/ip.rs:89-125 | rust/srql/src/query/devices/filters/ip.rs:127-159 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:948— swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:948-980 | swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:982-1014 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) rust/srql/src/query/sweep_profiles.rs:264— rust/srql/src/query/sweep_profiles.rs:264-296 | rust/srql/src/query/sweep_profiles.rs:302-334 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_installation.ex:116— elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_installation.ex:116-148 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_bootstrap_preparation.ex:122-154 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex:63— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex:63-95 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex:118-160 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) go/pkg/agent/push_loop_metrics_edge.go:500— go/pkg/agent/push_loop_metrics_edge.go:500-532 | go/pkg/agent/push_loop_mtr_traces_edge.go:200-232 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) rust/srql/src/query/gateways.rs:192— rust/srql/src/query/gateways.rs:192-232 | rust/srql/src/query/source_fact_disagreements.rs:94-126 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_nodes.ex:120— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_nodes.ex:120-158 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_public_endpoints.ex:131-163 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:874— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:874-906 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1631-1666 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) go/pkg/sweeper/sweeper_aggregators.go:26— go/pkg/sweeper/sweeper_aggregators.go:26-58 | go/pkg/sweeper/sweeper_results.go:78-113 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) go/cmd/wasm-plugins/alienvault-otx/main.go:1077— go/cmd/wasm-plugins/alienvault-otx/main.go:1077-1111 | go/cmd/wasm-plugins/alienvault-otx/main.go:1113-1145 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) go/pkg/mtr/socket_darwin.go:33— go/pkg/mtr/socket_darwin.go:33-66 | go/pkg/mtr/socket_linux.go:33-65 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×14
Edited copies of one member (3 members, 18+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:379— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:379-400 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1988-2005 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:2009-2026 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:477— go/pkg/agent/plugin_runtime_awx_inventory_credentials.go:477-494 | go/pkg/agent/plugin_runtime_host_authority.go:646-666 | go/pkg/agent/plugin_runtime_host_authority.go:668-686 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/datasvc/lib/datasvc/kv.ex:32— elixir/datasvc/lib/datasvc/kv.ex:32-49 | elixir/datasvc/lib/datasvc/kv.ex:60-80 | elixir/datasvc/lib/datasvc/kv.ex:90-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) go/pkg/agent/sweep_config_gateway.go:370— go/pkg/agent/sweep_config_gateway.go:370-387 | go/pkg/agent/sweep_config_gateway.go:389-406 | go/pkg/scan/banner_grab/engine.go:117-134 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/palisade/lib/palisade/outbound_fetch.ex:104— elixir/palisade/lib/palisade/outbound_fetch.ex:104-121 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:72-89 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/outbound_fetch.ex:72-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/custom_templates.ex:133— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/custom_templates.ex:133-150 | elixir/web-ng/lib/serviceradar_web_ng_web/live/user_live/api_credentials.ex:590-612 | elixir/web-ng/lib/serviceradar_web_ng_web/live/user_live/api_credentials.ex:616-637 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) go/pkg/agent/mapper_service.go:398— go/pkg/agent/mapper_service.go:398-415 | go/pkg/agent/mapper_service.go:417-434 | go/pkg/agent/mapper_service.go:436-453 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/bmp_live/index.ex:15— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/bmp_live/index.ex:15-32 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_hostname_rdns_live.ex:18-37 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mail_live.ex:18-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:109— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:109-126 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:144-161 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/index.ex:165-182 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) REDACTED:2459— REDACTED:2459-2476 | REDACTED:2478-2495 | REDACTED:2497-2514 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/field_survey_live/index.ex:16— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/field_survey_live/index.ex:16-33 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:19-36 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_recordings_live.ex:27-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2552— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2552-2569 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2590-2608 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1545-1562 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:43— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:43-60 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:45-66 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:271-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) go/pkg/agent/remoteaccess/desktop_adapter.go:255— go/pkg/agent/remoteaccess/desktop_adapter.go:255-273 | go/pkg/agent/remoteaccess/desktop_adapter.go:275-292 | go/pkg/agent/remoteaccess/desktop_adapter.go:294-312 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×14
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:400— elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:400-406 | elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:410-418 | elixir/serviceradar_core/lib/serviceradar/event_writer/falco_decomposition.ex:422-429 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/identity/group_policy.ex:131— elixir/serviceradar_core/lib/serviceradar/identity/group_policy.ex:131-137 | elixir/serviceradar_core/lib/serviceradar/plugins/retired_producer_schedule_cleaner.ex:48-60 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/identity.ex:144-155 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) config/manager_config/elixir/lib/serviceradar_config/manager.ex:135— config/manager_config/elixir/lib/serviceradar_config/manager.ex:135-141 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_package_set.ex:782-793 | elixir/serviceradar_core/lib/serviceradar/postgres/schema_sql.ex:246-254 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_package_set.ex:458— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_package_set.ex:458-464 | elixir/serviceradar_core/lib/serviceradar/time_zone.ex:98-106 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/forms.ex:196-202 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1596— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1596-1604 | elixir/serviceradar_core/lib/serviceradar/inventory/changes/sync_snmp_interface_config.ex:107-113 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:680-686 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowEncoder.swift:316— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowEncoder.swift:316-322 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowEncoder.swift:324-330 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowEncoder.swift:448-454 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/recording_control.ex:160— elixir/serviceradar_core/lib/serviceradar/camera/recording_control.ex:160-168 | elixir/web-ng/lib/serviceradar_web_ng/ansible_automation.ex:243-249 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_recording_controller.ex:104-110 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/admin_agent_controller.ex:94— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/admin_agent_controller.ex:94-100 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_repository_controller.ex:263-269 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_site_controller.ex:160-166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:446— elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:446-452 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/interfaces.ex:120-129 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/normalize.ex:341-350 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) go/pkg/agent/kv.go:45— go/pkg/agent/kv.go:45-52 | go/pkg/config/kvgrpc/client.go:35-41 | go/pkg/datasvc/nats.go:237-244 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) rust/addon-sdk/src/bin/rust_sample_addon.rs:36— rust/addon-sdk/src/bin/rust_sample_addon.rs:36-42 | rust/anomaly-addon/src/addon.rs:140-149 | rust/otel-addon/src/addon.rs:357-366 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1274— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1274-1280 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/log_components.ex:177-183 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:952-958 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/device_cleanup_worker.ex:74— elixir/serviceradar_core/lib/serviceradar/inventory/device_cleanup_worker.ex:74-80 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:60-69 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_worker.ex:25-31 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/plugs/confine_narrow_scope.ex:57— elixir/web-ng/lib/serviceradar_web_ng_web/plugs/confine_narrow_scope.ex:57-67 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/mcp_require_permission.ex:36-45 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/require_oauth_scope.ex:50-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (12 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-151 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/mutation_lifecycle_ash_actions.ex:89-100 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_lifecycle_ash_actions.ex:177-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/execution_lifecycle_ash_actions.ex:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140— elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140-151 | elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex:142-153 | elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:182-193 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 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 9 separate duplicated blocks between them, totalling at least 110 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:548— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:548-559 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:532-543 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:432-443 — `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 125 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:548` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 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/plugins/show_live.ex:627— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:627-638 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:650-661 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:669-680 — 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/device_enrichment_rules_live.ex:420— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:420-431 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:462-473 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:1470-1481 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:420` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:434` calls `put_flash` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:1482` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 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-298 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:306-317 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:325-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 (12 lines × 3) go/pkg/mapper/mikrotik_poller.go:58— go/pkg/mapper/mikrotik_poller.go:58-69 | go/pkg/mapper/proxmox_poller.go:80-91 | go/pkg/mapper/ubnt_poller.go:31-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 3) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:727— swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:727-738 | swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:743-754 | swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:759-770 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:727` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 3) rust/srql/src/query/logs/stats_expr.rs:122— rust/srql/src/query/logs/stats_expr.rs:122-133 | REDACTED:2630-2641 | rust/srql/src/query/trace_summaries.rs:697-708 — before extracting anything, compare `rust/srql/src/query/logs/stats_expr.rs` and `rust/srql/src/query/trace_summaries.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 3) rust/srql/src/query/dashboards.rs:283— rust/srql/src/query/dashboards.rs:283-295 | REDACTED:563-574 | REDACTED:733-744 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/dashboards.rs:283` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 3) rust/srql/src/query/field_survey.rs:607— rust/srql/src/query/field_survey.rs:607-618 | rust/srql/src/query/wifi_map.rs:607-618 | rust/srql/src/query/wifi_map.rs:709-720 — before extracting anything, compare `rust/srql/src/query/field_survey.rs` and `rust/srql/src/query/wifi_map.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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) rust/srql/src/query/sweep_coverage.rs:315— rust/srql/src/query/sweep_coverage.rs:315-326 | rust/srql/src/query/sweep_executions.rs:268-279 | rust/srql/src/query/sweep_results.rs:357-368 — before extracting anything, compare `rust/srql/src/query/sweep_coverage.rs` and `rust/srql/src/query/sweep_executions.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/sweep_coverage.rs:315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TooManyFields: PushLoop go/pkg/agent/push_loop.go:86— TooManyFields — 104 stored fields beside 345 methods. The bar is 30 stored fields; this is 74 over it, 3.47× 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: CmdConfig go/pkg/cli/types.go:11— TooManyFields — 96 stored fields. The bar is 30 stored fields; this is 66 over it, 3.20× 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:141— TooManyFields — 51 stored fields beside 1 method. The bar is 30 stored fields; this is 21 over it, 1.70× 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: PluginManager go/pkg/agent/plugin_runtime.go:119— TooManyFields — 46 stored fields beside 87 methods. The bar is 30 stored fields; this is 16 over it, 1.53× 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: SYNScanner go/pkg/scan/syn_scanner_types.go:52— TooManyFields — 42 stored fields beside 57 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: 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:68— 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: NetworkSweeper go/pkg/sweeper/sweeper.go:31— TooManyFields — 32 stored fields beside 67 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: 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:29— 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.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×13
Edited copy of a member (27 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1027— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1027-1053 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1206-1237 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:12— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:12-40 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:44-70 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) 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-142 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_list.ex:146-172 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/serviceradar_core/native/topology_atlas_nif/src/details.rs:224— elixir/serviceradar_core/native/topology_atlas_nif/src/details.rs:224-253 | elixir/serviceradar_core/native/topology_atlas_nif/src/details.rs:330-356 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/onboarding_packages.ex:257— elixir/serviceradar_core/lib/serviceradar/edge/onboarding_packages.ex:257-283 | elixir/serviceradar_core/lib/serviceradar/edge/onboarding_packages.ex:291-318 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:106— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:106-133 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:176-202 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/plugs/lockout_check.ex:58— elixir/web-ng/lib/serviceradar_web_ng_web/plugs/lockout_check.ex:58-87 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/rate_limit.ex:59-85 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:158— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:158-184 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:188-219 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) rust/netprobe/src/mdns.rs:1534— rust/netprobe/src/mdns.rs:1534-1564 | rust/netprobe/src/mdns.rs:1566-1592 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_dups.ex:310— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_dups.ex:310-346 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_dups.ex:201-227 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:46— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:46-72 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/groups.ex:76-102 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) go/pkg/agent/plugin_runtime_network.go:136— go/pkg/agent/plugin_runtime_network.go:136-162 | go/pkg/agent/plugin_runtime_network.go:543-572 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) go/pkg/agent/plugin_runtime_artifact.go:127— go/pkg/agent/plugin_runtime_artifact.go:127-157 | go/pkg/agent/plugin_runtime_execution.go:321-347 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×13
Edited copies of one member (3 members, 10+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:653— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:653-662 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:720-729 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:285-297 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:589— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:589-598 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:152-166 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:310-324 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:129— elixir/serviceradar_core/lib/serviceradar/observability/anomaly_addon_config_projector.ex:129-139 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_baseline_freshness_worker.ex:116-125 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:630-639 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:376— elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:376-385 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:5617-5626 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_warehouse.ex:1141-1150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:94— elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:94-105 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:109-118 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/diagnostics.ex:122-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) rust/srql/src/query/starrocks/otel_metrics.rs:336— rust/srql/src/query/starrocks/otel_metrics.rs:336-345 | rust/srql/src/query/starrocks/otel_metrics.rs:362-380 | rust/srql/src/query/starrocks/otel_metrics.rs:383-398 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_authority_contraction.ex:151— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_authority_contraction.ex:151-160 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_lifecycle_ash_actions.ex:120-129 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_lifecycle_ash_actions.ex:133-144 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) rust/anomaly-addon/src/main.rs:13— rust/anomaly-addon/src/main.rs:13-26 | rust/otel-addon/src/main.rs:41-56 | rust/powerdns/src/bin/serviceradar-powerdns-addon.rs:20-29 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:365— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:365-374 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:407-416 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:459-468 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:598— elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:598-607 | elixir/serviceradar_core/lib/serviceradar/edge/release_manifest_validator.ex:551-560 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:643-654 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/analysis_contract.ex:97— elixir/serviceradar_core/lib/serviceradar/camera/analysis_contract.ex:97-106 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:182-192 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:117-126 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) go/pkg/agent/control_stream.go:541— go/pkg/agent/control_stream.go:541-553 | go/pkg/agent/sweep_lease.go:869-878 | go/pkg/agent/sweep_lease_refusal.go:230-243 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:507— elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:507-519 | elixir/serviceradar_core/lib/serviceradar/camera/relay_session_lifecycle.ex:165-177 | elixir/serviceradar_core/lib/serviceradar/camera/relay_source_resolver.ex:103-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 2+ corresponding lines) · ×13
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:402— elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:402-403 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/unleased_sweep_results.ex:319-320 | elixir/serviceradar_core/lib/serviceradar/edge/sweep_projection.ex:290-291 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1152— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1152-1153 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1139-1140 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:544-545 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/local_storage_binding_config.ex:51— elixir/serviceradar_core/lib/serviceradar/camera/local_storage_binding_config.ex:51-52 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_evidence.ex:140-141 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_qualification_document.ex:50-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/recovery_assignments.ex:380— elixir/serviceradar_core/lib/serviceradar/edge/recovery_assignments.ex:380-381 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_effects.ex:309-310 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_operations.ex:386-390 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_recording_metadata/lib/serviceradar_recording_metadata/descriptor.ex:192— elixir/serviceradar_recording_metadata/lib/serviceradar_recording_metadata/descriptor.ex:192-193 | elixir/serviceradar_recording_metadata/lib/serviceradar_recording_metadata/manifest.ex:121-122 | elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:132-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:150— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:150-151 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_forwarder.ex:122-123 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/remote_capture_forwarder.ex:112-113 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:579— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:579-581 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_health.ex:285-286 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_loader.ex:426-427 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/lane_supervisor.ex:74— elixir/serviceradar_core/lib/serviceradar/edge/lane_supervisor.ex:74-75 | elixir/serviceradar_core/lib/serviceradar/edge/lane_transport_runtime.ex:62-63 | elixir/serviceradar_core/lib/serviceradar/edge/publisher_pool.ex:110-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:459— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:459-460 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_succession.ex:766-767 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/awx_proxmox_unmerge.ex:386-392 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/source_inventory_reader.ex:330— elixir/serviceradar_core/lib/serviceradar/inventory/source_inventory_reader.ex:330-331 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/binding_review.ex:688-692 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:31-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:836— elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:836-837 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/decisions.ex:1541-1542 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:1788-1796 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_sources_components.ex:191— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/discovery_sources_components.ex:191-192 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:807-808 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mtr_jobs.ex:102-103 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1326— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_fleet_live/index.ex:1326-1327 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/components.ex:192-193 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/agents_live/releases.ex:1822-1823 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (23 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_version_retention_worker.ex:52— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_version_retention_worker.ex:52-74 | elixir/serviceradar_core/lib/serviceradar/security/audit_version_retention_worker.ex:107-129 — 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 (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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:510` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:237— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:237-259 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:259-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 151 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:962— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:962-984 | 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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:405-427 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/oidc_controller.ex:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) go/cmd/wasm-plugins/axis/config_envelope.go:20— go/cmd/wasm-plugins/axis/config_envelope.go:20-42 | go/cmd/wasm-plugins/unifi-protect/config_envelope.go:19-41 — `go/cmd/wasm-plugins/axis/config_envelope.go` and `go/cmd/wasm-plugins/unifi-protect/config_envelope.go` 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 7 separate duplicated blocks between them, totalling at least 93 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) go/cmd/wasm-plugins/axis/rtsp_stream.go:101— go/cmd/wasm-plugins/axis/rtsp_stream.go:101-123 | go/cmd/wasm-plugins/unifi-protect/rtsp_stream.go:80-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/axis/rtsp_stream.go:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) go/cmd/wasm-plugins/axis/stream_bridge.go:58— go/cmd/wasm-plugins/axis/stream_bridge.go:58-80 | go/cmd/wasm-plugins/unifi-protect/stream_bridge.go:49-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) REDACTED:46— REDACTED:46-68 | go/pkg/agent/proxmox_console_ssh.go:81-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) go/pkg/datasvc/nats_account_service.go:610— go/pkg/datasvc/nats_account_service.go:610-632 | go/pkg/datasvc/nats_account_service.go:725-747 — both copies are in the same file, so extract the 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 (23 lines × 2) go/pkg/scan/icmp_scanner_unix.go:646— go/pkg/scan/icmp_scanner_unix.go:646-668 | go/pkg/scan/icmp_scanner_windows.go:424-446 — before extracting anything, compare `go/pkg/scan/icmp_scanner_unix.go` and `go/pkg/scan/icmp_scanner_windows.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/scan/icmp_scanner_unix.go:646` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23 lines × 2) go/pkg/agent/bumblebee_spool_service.go:309— go/pkg/agent/bumblebee_spool_service.go:309-331 | go/pkg/agent/endpoint_inventory_spool_service.go:134-157 — 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 (23 lines × 2) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:610— swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:610-632 | swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:713-735 — both copies are in the same file, so extract the 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/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1471— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1471-1491 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1858-1878 — both copies are in the same file, so extract the 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/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1926— elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1926-1946 | elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:2037-2057 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:1926` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 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-138 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:119-139 — 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 12 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:197` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:433— elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:433-453 | elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:468-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:433` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1113` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 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-511 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:962-982 — 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 11 separate duplicated blocks between them, totalling at least 115 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 × 2) go/cmd/wasm-plugins/awx/main.go:2671— go/cmd/wasm-plugins/awx/main.go:2671-2691 | go/cmd/wasm-plugins/netbox/main.go:436-456 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) go/pkg/addon/grpc.go:115— go/pkg/addon/grpc.go:115-135 | go/pkg/addon/grpc.go:147-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/addon/grpc.go:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) REDACTED:87— REDACTED:87-107 | REDACTED:402-422 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) rust/srql/src/query/endpoint_package_catalog.rs:274— rust/srql/src/query/endpoint_package_catalog.rs:274-294 | rust/srql/src/query/endpoint_packages.rs:783-803 — before extracting anything, compare `rust/srql/src/query/endpoint_package_catalog.rs` and `rust/srql/src/query/endpoint_packages.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_package_catalog.rs:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) rust/srql/src/query/endpoint_package_catalog.rs:324— rust/srql/src/query/endpoint_package_catalog.rs:324-344 | rust/srql/src/query/endpoint_packages.rs:837-857 — before extracting anything, compare `rust/srql/src/query/endpoint_package_catalog.rs` and `rust/srql/src/query/endpoint_packages.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_package_catalog.rs:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: datasvc — datasvc: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: dgraph-migrate — dgraph-migrate: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: network-config-downparser — network-config-downparser: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: serviceradar-afpacket — serviceradar-afpacket: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: serviceradar-anomaly-core — serviceradar-anomaly-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: serviceradar-topology-atlas — serviceradar-topology-atlas: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: serviceradar_recording — serviceradar_recording: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: serviceradar_recording_metadata — serviceradar_recording_metadata: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: serviceradar_srql — serviceradar_srql: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: serviceradar-cert-policy — serviceradar-cert-policy: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: serviceradar-secret-manager — serviceradar-secret-manager: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: config-bootstrap — config-bootstrap: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×11
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×11
Edited copy of a member (34 corresponding lines) rust/srql/src/query/devices/filters.rs:372— rust/srql/src/query/devices/filters.rs:372-408 | rust/srql/src/query/endpoint_packages.rs:578-616 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) docker/images/export_rootfs_from_layout.py:28— docker/images/export_rootfs_from_layout.py:28-61 | docker/images/extract_rootfs.py:115-155 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:18— elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:18-54 | elixir/web-ng/lib/serviceradar_web_ng/plugins/github_importer.ex:61-94 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) go/pkg/agent/adhoc_scan.go:272— go/pkg/agent/adhoc_scan.go:272-308 | go/pkg/agent/adhoc_scan.go:317-350 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) elixir/web-ng/native/god_view_nif/src/core/causality.rs:21— elixir/web-ng/native/god_view_nif/src/core/causality.rs:21-66 | rust/correlation-engine/src/god_view.rs:58-91 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) go/pkg/agent/addon_systemd.go:165— go/pkg/agent/addon_systemd.go:165-198 | go/pkg/agent/addon_systemd.go:229-262 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:58— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:58-99 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:560-593 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) go/pkg/scan/icmp_scanner_unix.go:604— go/pkg/scan/icmp_scanner_unix.go:604-637 | go/pkg/scan/icmp_scanner_windows.go:377-415 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_runtime.ex:53— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_runtime.ex:53-86 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_runtime.ex:118-153 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1802— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1802-1839 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1909-1942 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) go/pkg/agent/control_stream.go:356— go/pkg/agent/control_stream.go:356-403 | go/pkg/agent/push_loop_enroll.go:168-201 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×11
Edited copies of one member (3 members, 14+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:106— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:106-119 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:483-500 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_file_transfer_controller.ex:119-136 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) go/pkg/edge/edgerecord/discovery_batches.go:99— go/pkg/edge/edgerecord/discovery_batches.go:99-112 | go/pkg/edge/edgerecord/discovery_batches.go:127-143 | go/pkg/edge/edgerecord/discovery_batches.go:157-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:6155— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:6155-6168 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/asn_lookup.ex:66-79 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/asn_lookup.ex:88-105 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) go/pkg/k8sinventory/snapshot.go:77— go/pkg/k8sinventory/snapshot.go:77-90 | go/pkg/k8sinventory/snapshot.go:92-105 | go/pkg/k8sinventory/snapshot.go:107-120 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:319— elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:319-337 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1427-1440 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1555-1568 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) go/cmd/tools/bazel-reclaim/reclaim.go:317— go/cmd/tools/bazel-reclaim/reclaim.go:317-335 | go/cmd/tools/ubuntu-feed-merge/projector.go:1965-1978 | go/pkg/trivysidecar/kinds.go:87-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) go/pkg/addon/credentials.go:104— go/pkg/addon/credentials.go:104-119 | go/pkg/agent/awx_callback_credential.go:240-254 | go/pkg/agent/managed_certificates.go:116-129 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:159— elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/index.ex:159-172 | elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_live/show.ex:136-149 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_live/index.ex:409-425 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:556— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:556-569 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:575-588 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:629-643 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) go/cmd/wasm-plugins/proxmox/summaries.go:632— go/cmd/wasm-plugins/proxmox/summaries.go:632-647 | go/pkg/agent/plugin_runtime_http.go:745-758 | go/pkg/agent/remoteaccess/enhanced_recording.go:283-296 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_dups.ex:234— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_dups.ex:234-261 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/awx_proxmox_verification.ex:103-116 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/blob_purge.ex:184-206 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (11–12 lines × 2) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:449— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:449-459 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:498-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:449` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) elixir/serviceradar_core/lib/mix/tasks/serviceradar.topology_report.ex:126— elixir/serviceradar_core/lib/mix/tasks/serviceradar.topology_report.ex:126-136 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_projection_worker.ex:267-278 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (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/ingestion/result_ingestor.ex:472-482 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/core/result_processor.ex:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:575— elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:575-586 | elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:630-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:575` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) go/pkg/agent/control_stream.go:2169— go/pkg/agent/control_stream.go:2169-2180 | go/pkg/agent/endpoint_inventory_commands.go:292-302 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/endpoint_inventory_commands.go:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:108— swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:108-119 | swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:131-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) elixir/web-ng/native/god_view_nif/src/core/causality.rs:55— elixir/web-ng/native/god_view_nif/src/core/causality.rs:55-66 | rust/correlation-engine/src/god_view.rs:81-91 — before extracting anything, compare `elixir/web-ng/native/god_view_nif/src/core/causality.rs` and `rust/correlation-engine/src/god_view.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/native/god_view_nif/src/core/causality.rs:55` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) elixir/web-ng/native/god_view_nif/src/core/utils.rs:466— elixir/web-ng/native/god_view_nif/src/core/utils.rs:466-477 | elixir/web-ng/native/god_view_nif/src/lib.rs:258-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/native/god_view_nif/src/core/utils.rs:466` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) rust/srql/src/query/events/rollup.rs:75— rust/srql/src/query/events/rollup.rs:75-86 | rust/srql/src/query/starrocks.rs:1089-1099 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) rust/srql/src/query/field_survey.rs:110— rust/srql/src/query/field_survey.rs:110-120 | rust/srql/src/query/wifi_map.rs:112-123 — before extracting anything, compare `rust/srql/src/query/field_survey.rs` and `rust/srql/src/query/wifi_map.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/field_survey.rs:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/field_survey.rs:120` calls `push`, `timestamptz`, `is_raw_entity` and `rust/srql/src/query/wifi_map.rs:123` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 2) rust/srql/src/query/logs/rollup.rs:29— rust/srql/src/query/logs/rollup.rs:29-39 | rust/srql/src/query/traces.rs:245-256 — before extracting anything, compare `rust/srql/src/query/logs/rollup.rs` and `rust/srql/src/query/traces.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/rollup.rs:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:579— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:579-585 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:479-485 | elixir/web-ng/lib/serviceradar_web_ng_web/live/metric_live/show.ex:398-404 | elixir/web-ng/lib/serviceradar_web_ng_web/live/trace_live/show.ex:1087-1093 — `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 131 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:579` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:489` calls `display_message` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:589` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) 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:588-594 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:1744-1750 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor.ex:1488-1494 — 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 12 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 (7 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-45 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_health_worker.ex:39-45 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/git_catalog_sync_worker.ex:50-56 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/run_pulse_worker.ex:50-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 4 call sites, so a change lands once.
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:69-75 — 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/netflow_live/dashboard/helpers.ex:9— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/helpers.ex:9-15 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/helpers.ex:34-40 | elixir/web-ng/lib/serviceradar_web_ng_web/live/security/threat_intel_live/index.ex:1124-1130 | elixir/web-ng/lib/serviceradar_web_ng_web/live/spatial_live/field_survey_review.ex:1246-1252 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1674— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1674-1680 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:12-22 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1001-1011 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:21-27 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.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 4 separate duplicated blocks between them, totalling at least 44 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 × 4) go/cmd/wasm-plugins/axis/main.go:828— go/cmd/wasm-plugins/axis/main.go:828-835 | go/pkg/agent/push_loop_addons.go:602-609 | go/pkg/devicealias/alias.go:142-148 | go/pkg/endpointinventory/hashes.go:603-610 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/axis/main.go:828` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) go/pkg/config/config.go:119— go/pkg/config/config.go:119-126 | go/pkg/datasvc/server.go:85-91 | go/pkg/grpc/server.go:364-371 | go/pkg/lifecycle/logger.go:156-163 — 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 (7 lines × 4) elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:371— elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:371-377 | elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:647-653 | elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:663-669 | elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:679-685 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:371` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) rust/srql/src/query/devices.rs:48— rust/srql/src/query/devices.rs:48-54 | rust/srql/src/query/events.rs:32-39 | rust/srql/src/query/logs/mod.rs:88-94 | rust/srql/src/query/logs/mod.rs:100-106 — before extracting anything, compare `rust/srql/src/query/devices.rs` and `rust/srql/src/query/events.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices.rs:48` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) rust/srql/src/query/logs/filters.rs:122— rust/srql/src/query/logs/filters.rs:122-128 | rust/srql/src/query/logs/filters.rs:359-365 | rust/srql/src/query/traces.rs:587-593 | rust/srql/src/query/traces.rs:627-633 — before extracting anything, compare `rust/srql/src/query/logs/filters.rs` and `rust/srql/src/query/traces.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/filters.rs:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/traces.rs:585` calls `Ok` and `rust/srql/src/query/logs/filters.rs:120` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×10
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2276— `.node-finder-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2282— `.node-finder-input:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:4078— `svg [data-node-id]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:4116— `svg [data-legend-kind]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:4259— `.relationship-hit-target` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2276— `.node-finder-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2282— `.node-finder-input:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:4078— `svg [data-node-id]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:4116— `svg [data-legend-kind]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:4259— `.relationship-hit-target` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
TodoComment rust/correlation-engine/src/context_hydrator.rs:49— /// 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.
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 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 go/pkg/scan/syn_scanner_bpf.go:60— // 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/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/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 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/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.
Change coupling: engine.rs ↔ mod.rs rust/srql/src/query/engine.rs:1— `rust/srql/src/query/engine.rs` and `rust/srql/src/query/viz/mod.rs` change together 100% of the time (10 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 10 shared commits counted here, the most recent 3 are `1a924ab2` feat(audit): paginate and filter security events with SRQL access; `431a1193` no-mistakes(review): Preserve sysmon compatibility and fix analytics …; `68bbe1cb` feat(srql): camera_sources entity and agg:last downsampling — run `git show` on any of them.
Change coupling: topology_atlas.ex ↔ lib.rs elixir/serviceradar_core/lib/serviceradar/topology_atlas.ex:1— `elixir/serviceradar_core/lib/serviceradar/topology_atlas.ex` and `elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `c2b033eb` feat(topology): project canonical aggregate membership inside Atlas; `f0279a42` no-mistakes(review): Keep stale attachment links and publish pipeline…; `642b00f9` no-mistakes(test): Validate preserved topology fixes; authenticated b… — run `git show` on any of them.
Change coupling: god_view_world_gpu.playwright.js ↔ WorldMapRenderer.js elixir/web-ng/assets/god_view_world_gpu.playwright.js:1— `elixir/web-ng/assets/god_view_world_gpu.playwright.js` and `elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js` change together 72% of the time (13 of the 18 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 13 shared commits counted here, the most recent 3 are `fec8280b` no-mistakes(review): Negotiate Atlas membership v2 safely across mixe…; `287b7ad6` no-mistakes(review): Invalidate old membership binding when tile sele…; `05885397` no-mistakes(review): Start Atlas retention deadline when selected geo… — run `git show` on any of them.
Change coupling: runtime.exs ↔ runtime.exs elixir/serviceradar_core/config/runtime.exs:1— `elixir/serviceradar_core/config/runtime.exs` and `elixir/serviceradar_core_elx/config/runtime.exs` change together 66% of the time (54 of the 82 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 54 shared commits counted here, the most recent 3 are `5f42dfec` Wire recovery controls through durable EventWriter receipt handling; `4c10eef7` fix(core): share Oban crontab across core and core_elx and retire dea…; `63256f92` fix: let a default install store telemetry and accept its first upgrade — run `git show` on any of them.
Change coupling: serviceradar_nvr.ex ↔ capacity.ex elixir/serviceradar_nvr/lib/serviceradar_nvr.ex:1— `elixir/serviceradar_nvr/lib/serviceradar_nvr.ex` and `elixir/serviceradar_nvr/lib/serviceradar_nvr/capacity.ex` change together 64% of the time (7 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) 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 7 shared commits counted here, the most recent 3 are `d911df06` no-mistakes(review): Re-check recovery gate after block recovery and …; `65ecfb19` feat(nvr): publish local records during active capture; `a1a07bed` feat(nvr): persist canonical Core intent acknowledgements — run `git show` on any of them.
Change coupling: native.ex ↔ lib.rs elixir/serviceradar_core/lib/serviceradar/topology_atlas/native.ex:1— `elixir/serviceradar_core/lib/serviceradar/topology_atlas/native.ex` and `elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c2b033eb` feat(topology): project canonical aggregate membership inside Atlas; `00c1b2e7` no-mistakes(review): Fix topology alias resolution, freshness, and ra…; `bd779c72` Resolve rendered topology bundles through bounded native pages — run `git show` on any of them.
Change coupling: lifecycle_dom_setup_methods.js ↔ rendering_graph_view_methods.js elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:1— `elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js` and `elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js` change together 58% of the time (7 of the 12 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 7 shared commits counted here, the most recent 3 are `bf1d8217` feat(god-view): render on WebGPU only and port packet flow to WGSL; `faa6ba44` fix(god-view): expand clusters inside the radial atlas and connect th…; `0a561462` Fix managed topology label and focus regressions — run `git show` on any of them.
Change coupling: god_view_elk_scene_acceptance.playwright.js ↔ rendering_graph_core_methods.js elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:1— `elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js` and `elixir/web-ng/assets/js/lib/god_view/rendering_graph_core_methods.js` 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) 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 5 shared commits counted here, the most recent 3 are `f3c37d15` feat(god-view): per-edge WGSL packet flow, clock-only animation, chea…; `104a69d3` fix(topology): keep managed scene glyphs feasible; `ae337d30` test(topology): tighten scene geometry contract — run `git show` on any of them.
Change coupling: tests.rs ↔ mod.rs rust/srql/src/parser/tests.rs:1— `rust/srql/src/parser/tests.rs` and `rust/srql/src/query/viz/mod.rs` 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) 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 5 shared commits counted here, the most recent 3 are `634af2d3` feat(srql): identity decisions and de-duplication tasks in SRQL and MCP; `69850f53` feat(graph): read topology from Dgraph when GRAPH_READ=dgraph; `1e9a4d48` feat(srql): expose device_sweep_overlap declared-vs-observed diagnostics — run `git show` on any of them.
Change coupling: native.ex ↔ details.rs elixir/serviceradar_core/lib/serviceradar/topology_atlas/native.ex:1— `elixir/serviceradar_core/lib/serviceradar/topology_atlas/native.ex` and `elixir/serviceradar_core/native/topology_atlas_nif/src/details.rs` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `c2b033eb` feat(topology): project canonical aggregate membership inside Atlas; `bd779c72` Resolve rendered topology bundles through bounded native pages; `adbfa113` Expose bounded native topology picking reads — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×10
Edited copy of a member (30 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-249 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:258-287 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:446— elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:446-475 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:834-866 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:236— elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:236-273 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule_dispatcher.ex:462-491 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/ephemeral_device_expiry.ex:332— elixir/serviceradar_core/lib/serviceradar/inventory/ephemeral_device_expiry.ex:332-361 | elixir/serviceradar_core/lib/serviceradar/inventory/source_retired_expiry.ex:259-289 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) REDACTED:430— REDACTED:430-459 | rust/srql/src/query/services.rs:205-246 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) rust/srql/src/query/devices.rs:190— rust/srql/src/query/devices.rs:190-219 | rust/srql/src/query/devices/stats/query.rs:18-50 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) go/pkg/datasvc/nats.go:204— go/pkg/datasvc/nats.go:204-235 | go/pkg/natsutil/tls.go:22-51 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) go/pkg/agent/netprobe/config.go:319— go/pkg/agent/netprobe/config.go:319-351 | go/pkg/bumblebee/catalog.go:143-172 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:193— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:193-224 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:157-186 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) go/pkg/models/service_registration.go:11— go/pkg/models/service_registration.go:11-47 | go/pkg/models/service_registration.go:51-80 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×10
Edited copy of a member (39 corresponding lines) go/pkg/scan/icmp_scanner_unix.go:391— go/pkg/scan/icmp_scanner_unix.go:391-429 | go/pkg/scan/icmp_scanner_windows.go:269-307 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:113— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:113-151 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:155-202 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1944— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1944-1982 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2587-2629 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1102— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1102-1140 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:1241-1279 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) rust/srql/src/query/mtr_hops.rs:650— rust/srql/src/query/mtr_hops.rs:650-688 | rust/srql/src/query/mtr_traces.rs:1147-1195 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) go/pkg/agent/multi_sweep_service.go:626— go/pkg/agent/multi_sweep_service.go:626-666 | go/pkg/agent/server.go:451-489 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) 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-2300 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2304-2342 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) go/pkg/agent/plugin_runtime_host_authority.go:1230— go/pkg/agent/plugin_runtime_host_authority.go:1230-1273 | go/pkg/agent/plugin_runtime_host_authority.go:1275-1313 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) rust/anomaly-core/src/signal.rs:156— rust/anomaly-core/src/signal.rs:156-200 | rust/anomaly-core/src/signal.rs:241-279 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:385— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:385-428 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:432-470 — These two members are one piece of code written twice and then edited apart: 39 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 (5 members, 50+ identical tokens) · ×10
Members sharing a duplicated core (5 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140— elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:140-152 | elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex:142-154 | elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:3256-3261 | elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:182-194 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:862-867 — 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-164 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:150-176 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:189-218 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:190-225 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:146-173 — 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:168— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:168-173 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:180-185 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:222-227 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:229-234 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:177-182 — 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-204 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:191-216 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:233-258 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:240-265 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:188-213 — 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:1700— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1700-1714 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:54-72 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:46-64 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1040-1058 | 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.
Members sharing a duplicated core (5 members, 50+ identical tokens) go/cmd/wasm-plugins/unifi-protect/protect_network.go:55— go/cmd/wasm-plugins/unifi-protect/protect_network.go:55-87 | go/cmd/wasm-plugins/unifi-protect/protect_network.go:147-184 | go/cmd/wasm-plugins/unifi-protect/protect_network.go:192-228 | go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:14-58 | go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:110-156 — 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/native/dgraph_nif/src/lib.rs:454— elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:454-468 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:478-492 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:535-553 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:558-575 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:579-596 — 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) REDACTED:82— REDACTED:82-90 | rust/srql/src/query/endpoint_inventory_scans.rs:207-215 | rust/srql/src/query/endpoint_packages.rs:656-664 | rust/srql/src/query/mtr_traces.rs:296-304 | rust/srql/src/query/threat_intel_matches.rs:372-380 — 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) REDACTED:229— REDACTED:229-285 | REDACTED:235-287 | REDACTED:204-264 | REDACTED:204-276 | rust/srql/src/query/threat_intel_matches.rs:308-335 — 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) rust/srql/src/query/otel_metric_points.rs:120— rust/srql/src/query/otel_metric_points.rs:120-132 | rust/srql/src/query/otel_metrics.rs:143-155 | rust/srql/src/query/services.rs:185-198 | rust/srql/src/query/services.rs:251-264 | rust/srql/src/query/traces.rs:390-402 — 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.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×10
Edited copies of one member (3 members, 19+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:553— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:553-576 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:892-910 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:914-935 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) rust/srql/src/query/capacity_forecasts.rs:216— rust/srql/src/query/capacity_forecasts.rs:216-234 | rust/srql/src/query/mtr_hops.rs:397-415 | rust/srql/src/query/mtr_traces.rs:255-273 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:122— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:122-140 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:144-162 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:166-189 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:69— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:69-93 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:122-140 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:169-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/forms.ex:45— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/forms.ex:45-63 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/profiles.ex:165-183 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:143-163 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:678— elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:678-696 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:700-718 | elixir/serviceradar_core/lib/serviceradar/data_service/client.ex:741-759 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) go/pkg/agentgateway/gateway_client.go:331— go/pkg/agentgateway/gateway_client.go:331-353 | go/pkg/agentgateway/gateway_client.go:632-653 | go/pkg/agentgateway/gateway_client.go:814-832 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) rust/correlation-engine/src/reasoner.rs:190— rust/correlation-engine/src/reasoner.rs:190-208 | rust/correlation-engine/src/reasoner.rs:214-232 | rust/correlation-engine/src/reasoner.rs:300-320 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) rust/srql/src/query/bmp_events.rs:93— rust/srql/src/query/bmp_events.rs:93-120 | rust/srql/src/query/otel_metrics.rs:114-136 | rust/srql/src/query/trace_summaries.rs:89-107 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:394— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:394-413 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:738-757 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:922-940 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×10
Edited copies of one member (3 members, 15+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:141— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:141-159 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:168-182 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:191-206 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1342— elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1342-1356 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1368-1382 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1506-1520 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:448— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:448-462 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:927-946 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:1227-1243 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) go/pkg/edge/edgerecord/metric_batch.go:82— go/pkg/edge/edgerecord/metric_batch.go:82-96 | go/pkg/edge/edgerecord/plugin_result_batch.go:83-97 | go/pkg/edge/edgerecord/unleased_sweep.go:88-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) REDACTED:844— REDACTED:844-859 | go/pkg/agent/adhoc_scan.go:443-457 | go/pkg/agent/sweep_config_gateway.go:336-352 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:143— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:143-157 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:214-228 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline.ex:232-246 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:380— elixir/serviceradar_core/lib/serviceradar/inventory/identity/awx_source_retirement.ex:380-400 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_retirement.ex:881-902 | elixir/serviceradar_core/lib/serviceradar/inventory/source_retired_expiry.ex:180-194 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) go/pkg/agent/control_stream.go:1632— go/pkg/agent/control_stream.go:1632-1646 | go/pkg/agent/push_loop_status.go:446-461 | go/pkg/agent/sweep_lease_executor.go:518-534 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2677— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2677-2691 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_authority_contraction.ex:177-191 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1603-1617 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex:1005— elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex:1005-1021 | elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex:1091-1106 | elixir/serviceradar_core/lib/serviceradar/event_writer/config.ex:1191-1205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×10
Edited copies of one member (3 members, 17+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9566— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9566-9582 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9854-9870 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9877-9893 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:190— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:190-206 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:210-226 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rbac_live.ex:258-276 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:473— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:473-489 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:457-473 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:356-372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:326— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:326-342 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/builder.ex:11-30 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:236-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:417— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:417-433 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:455-471 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:573-597 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:161— elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:161-177 | elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:184-200 | elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:207-223 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) go/pkg/agent/mapper_config_gateway.go:215— go/pkg/agent/mapper_config_gateway.go:215-231 | go/pkg/agent/mapper_config_gateway.go:233-250 | go/pkg/agent/mapper_config_gateway.go:252-272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) go/pkg/agentgateway/gateway_client.go:560— go/pkg/agentgateway/gateway_client.go:560-579 | go/pkg/agentgateway/gateway_client.go:838-854 | go/pkg/agentgateway/gateway_client.go:861-877 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) go/pkg/agent/netprobe/client.go:227— go/pkg/agent/netprobe/client.go:227-243 | go/pkg/agent/netprobe/client.go:246-262 | go/pkg/agent/netprobe/client.go:265-285 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) go/pkg/agent/proxmox_console_plugin.go:602— go/pkg/agent/proxmox_console_plugin.go:602-618 | go/pkg/agent/proxmox_console_plugin.go:624-646 | go/pkg/agent/proxmox_console_plugin.go:680-699 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (22 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:216— elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:216-237 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rule_matcher.ex:164-185 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/observability/log_promotion.ex:213` calls `get` and `elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rule_matcher.ex:162` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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:564-585 — 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 (22 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-128 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/sankey.ex:132-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:360— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex:360-381 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/link_local_alias_archive.ex:131-152 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/broadcast_alias_archive.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/link_local_alias_archive.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 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) go/pkg/scan/banner_grab/probe.go:32— go/pkg/scan/banner_grab/probe.go:32-53 | go/pkg/scan/banner_grab/probe.go:57-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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/scan/banner_grab/probe.go:32` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (22 lines × 2) swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:287— swift/FieldSurvey/FieldSurvey/Managers/RoomScanner.swift:287-308 | swift/FieldSurvey/FieldSurvey/Managers/SurveySessionStore.swift:183-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Managers/SurveySessionStore.swift:183` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) rust/netprobe/ebpf/src/lib.rs:1090— rust/netprobe/ebpf/src/lib.rs:1090-1111 | rust/netprobe/ebpf/src/lib.rs:1205-1226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/netprobe/ebpf/src/lib.rs:1090` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/netprobe/ebpf/src/lib.rs:1227` calls `is_valid_process_owner_ids` and `rust/netprobe/ebpf/src/lib.rs:1112` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) rust/srql/src/query/field_survey.rs:647— rust/srql/src/query/field_survey.rs:647-668 | rust/srql/src/query/wifi_map.rs:634-655 — before extracting anything, compare `rust/srql/src/query/field_survey.rs` and `rust/srql/src/query/wifi_map.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22 lines × 2) rust/srql/src/query/endpoint_packages.rs:292— rust/srql/src/query/endpoint_packages.rs:292-320 | rust/srql/src/query/endpoint_packages.rs:325-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_packages.rs:292` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120-127 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:139-146 | elixir/serviceradar_core/lib/serviceradar/edge/sweep_projection.ex:108-115 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:33-40 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 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:183-190 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:270-277 | 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 76 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:988-995 — 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 60 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/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/index.ex:435— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/index.ex:435-442 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/show.ex:552-559 | elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:2233-2240 | elixir/web-ng/lib/serviceradar_web_ng_web/live/gateway_live/show.ex:466-473 — `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 38 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 × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:1869— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:1869-1876 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:2105-2112 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live.ex:1817-1824 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/availability_source_profiles_live.ex:469-476 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:2102` calls `normalize_source_type` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/availability_source_profiles_live.ex:466` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 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 60 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) go/pkg/bumblebee/config.go:60— go/pkg/bumblebee/config.go:60-68 | go/pkg/endpointinventory/config.go:106-113 | go/pkg/endpointinventory/config.go:212-219 | go/pkg/scalibrinventory/config.go:39-46 — `go/pkg/bumblebee/config.go` and `go/pkg/endpointinventory/config.go` 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 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/bumblebee/config.go:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) go/pkg/agent/multi_sweep_service.go:681— go/pkg/agent/multi_sweep_service.go:681-688 | go/pkg/agent/netprobe/translator.go:385-393 | REDACTED:437-444 | go/pkg/agent/syncsources/armis/driver.go:431-438 — 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) go/pkg/cli/edge_onboarding.go:351— go/pkg/cli/edge_onboarding.go:351-358 | go/pkg/cli/edge_onboarding.go:412-419 | go/pkg/cli/nats_bootstrap.go:1028-1035 | go/pkg/cli/nats_bootstrap.go:1160-1167 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/cli/edge_onboarding.go:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `go/pkg/cli/nats_bootstrap.go:1158` calls `Sprintf` and `go/pkg/cli/edge_onboarding.go:348` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) rust/srql/src/query/devices/stats/clauses.rs:30— rust/srql/src/query/devices/stats/clauses.rs:30-37 | rust/srql/src/query/devices/stats/clauses.rs:100-107 | rust/srql/src/query/devices/stats/clauses.rs:139-147 | rust/srql/src/query/devices/stats/filters.rs:170-177 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices/stats/clauses.rs:30` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×9
Edited copies of one member (4 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:735— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:735-742 | elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:861-875 | elixir/serviceradar_core/lib/serviceradar/srql_device_matcher.ex:60-69 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/composite_checks_live/preview.ex:79-88 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:911— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:911-920 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:924-931 | elixir/serviceradar_core/lib/serviceradar/spiffe.ex:449-457 | elixir/serviceradar_core/lib/serviceradar/spiffe.ex:461-469 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:503— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:503-510 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:484-491 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:374-381 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1621-1628 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:301— elixir/serviceradar_core/lib/serviceradar/automation/northbound/dispatcher.ex:301-311 | elixir/serviceradar_core/lib/serviceradar/plugins/owned_assignment_retraction.ex:370-379 | elixir/serviceradar_core/lib/serviceradar/plugins/wasm_plugin_rollout_artifact.ex:522-532 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:706-713 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reviewer.ex:131— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reviewer.ex:131-138 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/changes/approve_awx_host_membership.ex:168-175 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/runtime_config.ex:131-140 | elixir/serviceradar_core/lib/serviceradar/json_document.ex:20-27 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:29— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:29-36 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:37-44 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:125-133 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_secret_controller.ex:30-37 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:760— elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:760-771 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex:63-72 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1626-1639 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1957-1964 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1793— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1793-1800 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:598-606 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/data.ex:173-181 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:1018-1026 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) rust/netprobe/src/af_xdp_classifier.rs:284— rust/netprobe/src/af_xdp_classifier.rs:284-291 | rust/netprobe/src/attribution.rs:1788-1795 | rust/netprobe/src/ebpf_runtime.rs:464-471 | rust/netprobe/src/fingerprint.rs:853-860 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:475— elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_ingestor.ex:475-487 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_payload.ex:19-31 | elixir/web-ng/lib/serviceradar_web_ng/remote_access_desktop_targets.ex:234-246 — 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:500` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:489` calls `capabilities`, `sort`, `module_name` and `elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:594` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:96— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:96-108 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:211-223 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:118-130 — `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 125 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 (13 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:146— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:146-158 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:173-185 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:191-203 — 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/edge/remote_access_file_transfers.ex:818— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:818-830 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1097-1109 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:1113-1125 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex:818` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) go/pkg/agent/plugin_runtime_wazero.go:145— go/pkg/agent/plugin_runtime_wazero.go:145-157 | go/pkg/agent/plugin_runtime_wazero.go:216-228 | go/pkg/agent/proxmox_console_plugin.go:265-277 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/plugin_runtime_wazero.go:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 3) go/cmd/wasm-plugins/starlink/datausage.go:101— go/cmd/wasm-plugins/starlink/datausage.go:101-113 | go/cmd/wasm-plugins/starlink/datausage.go:158-170 | go/cmd/wasm-plugins/starlink/flights.go:104-116 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/starlink/datausage.go:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) REDACTED:2464— REDACTED:2464-2476 | REDACTED:2483-2495 | REDACTED:2502-2514 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 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-35 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:43-52 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:80-89 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:107-116 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:26` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:468— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:468-477 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:698-707 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:730-739 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:758-767 — 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 (10 lines × 4) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:139— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:139-148 | elixir/serviceradar_core/lib/serviceradar/integrations/validations/composite_export.ex:100-109 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/generic_webhook.ex:506-515 | elixir/serviceradar_core/lib/serviceradar/outbound_mail/runtime_config.ex:159-168 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:139` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) go/pkg/agent/plugin_runtime_wazero.go:60— go/pkg/agent/plugin_runtime_wazero.go:60-77 | go/pkg/agent/plugin_runtime_wazero.go:145-154 | go/pkg/agent/plugin_runtime_wazero.go:216-225 | go/pkg/agent/proxmox_console_plugin.go:265-274 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 4) go/pkg/agent/push_loop_discovery_edge.go:49— go/pkg/agent/push_loop_discovery_edge.go:49-58 | go/pkg/agent/push_loop_metrics_edge.go:214-223 | go/pkg/agent/push_loop_plugin_results_edge.go:56-65 | go/pkg/agent/push_loop_telemetry_edge.go:65-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 all 4 call sites, so a change lands once.
Duplicated block (10 lines × 4) rust/srql/src/query/device_sweep_overlap.rs:176— rust/srql/src/query/device_sweep_overlap.rs:176-185 | rust/srql/src/query/field_survey.rs:556-565 | rust/srql/src/query/public_endpoints.rs:157-166 | rust/srql/src/query/wifi_map.rs:556-565 — before extracting anything, compare `rust/srql/src/query/device_sweep_overlap.rs` and `rust/srql/src/query/field_survey.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/device_sweep_overlap.rs:176` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 4) rust/srql/src/query/camera_sources.rs:50— rust/srql/src/query/camera_sources.rs:50-59 | rust/srql/src/query/device_sweep_overlap.rs:55-64 | rust/srql/src/query/public_endpoints.rs:49-58 | rust/srql/src/query/threat_intel_matches.rs:61-70 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/camera_sources.rs:62` calls `ensure_entity` and `rust/srql/src/query/threat_intel_matches.rs:73` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) rust/srql/src/query/logs/rollup.rs:110— rust/srql/src/query/logs/rollup.rs:110-119 | rust/srql/src/query/logs/stats_clauses.rs:39-48 | rust/srql/src/query/logs/stats_clauses.rs:94-103 | rust/srql/src/query/traces.rs:370-379 — before extracting anything, compare `rust/srql/src/query/logs/rollup.rs` and `rust/srql/src/query/logs/stats_clauses.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/rollup.rs:110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 4) rust/srql/src/query/camera_sources.rs:248— rust/srql/src/query/camera_sources.rs:248-257 | rust/srql/src/query/device_sweep_overlap.rs:265-274 | rust/srql/src/query/public_endpoints.rs:214-223 | rust/srql/src/query/threat_intel_matches.rs:439-448 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/camera_sources.rs:245` calls `is_empty`, `Ok`, `into` and `rust/srql/src/query/device_sweep_overlap.rs:264` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
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::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::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::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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×8
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×8
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×8
Edited copies of one member (3 members, 16+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:82— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:82-101 | elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:40-55 | elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:59-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:235— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:235-250 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:315-335 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_continuation_boundary.ex:45-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) REDACTED:605— REDACTED:605-634 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_retention.ex:310-332 | elixir/serviceradar_core/lib/serviceradar/observability/dataset_snapshot_prune.ex:198-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) go/pkg/agent/release_runtime.go:384— go/pkg/agent/release_runtime.go:384-399 | go/pkg/agent/release_runtime.go:614-629 | go/pkg/endpointinventory/cache.go:44-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) REDACTED:763— REDACTED:763-779 | go/pkg/edgeonboarding/mtls/token.go:116-131 | go/pkg/edgeonboarding/token.go:179-194 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) go/pkg/sweeper/base_processor.go:694— go/pkg/sweeper/base_processor.go:694-709 | go/pkg/sweeper/base_processor.go:711-726 | go/pkg/sweeper/base_processor.go:742-758 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) go/cmd/wasm-plugins/proxmox/identity.go:311— go/cmd/wasm-plugins/proxmox/identity.go:311-330 | go/cmd/wasm-plugins/proxmox/identity.go:337-352 | go/cmd/wasm-plugins/proxmox/identity.go:450-465 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:5929— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:5929-5944 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:723-738 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1551-1566 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (9 lines × 4) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1286— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex:1286-1294 | elixir/serviceradar_core/lib/serviceradar/agent_tracker.ex:292-300 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1975-1983 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:372-380 — 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_relay_session_controller.ex:144— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:144-152 | 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/proxmox_console_session_controller.ex:112-120 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:412-420 — 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 76 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 × 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-88 | elixir/serviceradar_core/lib/serviceradar/inventory/device_identifier_gc_worker.ex:60-68 | elixir/serviceradar_core/lib/serviceradar/jobs/schedule_health_worker.ex:38-46 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:31-39 — 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/live/admin/dashboard_package_live/index.ex:1114— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/dashboard_package_live/index.ex:1114-1122 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/source_queries.ex:16-24 | elixir/web-ng/lib/serviceradar_web_ng_web/live/scan_live.ex:271-279 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/prefix_tags_live.ex:823-831 — 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/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:565— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:565-573 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:2528-2536 | elixir/web-ng/lib/serviceradar_web_ng_web/live/camera_relay_live/index.ex:982-990 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex:2026-2034 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:565` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) go/pkg/cli/edge_onboarding.go:361— go/pkg/cli/edge_onboarding.go:361-369 | go/pkg/cli/edge_onboarding.go:422-430 | go/pkg/cli/nats_bootstrap.go:1038-1046 | go/pkg/cli/nats_bootstrap.go:1170-1178 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 4) rust/srql/src/query/devices/stats/spec.rs:18— rust/srql/src/query/devices/stats/spec.rs:18-26 | rust/srql/src/query/otel_metric_points.rs:645-653 | rust/srql/src/query/otel_metrics.rs:585-593 | rust/srql/src/query/services.rs:211-219 — before extracting anything, compare `rust/srql/src/query/devices/stats/spec.rs` and `rust/srql/src/query/services.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices/stats/spec.rs:18` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 4) rust/srql/src/query/devices/filters/jsonb.rs:12— rust/srql/src/query/devices/filters/jsonb.rs:12-20 | rust/srql/src/query/gateways.rs:292-300 | rust/srql/src/query/sweep_groups.rs:215-223 | rust/srql/src/query/sweep_profiles.rs:225-233 — before extracting anything, compare `rust/srql/src/query/gateways.rs` and `rust/srql/src/query/sweep_groups.rs` as WHOLE FILES: this scan already matched 11 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 (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 163 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 11 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:467` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2983— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2983-2987 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_parser.ex:118-122 | elixir/serviceradar_core/lib/serviceradar/prefix_tags/manual.ex:378-382 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel.ex:682-686 — 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.
Duplicated block (5 lines × 4) elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:115— elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:115-119 | elixir/serviceradar_core/lib/serviceradar/plugins/producer_schedule.ex:535-539 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention_worker.ex:93-97 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention_worker.ex:71-75 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/object_store/retention_worker.ex:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:157— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:157-161 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:251-255 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:500-504 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:537-541 — 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) go/pkg/agent/push_loop_discovery_edge.go:189— go/pkg/agent/push_loop_discovery_edge.go:189-193 | go/pkg/agent/push_loop_plugin_results_edge.go:163-167 | go/pkg/agent/push_loop_telemetry_edge.go:197-201 | go/pkg/agent/push_loop_workload_identity_edge.go:91-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/push_loop_discovery_edge.go:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) rust/srql/src/query/logs/filters.rs:354— rust/srql/src/query/logs/filters.rs:354-358 | REDACTED:944-949 | rust/srql/src/query/traces.rs:538-542 | rust/srql/src/query/traces.rs:553-557 — before extracting anything, compare `rust/srql/src/query/logs/filters.rs` and `REDACTED` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/filters.rs:354` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
serviceradar_netprobe::attribution::drain_ring (cyclomatic 20) rust/netprobe/src/attribution.rs:2072— 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::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::executable_ownership::package_db::read_apk (cyclomatic 19) rust/netprobe/src/executable_ownership/package_db.rs:214— serviceradar_netprobe::executable_ownership::package_db::read_apk 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_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.
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::bitmap_index::validate_program (cognitive 25) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:860— god_view_nif::bitmap_index::validate_program has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, 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.
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.
god_view_nif::bitmap_addresses::ranges (cognitive 16) elixir/web-ng/native/god_view_nif/src/bitmap_addresses.rs:370— god_view_nif::bitmap_addresses::ranges has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×7
Edited copy of a member (40 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:310— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:310-349 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:783-823 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:26— elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/verdict_emitter.ex:26-65 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/verdict_emitter.ex:35-80 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:211— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:211-250 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:621-667 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:85— swift/FieldSurvey/FieldSurvey/Models/SignalCoverageInterpolator.swift:85-130 | swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:867-906 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) go/cmd/tools/armis-northbound-smoke/main.go:166— go/cmd/tools/armis-northbound-smoke/main.go:166-205 | go/cmd/tools/armis-northbound-smoke/main.go:246-291 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) go/pkg/k8sinventory/publisher.go:351— go/pkg/k8sinventory/publisher.go:351-390 | go/pkg/trivysidecar/publisher.go:243-286 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2154— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2154-2193 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1137-1178 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×7
Edited copy of a member (32 corresponding lines) rust/topology-atlas/src/spatial.rs:137— rust/topology-atlas/src/spatial.rs:137-168 | rust/topology-atlas/src/spatial.rs:178-216 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) rust/srql/src/query/otel_metric_points.rs:644— rust/srql/src/query/otel_metric_points.rs:644-675 | rust/srql/src/query/otel_metrics.rs:584-615 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) go/pkg/agent/addon/artifacts.go:79— go/pkg/agent/addon/artifacts.go:79-110 | go/pkg/agent/addon/manager.go:887-923 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) REDACTED:401— REDACTED:401-432 | REDACTED:333-364 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:422— elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:422-453 | elixir/web-ng/lib/serviceradar_web_ng/edge/collector_bundle_generator.ex:457-488 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:404— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:404-435 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/device_enrichment_rules_live.ex:439-474 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:289— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:289-321 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/network_credential_rules_live.ex:1509-1540 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 4+ corresponding lines) · ×7
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_close_reconciler.ex:20— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_close_reconciler.ex:20-23 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/status_buffer.ex:27-30 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_ingestor_queue.ex:41-44 | elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor_queue.ex:45-48 | elixir/serviceradar_core/lib/serviceradar/security/events.ex:35-38 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2561— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2561-2564 | elixir/serviceradar_core/lib/serviceradar/notifications/plugin_target.ex:301-304 | elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/source.ex:187-190 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/source.ex:275-278 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:3637-3640 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/retention_settings.ex:69— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/retention_settings.ex:69-72 | elixir/serviceradar_core/lib/serviceradar/edge/contract_registry_epoch_document.ex:275-278 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_requests.ex:501-504 | elixir/serviceradar_core/lib/serviceradar/edge/workers/record_event_worker.ex:97-100 | elixir/web-ng/lib/serviceradar_web_ng/ansible_automation.ex:259-262 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/runtime_config.ex:158— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/runtime_config.ex:158-161 | elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/interface_capacity.ex:92-95 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:562-565 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:3147-3150 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/rules_live/index.ex:1046-1049 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/edge_record_dead_letter.ex:338— elixir/serviceradar_core/lib/serviceradar/event_writer/edge_record_dead_letter.ex:338-341 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_artifact_persistence.ex:242-245 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_history.ex:442-445 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_finding_emitter.ex:397-400 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:3450-3453 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/sweep_plan.ex:261— elixir/serviceradar_core/lib/serviceradar/edge/sweep_plan.ex:261-264 | elixir/serviceradar_core/lib/serviceradar/event_writer/flow_app_classifier.ex:271-274 | elixir/serviceradar_core/lib/serviceradar/types/cidr.ex:70-73 | elixir/web-ng/lib/serviceradar_web_ng/client_ip.ex:84-87 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/flow_context/local_anchor.ex:88-91 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:753— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex:753-756 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:628-631 | elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:952-955 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:107-110 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/normalize.ex:91-94 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×6
Edited copy of a member (35 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-72 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:277-316 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:227— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:227-264 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:296-330 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) go/pkg/agent/plugin_runtime_manager.go:284— go/pkg/agent/plugin_runtime_manager.go:284-318 | go/pkg/agent/plugin_runtime_manager.go:327-368 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:29— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:29-63 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:152-186 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2039— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2039-2081 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2085-2119 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) go/pkg/logger/otel.go:281— go/pkg/logger/otel.go:281-315 | go/pkg/logger/otel.go:317-352 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×6
Edited copy of a member (41 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:197— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:197-241 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:245-285 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:121— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:121-164 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:168-208 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:176— elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:176-217 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:221-261 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) rust/srql/src/query/downsample/filters.rs:72— rust/srql/src/query/downsample/filters.rs:72-112 | rust/srql/src/query/downsample/filters.rs:118-160 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) go/pkg/agent/syncsources/armis/client.go:186— go/pkg/agent/syncsources/armis/client.go:186-226 | go/pkg/agent/syncsources/armis/client.go:251-300 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) rust/srql/src/query/endpoint_package_catalog.rs:118— rust/srql/src/query/endpoint_package_catalog.rs:118-167 | REDACTED:787-827 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×6
Edited copy of a member (31 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:139— elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:139-169 | elixir/web-ng/lib/serviceradar_web_ng/remote_desktop_webrtc.ex:174-211 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:78— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:78-135 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:141-171 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) rust/srql/src/query/starrocks/otel_metrics.rs:434— rust/srql/src/query/starrocks/otel_metrics.rs:434-464 | rust/srql/src/query/starrocks/traces.rs:649-683 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) go/cmd/wasm-plugins/axis/main.go:239— go/cmd/wasm-plugins/axis/main.go:239-269 | go/cmd/wasm-plugins/unifi-protect/main.go:118-152 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/launch_live.ex:336— elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/launch_live.ex:336-366 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ansible_panel_runtime.ex:269-303 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) REDACTED:254— REDACTED:254-284 | REDACTED:213-244 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×6
Edited copies of one member (4 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:131— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:131-147 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1108-1116 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1126-1134 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:465-473 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_plugin_id.ex:34— elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_plugin_id.ex:34-44 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_assignment_reconciler.ex:705-713 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/assignment_params.ex:76-86 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_assignment.ex:75-90 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:161— elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:161-170 | elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex:132-141 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/collector_live/index.ex:1017-1025 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/edge_sites_live/show.ex:511-519 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1127— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1127-1135 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:1141-1153 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6210-6221 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6227-6239 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1140— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1140-1149 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1164-1172 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1176-1187 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1191-1199 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:903— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:903-913 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:940-950 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:1029-1037 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:1085-1095 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×6
Edited copies of one member (3 members, 6+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:124— elixir/serviceradar_core/lib/serviceradar/automation/ansible/dispatch_marker_contract.ex:124-131 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_loader.ex:376-381 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel/events.ex:125-130 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_binding_review.ex:102— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_binding_review.ex:102-107 | elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_finalizer.ex:72-77 | elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_repairs.ex:34-41 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1650— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1650-1655 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:1829-1834 | elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/launch_live.ex:386-391 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:99— elixir/serviceradar_core/native/topology_atlas_nif/src/lib.rs:99-104 | elixir/serviceradar_core/native/zen_nif/src/lib.rs:25-30 | elixir/serviceradar_srql/native/srql_nif/src/lib.rs:130-135 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_dispatch_worker.ex:519— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_dispatch_worker.ex:519-526 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:298-305 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signal_policy.ex:130-135 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_users_live.ex:143— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/auth_users_live.ex:143-148 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:45-52 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authorization_live.ex:183-190 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 4+ corresponding lines) · ×6
Edited copies of one member (6 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:120— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:120-123 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:127-130 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:267-274 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:243-247 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:251-255 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:1032-1042 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:68— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:68-71 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:74-77 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:86-89 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:87-90 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:70-73 | elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:922-925 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/secret_provider_adapters/open_bao.ex:243— elixir/serviceradar_core/lib/serviceradar/credentials/secret_provider_adapters/open_bao.ex:243-246 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_nodes.ex:342-345 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/k8s_public_endpoints.ex:346-349 | elixir/serviceradar_core/lib/serviceradar/plugins/secret_refs.ex:696-699 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_dashboard_playlist.ex:176-179 | elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_selection.ex:33-36 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_quarantine.ex:439— elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_quarantine.ex:439-442 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex:320-323 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/peer_readiness.ex:186-189 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/recovery_worker.ex:126-129 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rollout.ex:191-194 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/runtime_metrics.ex:153-156 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:2807— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:2807-2810 | elixir/serviceradar_core/lib/serviceradar/inventory/integration_identity.ex:501-504 | REDACTED:785-788 | elixir/web-ng/lib/serviceradar_web_ng/topology/runtime_graph.ex:681-684 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_components.ex:2090-2093 | elixir/web-ng/lib/serviceradar_web_ng_web/stats/extract.ex:212-215 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/index.ex:306— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/index.ex:306-309 | elixir/web-ng/lib/serviceradar_web_ng_web/live/bmp_live/index.ex:272-275 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/wifi.ex:178-181 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/index.ex:95-98 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1579-1582 | elixir/web-ng/lib/serviceradar_web_ng_web/live/public_endpoints_live/index.ex:93-96 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Duplicated block (12–13 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:401— elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:401-412 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/ansible_live/binding_review.ex:416-428 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:401` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/projectors/telemetry_batch.ex:107— elixir/serviceradar_core/lib/serviceradar/edge/projectors/telemetry_batch.ex:107-118 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/wasm_plugin_result.ex:86-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/capacity_forecasting/source.ex:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 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-88 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:87-98 — 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 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) go/pkg/agent/plugin_runtime_network.go:151— go/pkg/agent/plugin_runtime_network.go:151-162 | go/pkg/agent/plugin_runtime_network.go: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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/plugin_runtime_network.go:151` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `go/pkg/agent/plugin_runtime_network.go:211` calls `Close` and `go/pkg/agent/plugin_runtime_network.go:149` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) rust/srql/src/query/identity/decisions.rs:87— rust/srql/src/query/identity/decisions.rs:87-98 | rust/srql/src/query/identity/deduplication_tasks.rs:85-97 — before extracting anything, compare `rust/srql/src/query/identity/decisions.rs` and `rust/srql/src/query/identity/deduplication_tasks.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/identity/decisions.rs:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:297— elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:297-306 | elixir/serviceradar_core/lib/serviceradar/camera/analysis_worker_alert_router.ex:343-353 — both copies are in the same file, so extract the 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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4661— elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4661-4671 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4695-4704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:4661` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:358— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:358-367 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:358` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) rust/srql/src/query/logs/topn.rs:277— rust/srql/src/query/logs/topn.rs:277-286 | rust/srql/src/query/logs/topn.rs:358-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/topn.rs:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2511— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2511-2520 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3354-3362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2511` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:484— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:484-493 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:563-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:483` calls `finding_uid` and `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:562` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/ip_format.ex:9— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/ip_format.ex:9-17 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/format.ex:7-16 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/ip_format.ex:4` calls `register_attribute` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/format.ex:2` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:365— elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:365-374 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:406-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:364` calls `value` and `elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:405` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:102— elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl:102-111 | elixir/serviceradar_core/src/serviceradar_otel_log_handler_v2.erl:127-135 — before extracting anything, compare `elixir/serviceradar_core/src/serviceradar_otel_log_handler.erl` and `elixir/serviceradar_core/src/serviceradar_otel_log_handler_v2.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:278— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:278-287 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:376-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:289` calls `failure`, `invalid` and `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:385` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Outbound HTTP without resilience build/wasm_plugins/upload_signature_tool.go:617— `http.Client{` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience config/manager_config/rust/src/ca_bundle.rs:20— `ureq::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:761— `Req.new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1226— `Req.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/authentication_live.ex:1285— `Req.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience elixir/web-ng/lib/serviceradar_web_ng_web/plugs/gateway_auth.ex:222— `Req.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
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.
Publisher::run (cognitive 55) rust/flow-collector/src/publisher.rs:105— Publisher::run has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (35 pts), match/switch 4 (16 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.
Publisher::publish_pending (cognitive 49) rust/flow-collector/src/publisher.rs:732— Publisher::publish_pending has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 7 (18 pts), loops 4 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Publisher::connect_once (cognitive 47) rust/flow-collector/src/publisher.rs:1002— Publisher::connect_once has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 5 (10 pts), match/switch 5 (8 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:520— 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:372— 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.
serviceradar_flow_collector::main (cognitive 40) rust/flow-collector/src/main.rs:47— serviceradar_flow_collector::main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 4 (9 pts), loops 5 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serviceradar_flow_collector::publisher::ensure_flows_stream (cognitive 32) rust/flow-collector/src/publisher.rs:2536— serviceradar_flow_collector::publisher::ensure_flows_stream has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (4 pts), boolean chains 2, 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.
serviceradar_flow_collector::metrics::serve_one (cognitive 20) rust/flow-collector/src/metrics.rs:801— serviceradar_flow_collector::metrics::serve_one has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 4 (5 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.
serviceradar_flow_collector::publisher::reconcile_existing_flows_stream (cognitive 17) rust/flow-collector/src/publisher.rs:2375— serviceradar_flow_collector::publisher::reconcile_existing_flows_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 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.
serviceradar_flow_collector::publisher::pattern_covers_pattern (cognitive 16) rust/flow-collector/src/publisher.rs:2704— 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.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (7 members, 50+ identical tokens) rust/srql/src/query/addon_statuses.rs:162— rust/srql/src/query/addon_statuses.rs:162-178 | rust/srql/src/query/agents.rs:454-470 | rust/srql/src/query/endpoint_inventory_scans.rs:259-277 | rust/srql/src/query/endpoint_package_catalog.rs:244-263 | rust/srql/src/query/endpoint_packages.rs:746-764 | rust/srql/src/query/gateways.rs:274-290 | rust/srql/src/query/sweep_groups.rs:233-249 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) rust/srql/src/query/events/filters.rs:225— rust/srql/src/query/events/filters.rs:225-284 | rust/srql/src/query/events/filters.rs:286-336 | rust/srql/src/query/events/filters.rs:341-402 | rust/srql/src/query/events/filters.rs:474-524 | rust/srql/src/query/events/filters.rs:530-615 | rust/srql/src/query/events/filters.rs:620-671 | rust/srql/src/query/events/filters.rs:765-819 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) rust/srql/src/query/events/filters.rs:286— rust/srql/src/query/events/filters.rs:286-336 | rust/srql/src/query/events/filters.rs:341-402 | rust/srql/src/query/events/filters.rs:474-524 | rust/srql/src/query/events/filters.rs:530-615 | rust/srql/src/query/events/filters.rs:620-671 | rust/srql/src/query/events/filters.rs:765-819 | rust/srql/src/query/logs/metadata.rs:28-72 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) rust/srql/src/query/field_survey.rs:703— rust/srql/src/query/field_survey.rs:703-726 | rust/srql/src/query/gateways.rs:55-78 | rust/srql/src/query/interfaces/bind.rs:12-35 | rust/srql/src/query/sql.rs:166-192 | REDACTED:603-624 | rust/srql/src/query/virtualization.rs:675-698 | rust/srql/src/query/wifi_map.rs:759-782 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) rust/srql/src/query/logs/filters.rs:30— rust/srql/src/query/logs/filters.rs:30-155 | rust/srql/src/query/logs/filters.rs:210-265 | rust/srql/src/query/logs/filters.rs:334-385 | rust/srql/src/query/starrocks/traces.rs:238-292 | rust/srql/src/query/traces.rs:497-512 | rust/srql/src/query/traces.rs:574-611 | rust/srql/src/query/traces.rs:613-651 — These 7 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 7 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 7 times.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×5
Edited copy of a member (37 corresponding lines) rust/srql/src/query/mtr_hops.rs:455— rust/srql/src/query/mtr_hops.rs:455-491 | rust/srql/src/query/mtr_hops.rs:496-532 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) rust/srql/src/query/gateways.rs:306— rust/srql/src/query/gateways.rs:306-342 | rust/srql/src/query/gateways.rs:348-384 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:69— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:69-105 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:74-122 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) go/cmd/wasm-plugins/proxmox/metric_telemetry.go:25— go/cmd/wasm-plugins/proxmox/metric_telemetry.go:25-61 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:24-64 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) rust/srql/src/query/starrocks.rs:1932— rust/srql/src/query/starrocks.rs:1932-1968 | REDACTED:1480-1522 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×5
Edited copy of a member (36 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:27— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:27-73 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:28-63 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:161— elixir/web-ng/lib/serviceradar_web_ng_web/channels/proxmox_console_stream_handler.ex:161-196 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:334-371 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) go/pkg/agent/app_tcp_route.go:129— go/pkg/agent/app_tcp_route.go:129-164 | go/pkg/agent/app_tcp_route.go:386-424 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:119— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:119-155 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:92-127 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:571— elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:571-606 | elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:610-657 — These two members are one piece of code written twice and then edited apart: 36 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 (38 corresponding lines) · ×5
Edited copy of a member (38 corresponding lines) rust/netprobe/ebpf/src/lib.rs:2117— rust/netprobe/ebpf/src/lib.rs:2117-2161 | rust/netprobe/ebpf/src/lib.rs:2166-2203 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) rust/srql/src/query/logs/rollup.rs:28— rust/srql/src/query/logs/rollup.rs:28-76 | rust/srql/src/query/traces.rs:244-281 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) rust/fieldsurvey-sidekick/src/radio.rs:480— rust/fieldsurvey-sidekick/src/radio.rs:480-517 | rust/fieldsurvey-sidekick/src/radio.rs:519-562 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) REDACTED:41— REDACTED:41-78 | REDACTED:115-156 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) 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-70 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:36-73 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×5
Edited copies of one member (4 members, 15+ corresponding lines) elixir/web-ng/native/god_view_nif/src/core/utils.rs:24— elixir/web-ng/native/god_view_nif/src/core/utils.rs:24-38 | elixir/web-ng/native/god_view_nif/src/core/utils.rs:41-55 | elixir/web-ng/native/god_view_nif/src/core/utils.rs:58-72 | elixir/web-ng/native/god_view_nif/src/core/utils.rs:74-89 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:283— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:283-298 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:302-317 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:321-336 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/threat_intel_live/index.ex:189-203 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) go/cmd/wasm-plugins/awx/launch_preflight.go:916— go/cmd/wasm-plugins/awx/launch_preflight.go:916-930 | go/cmd/wasm-plugins/awx/launch_preflight.go:973-987 | go/cmd/wasm-plugins/awx/launch_preflight.go:1000-1014 | go/cmd/wasm-plugins/awx/launch_preflight.go:1043-1057 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:136— elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:136-150 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:158-173 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:181-199 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:208-222 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) go/pkg/agent/netprobe/client.go:321— go/pkg/agent/netprobe/client.go:321-335 | go/pkg/agent/netprobe/client.go:338-352 | go/pkg/agent/netprobe/client.go:355-369 | go/pkg/agent/netprobe/client.go:372-386 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 1+ corresponding lines) · ×5
Edited copies of one member (4 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:556— elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:556-557 | elixir/serviceradar_core/lib/serviceradar/camera/archive_qualification_report.ex:87-88 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_binding_config.ex:46-47 | elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:128-128 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 1+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_delivery_grants.ex:161— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_delivery_grants.ex:161-161 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_recovery_control.ex:97-97 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_recovery_copy_grants.ex:106-106 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_operation.ex:160-160 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:40— elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:40-40 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_cache.ex:23-23 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_health.ex:25-25 | elixir/web-ng/lib/serviceradar_web_ng/topology/world_loader.ex:40-40 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/authorization_settings_controller.ex:113— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/authorization_settings_controller.ex:113-113 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/bmp_settings_controller.ex:125-125 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/role_profile_controller.ex:30-30 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/user_controller.ex:308-308 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:2163— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:2163-2163 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:1138-1138 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_host_keys_live.ex:514-514 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_recordings_live.ex:638-638 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 1+ corresponding lines) · ×5
Edited copies of one member (5 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2763— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2763-2764 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:1008-1009 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1714-1715 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:622-623 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_delivery_worker.ex:433-433 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 1+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:717— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/control_stream_session.ex:717-718 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:589-590 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ssh_ca_bundle_response.ex:510-511 | elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:553-553 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_broker.ex:287-288 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:144— elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:144-147 | elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:1939-1942 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2855-2858 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mail_live.ex:433-433 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/presentation.ex:277-281 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/capability_signing.ex:223— elixir/serviceradar_core/lib/serviceradar/edge/capability_signing.ex:223-223 | elixir/serviceradar_core/lib/serviceradar/edge/claims_framing.ex:205-205 | elixir/serviceradar_core/lib/serviceradar/edge/contract_registry_grammar.ex:166-166 | elixir/serviceradar_core/lib/serviceradar/edge/hash_grammar.ex:676-676 | elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:683-683 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/remote_access_central_credential_grants.ex:195— elixir/serviceradar_core/lib/serviceradar/edge/remote_access_central_credential_grants.ex:195-195 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_hop_attribution_backfill.ex:266-266 | elixir/serviceradar_core/lib/serviceradar/plugins/secret_refs.ex:767-767 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/layout_helpers.ex:64-64 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_components.ex:909-909 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:219` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:211— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:211-234 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:233-256 — 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 151 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) go/pkg/bumblebee/spool.go:73— go/pkg/bumblebee/spool.go:73-96 | go/pkg/endpointinventory/spool.go:156-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/bumblebee/spool.go:73` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (24 lines × 2) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:760— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:760-783 | elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl:217-240 — before extracting anything, compare `elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl` and `elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 171 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) rust/srql/src/query/downsample/filters.rs:36— rust/srql/src/query/downsample/filters.rs:36-59 | REDACTED:2346-2369 — before extracting anything, compare `rust/srql/src/query/downsample/filters.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/downsample/filters.rs:36` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:931` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:456` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–18 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:396— elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:396-412 | elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:439-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/components/settings_components.ex:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) go/pkg/bumblebee/config.go:62— go/pkg/bumblebee/config.go:62-79 | go/pkg/endpointinventory/config.go:108-124 — `go/pkg/bumblebee/config.go` and `go/pkg/endpointinventory/config.go` 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 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/bumblebee/config.go:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (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 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:525` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:494— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:494-508 | elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:519-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:494` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:941— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:941-954 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:971-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:941` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) REDACTED:50— REDACTED:50-63 | REDACTED:128-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) rust/srql/src/query/mtr_hops.rs:592— rust/srql/src/query/mtr_hops.rs:592-606 | rust/srql/src/query/mtr_traces.rs:1061-1074 — before extracting anything, compare `rust/srql/src/query/mtr_hops.rs` and `rust/srql/src/query/mtr_traces.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 238 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/mtr_hops.rs:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:82— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:82-90 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_verification.ex:344-351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_rollback.ex:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:234— elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:234-241 | elixir/serviceradar_core/lib/serviceradar/observability/service_state_registry/plugin_state.ex:303-311 — both copies are in the same file, so extract the 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–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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) rust/srql/src/query/starrocks/bmp_events.rs:166— rust/srql/src/query/starrocks/bmp_events.rs:166-173 | rust/srql/src/query/starrocks/otel_metrics.rs:414-422 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/starrocks/bmp_events.rs:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 5) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:161— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:161-167 | elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:824-830 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:713-719 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:221-227 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_ssh_certificate_policy.ex:211-217 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) rust/srql/src/query/camera_sources.rs:215— rust/srql/src/query/camera_sources.rs:215-221 | rust/srql/src/query/device_sweep_overlap.rs:173-179 | rust/srql/src/query/field_survey.rs:553-559 | rust/srql/src/query/public_endpoints.rs:154-160 | rust/srql/src/query/wifi_map.rs:553-559 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) rust/srql/src/query/otel_metric_points.rs:123— rust/srql/src/query/otel_metric_points.rs:123-129 | rust/srql/src/query/otel_metrics.rs:146-152 | rust/srql/src/query/services.rs:188-194 | rust/srql/src/query/services.rs:254-260 | rust/srql/src/query/traces.rs:393-399 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 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 × 5) rust/srql/src/query/events/rollup.rs:23— rust/srql/src/query/events/rollup.rs:23-31 | rust/srql/src/query/logs/stats.rs:26-32 | rust/srql/src/query/otel_metric_points.rs:355-361 | rust/srql/src/query/otel_metrics.rs:345-351 | rust/srql/src/query/traces.rs:184-190 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 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 × 5) tools/anomaly-proof/gen.py:112— tools/anomaly-proof/gen.py:112-118 | tools/anomaly-proof/gen.py:123-129 | tools/anomaly-proof/gen.py:136-145 | tools/anomaly-proof/gen.py:175-181 | tools/anomaly-proof/gen.py:206-212 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `tools/anomaly-proof/gen.py:205` calls `min` and `tools/anomaly-proof/gen.py:122` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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 9 separate duplicated blocks between them, totalling at least 110 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/camera/event_ingestor.ex:35— elixir/serviceradar_core/lib/serviceradar/camera/event_ingestor.ex:35-40 | elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:48-53 | elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:74-79 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:64-69 — 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 (6 lines × 4) elixir/serviceradar_core/lib/serviceradar/edge/sweep_body_validate.ex:503— elixir/serviceradar_core/lib/serviceradar/edge/sweep_body_validate.ex:503-508 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1268-1273 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/ubuntu_adapter.ex:441-446 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:7-12 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/edge/sweep_body_validate.ex:500` calls `proper_length`, `count_all` and `elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1265` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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:2122-2127 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8209-8214 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1969-1974 — `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 131 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) rust/bmp-collector/src/publisher.rs:496— rust/bmp-collector/src/publisher.rs:496-501 | rust/log-collector/src/main.rs:39-44 | rust/rperf-client/src/main.rs:97-102 | rust/trapd/src/main.rs:189-194 — 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 × 5) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:141— elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:141-152 | elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex:143-154 | elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:3257-3261 | elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:183-194 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:863-867 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 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:411-419 — 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 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 5) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3459— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:3459-3463 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:1003-1007 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:592-596 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:191-195 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:228-232 — 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 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:224` calls `nested_map_get` and `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:589` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 5) rust/srql/src/query/field_survey.rs:718— rust/srql/src/query/field_survey.rs:718-722 | rust/srql/src/query/gateways.rs:70-74 | rust/srql/src/query/interfaces/bind.rs:27-31 | rust/srql/src/query/virtualization.rs:690-694 | rust/srql/src/query/wifi_map.rs:774-778 — before extracting anything, compare `rust/srql/src/query/field_survey.rs` and `rust/srql/src/query/wifi_map.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/field_survey.rs:718` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 5) rust/srql/src/query/identity/decisions.rs:75— rust/srql/src/query/identity/decisions.rs:75-79 | rust/srql/src/query/identity/deduplication_tasks.rs:73-77 | rust/srql/src/query/identity/device_identifiers.rs:132-136 | rust/srql/src/query/identity/device_revival_audit.rs:75-79 | rust/srql/src/query/identity/reconciliation_runs.rs:79-83 — before extracting anything, compare `rust/srql/src/query/identity/decisions.rs` and `rust/srql/src/query/identity/deduplication_tasks.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/identity/decisions.rs:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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>.
Low contrast colour pair in CSS (3.7:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:1289— `.diagram-nav #btn-route-probe[aria-pressed="true"]` sets color: #059669 on background-color: #fffdf8 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.7:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:2799— `.guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index` sets color: #ffffff on background-color: #0891b2 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.7:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:1289— `.diagram-nav #btn-route-probe[aria-pressed="true"]` sets color: #059669 on background-color: #fffdf8 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.7:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:2799— `.guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index` sets color: #ffffff on background-color: #0891b2 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
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.
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.
god_view_nif::bitmap_index::validate_program (cyclomatic 16) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:860— god_view_nif::bitmap_index::validate_program 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.
Publisher::publish_pending (cyclomatic 31) rust/flow-collector/src/publisher.rs:732— Publisher::publish_pending 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.
Publisher::connect_once (cyclomatic 26) rust/flow-collector/src/publisher.rs:1002— Publisher::connect_once 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.
Publisher::run (cyclomatic 23) rust/flow-collector/src/publisher.rs:105— Publisher::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.
Publisher::drain_retries_until_empty (cyclomatic 21) rust/flow-collector/src/publisher.rs:520— 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.
serviceradar_flow_collector::main (cyclomatic 24) rust/flow-collector/src/main.rs:47— serviceradar_flow_collector::main has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
serviceradar_flow_collector::metrics::serve_one (cyclomatic 17) rust/flow-collector/src/metrics.rs:801— serviceradar_flow_collector::metrics::serve_one 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.
serviceradar_flow_collector::publisher::reconcile_existing_flows_stream (cyclomatic 17) rust/flow-collector/src/publisher.rs:2375— serviceradar_flow_collector::publisher::reconcile_existing_flows_stream 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_flow_collector::publisher::ensure_flows_stream (cyclomatic 17) rust/flow-collector/src/publisher.rs:2536— serviceradar_flow_collector::publisher::ensure_flows_stream 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.
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.
World::plan (cognitive 39) rust/topology-atlas/src/tiles.rs:379— World::plan has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 6 (12 pts), boolean chains 2 (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.
World::routing_grade (cognitive 24) rust/topology-atlas/src/tiles.rs:805— World::routing_grade has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
World::edges (cognitive 20) rust/topology-atlas/src/tiles.rs:517— World::edges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
World::new (cognitive 18) rust/topology-atlas/src/tiles.rs:211— World::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×4
Edited copy of a member (49 corresponding lines) rust/srql/src/query/devices/filters/identity.rs:16— rust/srql/src/query/devices/filters/identity.rs:16-64 | REDACTED:839-904 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (49 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:225— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:225-273 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:403-452 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (49 corresponding lines) go/pkg/agent/snmp/client.go:551— go/pkg/agent/snmp/client.go:551-599 | go/pkg/mapper/usm.go:26-78 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (49 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:211— elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:211-259 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:233-281 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×4
Edited copy of a member (44 corresponding lines) go/pkg/k8sinventory/publisher.go:242— go/pkg/k8sinventory/publisher.go:242-285 | go/pkg/trivysidecar/publisher.go:145-192 — These two members are one piece of code written twice and then edited apart: 44 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 (44 corresponding lines) go/pkg/natsutil/events.go:225— go/pkg/natsutil/events.go:225-268 | go/pkg/natsutil/events.go:325-370 — These two members are one piece of code written twice and then edited apart: 44 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 (44 corresponding lines) rust/fieldsurvey-sidekick/src/radio.rs:221— rust/fieldsurvey-sidekick/src/radio.rs:221-264 | rust/fieldsurvey-sidekick/src/wifi.rs:59-109 — These two members are one piece of code written twice and then edited apart: 44 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 (44 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:628— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:628-681 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:687-730 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×4
Edited copies of one member (3 members, 26+ corresponding lines) rust/srql/src/query/logs/stats_expr.rs:42— rust/srql/src/query/logs/stats_expr.rs:42-83 | rust/srql/src/query/trace_summaries.rs:637-662 | rust/srql/src/query/trace_summaries.rs:734-764 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) rust/otel/src/nats/chunker.rs:26— rust/otel/src/nats/chunker.rs:26-51 | rust/otel/src/nats/chunker.rs:96-121 | rust/otel/src/nats/chunker.rs:167-192 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:36— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_forwarder.ex:36-61 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_forwarder.ex:36-63 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/remote_capture_forwarder.ex:40-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:40— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/ansible_controller_controller.ex:40-69 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_rule_controller.ex:48-77 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/network_credential_secret_controller.ex:41-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×4
Edited copies of one member (3 members, 28+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:57— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:57-84 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:84-113 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:93-121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 28+ corresponding lines) REDACTED:100— REDACTED:100-130 | rust/srql/src/query/otel_metric_points.rs:497-524 | rust/srql/src/query/otel_metrics.rs:467-494 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 28+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/bmp_live/index.ex:46— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/bmp_live/index.ex:46-75 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/endpoint_inventory_live/index.ex:49-76 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:249-279 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 28+ corresponding lines) go/cmd/wasm-plugins/awx/main.go:2301— go/cmd/wasm-plugins/awx/main.go:2301-2337 | go/cmd/wasm-plugins/awx/main.go:2341-2368 | go/cmd/wasm-plugins/awx/main.go:3558-3585 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×4
Edited copies of one member (3 members, 20+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:896— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/ash_store.ex:896-919 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/cleanup_reconciler.ex:217-236 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/launch_contract.ex:99-122 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 20+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:37— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:37-64 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:35-54 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention.ex:22-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 20+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:85— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:85-104 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:126-145 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:217-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 20+ corresponding lines) go/pkg/mapper/mikrotik_poller.go:71— go/pkg/mapper/mikrotik_poller.go:71-90 | go/pkg/mapper/proxmox_poller.go:93-112 | go/pkg/mapper/ubnt_helpers.go:24-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×4
Edited copies of one member (5 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:79— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:79-99 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:110-122 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:131-143 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:151-163 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:194-206 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:136— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:136-158 | elixir/serviceradar_core/lib/serviceradar/identity/cli_auth_cleanup_worker.ex:102-114 | elixir/serviceradar_core/lib/serviceradar/identity/cli_auth_cleanup_worker.ex:127-139 | elixir/serviceradar_core/lib/serviceradar/identity/cli_auth_cleanup_worker.ex:152-169 | elixir/serviceradar_core/lib/serviceradar/identity/cli_auth_cleanup_worker.ex:173-185 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:336— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:336-352 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:420-432 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:487-500 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:525-537 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/show.ex:561-573 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/alert_evaluation_receipt.ex:99— elixir/serviceradar_core/lib/serviceradar/observability/alert_evaluation_receipt.ex:99-111 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_quarantine.ex:419-435 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/recovery_worker.ex:109-122 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/rollout.ex:175-187 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/runtime_metrics.ex:137-149 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×4
Edited copies of one member (3 members, 23+ corresponding lines) go/pkg/agent/push_loop_discovery_edge.go:242— go/pkg/agent/push_loop_discovery_edge.go:242-267 | go/pkg/agent/push_loop_plugin_results_edge.go:226-256 | go/pkg/agent/push_loop_workload_identity_edge.go:145-167 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) go/pkg/edge/edgerecord/domain.go:134— go/pkg/edge/edgerecord/domain.go:134-156 | go/pkg/edge/edgerecord/domain.go:1152-1174 | go/pkg/edge/edgerecord/domain.go:1179-1201 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:220— elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:220-243 | elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:341-363 | elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:367-396 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/device_cleanup_worker.ex:595— elixir/serviceradar_core/lib/serviceradar/inventory/device_cleanup_worker.ex:595-636 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_dups.ex:101-162 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/awx_proxmox_unmerge.ex:220-242 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×4
Edited copies of one member (4 members, 17+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_assignment_controller.ex:38— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_assignment_controller.ex:38-62 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_assignment_controller.ex:66-84 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_controller.ex:37-59 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_controller.ex:63-79 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 17+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:1250— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:1250-1271 | elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:1280-1301 | elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:1307-1329 | elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:1333-1349 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 17+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/schedule_evaluator_worker.ex:66— elixir/serviceradar_core/lib/serviceradar/automation/ansible/schedule_evaluator_worker.ex:66-82 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_schedule_worker.ex:43-59 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:54-77 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:50-68 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 17+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3771— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3771-3794 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3802-3818 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3874-3891 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:3899-3916 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×4
Edited copies of one member (4 members, 14+ corresponding lines) go/cmd/tools/ubuntu-feed-merge/projector.go:1667— go/cmd/tools/ubuntu-feed-merge/projector.go:1667-1681 | go/cmd/wasm-plugins/alienvault-otx/main.go:899-912 | go/pkg/agent/plugin_runtime_host_authority.go:1405-1422 | go/pkg/endpointinventory/hashes.go:619-639 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) rust/srql/src/query/logs/stats_expr.rs:106— rust/srql/src/query/logs/stats_expr.rs:106-119 | REDACTED:2516-2533 | REDACTED:2535-2555 | rust/srql/src/query/trace_summaries.rs:679-694 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) go/pkg/agent/plugin_runtime_grpc.go:701— go/pkg/agent/plugin_runtime_grpc.go:701-715 | go/pkg/agent/plugin_runtime_grpc.go:717-732 | go/pkg/agent/plugin_runtime_http.go:629-643 | go/pkg/agent/plugin_runtime_network.go:482-495 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) go/pkg/agent/plugin_runtime_media.go:222— go/pkg/agent/plugin_runtime_media.go:222-235 | go/pkg/agent/plugin_runtime_media.go:237-250 | go/pkg/agent/plugin_runtime_media.go:252-265 | go/pkg/agent/proxmox_console_plugin.go:734-752 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×4
Edited copies of one member (4 members, 13+ corresponding lines) rust/srql/src/query/addon_statuses.rs:27— rust/srql/src/query/addon_statuses.rs:27-39 | rust/srql/src/query/agents.rs:37-49 | rust/srql/src/query/endpoint_package_catalog.rs:37-52 | rust/srql/src/query/sweep_groups.rs:27-39 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:10— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:10-22 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:26-39 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:49-61 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/spatial_controller.ex:94-108 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/declarative/definition.ex:856— elixir/serviceradar_core/lib/serviceradar/notifications/declarative/definition.ex:856-877 | elixir/serviceradar_core/lib/serviceradar/notifications/declarative/definition.ex:1235-1258 | elixir/serviceradar_core/lib/serviceradar/notifications/declarative/definition.ex:1262-1274 | elixir/serviceradar_core/lib/serviceradar/notifications/declarative/definition.ex:1373-1395 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) go/cmd/tools/mapper-baseline/main.go:322— go/cmd/tools/mapper-baseline/main.go:322-334 | go/pkg/agent/snmp/config.go:319-331 | go/pkg/cli/cli.go:1090-1103 | go/pkg/sysmon/config.go:161-173 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 2+ corresponding lines) · ×4
Edited copies of one member (4 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_destination.ex:43— elixir/serviceradar_core/lib/serviceradar/camera/archive_destination.ex:43-44 | elixir/serviceradar_core/lib/serviceradar/camera/archive_qualification_report.ex:82-83 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_evidence.ex:145-146 | elixir/serviceradar_core/lib/serviceradar/camera/local_storage_qualification_document.ex:56-57 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:413— elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:413-414 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:1152-1153 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1510-1511 | elixir/serviceradar_core/lib/serviceradar/notifications/callback_worker.ex:198-199 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/flow_enrichment.ex:400— elixir/serviceradar_core/lib/serviceradar/event_writer/flow_enrichment.ex:400-401 | elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex:104-109 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_package_set.ex:622-627 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_package_identity.ex:213-214 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_corroboration.ex:113— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_corroboration.ex:113-114 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:848-849 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_coordinator.ex:1764-1765 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery/authority.ex:274-275 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 4+ corresponding lines) · ×4
Edited copies of one member (8 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:852— elixir/serviceradar_core/lib/serviceradar/notifications/transports/declarative.ex:852-855 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/generic_webhook.ex:521-524 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/stream.ex:537-540 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:328-331 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:144-147 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:119-122 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1137-1140 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/builder.ex:666-669 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
Edited copies of one member (8 members, 4+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/components/northbound_action_components.ex:566— elixir/web-ng/lib/serviceradar_web_ng_web/components/northbound_action_components.ex:566-569 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/availability_components.ex:460-463 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/healthcheck_components.ex:124-127 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/log_components.ex:200-203 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/mtr_components.ex:577-580 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:193-196 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:1081-1084 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/show/history_table.ex:191-194 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
Edited copies of one member (8 members, 4+ corresponding lines) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:316— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_branch_manager.ex:316-319 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_dispatch_manager.ex:309-312 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_adapter.ex:158-161 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_http_dispatch_worker.ex:536-542 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:272-275 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_manager.ex:183-186 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_sidecar_worker.ex:223-226 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/pipeline_manager.ex:212-215 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
Edited copies of one member (8 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_config_defaults.ex:94— elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_config_defaults.ex:94-97 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/serialize_enabled_assignment.ex:69-72 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/addon_package_approved.ex:63-66 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_addon_profile_target.ex:98-101 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_addon_assignment.ex:89-92 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_assignment.ex:134-137 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/package_approved.ex:56-59 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/single_enabled_addon_profile.ex:102-105 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 1+ corresponding lines) · ×4
Edited copies of one member (6 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:925— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:925-926 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:2366-2366 | elixir/serviceradar_core/lib/serviceradar/edge/direct_leaf_scope.ex:103-104 | elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_config_generator.ex:221-222 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_direct_leaf_access.ex:151-152 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_floorplan.ex:233-233 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_template_binding.ex:922— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_template_binding.ex:922-923 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:384-385 | elixir/serviceradar_core/lib/serviceradar/edge/pipeline_stats.ex:267-267 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_artifact.ex:1009-1010 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_eligibility.ex:147-148 | elixir/web-ng/lib/serviceradar_web_ng_web/components/edge_pipeline_components.ex:173-173 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/integration_catalog.ex:189— elixir/serviceradar_core/lib/serviceradar/plugins/integration_catalog.ex:189-189 | elixir/serviceradar_core/lib/serviceradar/plugins/latest_approved_plugin_package.ex:116-117 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/anomaly_capacity_data.ex:610-610 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/bumblebee_components.ex:178-178 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:848-848 | elixir/web-ng/lib/serviceradar_web_ng_web/live/security_live/index.ex:676-676 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/identity/guest_address.ex:230— elixir/serviceradar_core/lib/serviceradar/inventory/identity/guest_address.ex:230-230 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/host_interfaces.ex:151-151 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/decisions.ex:1064-1064 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_policy.ex:124-124 | elixir/serviceradar_core/lib/serviceradar/security/peer_certificate_policy.ex:367-367 | elixir/web-ng/lib/serviceradar_web_ng/devices/merged_availability.ex:134-134 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Duplicated block (34 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1069— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1069-1102 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:493-526 — 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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1069` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34 lines × 2) elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:558— elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:558-591 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_pass_worker.ex:233-266 — 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 (34 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-72 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex:283-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 (34 lines × 2) rust/srql/src/query/otel_metric_points.rs:442— rust/srql/src/query/otel_metric_points.rs:442-475 | rust/srql/src/query/otel_metrics.rs:416-449 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/otel_metric_points.rs:442` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26 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-1700 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1094-1119 — 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 163 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) rust/netprobe/src/fingerprint.rs:778— rust/netprobe/src/fingerprint.rs:778-803 | rust/netprobe/src/fingerprint.rs:879-904 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (26 lines × 2) rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:53— rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:53-78 | rust/rdp-adapter/src/connector_link_probe.rs:26-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:387— elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:387-403 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1301-1316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:387` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) go/cmd/wasm-plugins/awx/main.go:3532— go/cmd/wasm-plugins/awx/main.go:3532-3548 | go/cmd/wasm-plugins/awx/main.go:3559-3574 — both copies are in the same file, so extract the 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–17 lines × 2) go/pkg/agent/push_loop_plugins.go:81— go/pkg/agent/push_loop_plugins.go:81-97 | go/pkg/agent/push_loop_plugins.go:120-135 — both copies are in the same file, so extract the 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–17 lines × 2) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:360— swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:360-375 | swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:391-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:391` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:117— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:117-131 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:127-141 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:456-470 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/awx_cleanup.ex:117` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:161— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:161-175 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:195-209 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:229-243 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:539— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:539-553 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:579-593 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:607-622 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:539` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) REDACTED:150— REDACTED:150-164 | REDACTED:129-143 | REDACTED:129-143 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13–14 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-1054 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1549-1562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1042` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 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-112 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/mapper_persistence.ex:128-140 — both copies are in the same file, so extract the 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–14 lines × 2) go/pkg/agent/plugin_runtime_host_authority.go:1177— go/pkg/agent/plugin_runtime_host_authority.go:1177-1190 | go/pkg/agent/plugin_runtime_host_authority.go:2019-2031 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/plugin_runtime_host_authority.go:2019` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) go/pkg/mapper/discovery_topology_evidence.go:34— go/pkg/mapper/discovery_topology_evidence.go:34-46 | go/pkg/mapper/discovery_topology_evidence.go:70-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 (11 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-91 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:93-103 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:94-104 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:77-87 — 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 9 separate duplicated blocks between them, totalling at least 110 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 × 4) go/pkg/mtr/socket_darwin.go:277— go/pkg/mtr/socket_darwin.go:277-287 | go/pkg/mtr/socket_darwin.go:317-327 | go/pkg/mtr/socket_linux.go:342-352 | go/pkg/mtr/socket_linux.go:383-393 — before extracting anything, compare `go/pkg/mtr/socket_darwin.go` and `go/pkg/mtr/socket_linux.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mtr/socket_darwin.go:277` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) REDACTED:244— REDACTED:244-254 | REDACTED:256-266 | REDACTED:233-243 | REDACTED:245-255 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:244` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 4) rust/srql/src/query/logs/rollup.rs:95— rust/srql/src/query/logs/rollup.rs:95-105 | rust/srql/src/query/logs/stats_clauses.rs:24-34 | rust/srql/src/query/logs/stats_clauses.rs:79-89 | rust/srql/src/query/traces.rs:356-366 — before extracting anything, compare `rust/srql/src/query/logs/rollup.rs` and `rust/srql/src/query/logs/stats_clauses.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/rollup.rs:95` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/logs/rollup.rs:106` calls `enforce_list_limit` and `rust/srql/src/query/traces.rs:367` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:881— elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_reactivation.ex:881-887 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/source_retirement.ex:1001-1006 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:99— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:99-105 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/analysis_sink.ex:99` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:1381— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:1381-1386 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:1403-1409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) rust/srql/src/query/agents.rs:291— rust/srql/src/query/agents.rs:291-297 | rust/srql/src/time.rs:234-239 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 6) elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:1145— elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:1145-1150 | elixir/serviceradar_core/lib/serviceradar/edge/agent_release_artifact_policy.ex:57-62 | elixir/serviceradar_core/lib/serviceradar/edge/agent_release_manager.ex:1275-1280 | elixir/serviceradar_core/lib/serviceradar/edge/release_artifact_mirror.ex:587-592 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_metrics_ingestor.ex:554-559 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/mtr_runtime.ex:419-424 — 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 (6 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-259 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:182-187 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:157-162 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:796-801 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:171-176 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:291-296 — 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 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:179` calls `normalize_create_request` and `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:168` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 6) rust/srql/src/query/downsample/filters.rs:34— rust/srql/src/query/downsample/filters.rs:34-39 | rust/srql/src/query/logs/rollup.rs:93-98 | rust/srql/src/query/logs/stats_clauses.rs:22-27 | rust/srql/src/query/logs/stats_clauses.rs:77-82 | REDACTED:2344-2349 | rust/srql/src/query/traces.rs:354-359 — before extracting anything, compare `rust/srql/src/query/downsample/filters.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/downsample/filters.rs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) rust/srql/src/query/logs/filters.rs:123— rust/srql/src/query/logs/filters.rs:123-128 | rust/srql/src/query/logs/filters.rs:236-241 | rust/srql/src/query/logs/filters.rs:360-365 | rust/srql/src/query/traces.rs:498-503 | rust/srql/src/query/traces.rs:588-593 | rust/srql/src/query/traces.rs:628-633 — before extracting anything, compare `rust/srql/src/query/logs/filters.rs` and `rust/srql/src/query/traces.rs` as WHOLE FILES: this scan already matched 10 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/traces.rs:585` calls `Ok` and `rust/srql/src/query/logs/filters.rs:120` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 3) swift/FieldSurvey/FieldSurvey/Network/FieldSurveyRoomArtifactUploader.swift:31— swift/FieldSurvey/FieldSurvey/Network/FieldSurveyRoomArtifactUploader.swift:31-48 | swift/FieldSurvey/FieldSurvey/Network/FieldSurveyRoomArtifactUploader.swift:51-68 | swift/FieldSurvey/FieldSurvey/Network/FieldSurveyRoomArtifactUploader.swift:71-88 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Network/FieldSurveyRoomArtifactUploader.swift:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 3) rust/srql/src/query/advisory_coordinates.rs:74— rust/srql/src/query/advisory_coordinates.rs:74-91 | rust/srql/src/query/endpoint_vulnerability_matches.rs:93-110 | rust/srql/src/query/vulnerability_advisories.rs:72-89 — before extracting anything, compare `rust/srql/src/query/endpoint_vulnerability_matches.rs` and `rust/srql/src/query/vulnerability_advisories.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/advisory_coordinates.rs:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 3) rust/srql/src/query/composite_results.rs:76— rust/srql/src/query/composite_results.rs:76-93 | rust/srql/src/query/sweep_coverage.rs:38-55 | rust/srql/src/query/sweep_results.rs:35-52 — before extracting anything, compare `rust/srql/src/query/composite_results.rs` and `rust/srql/src/query/sweep_coverage.rs` as WHOLE FILES: this scan already matched 6 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 3) rust/srql/src/query/devices.rs:137— rust/srql/src/query/devices.rs:137-154 | rust/srql/src/query/events.rs:83-100 | rust/srql/src/query/services.rs:133-150 — before extracting anything, compare `rust/srql/src/query/devices.rs` and `rust/srql/src/query/events.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices.rs:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Config::validate (cyclomatic 48) rust/flow-collector/src/config.rs:566— Config::validate has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent 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 17) rust/trapd/src/config.rs:115— Config::validate 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.
Config::validate (cyclomatic 16) rust/bmp-collector/src/config.rs:108— Config::validate 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_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.
Index::publish_complete (cognitive 56) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:462— Index::publish_complete has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 5 (10 pts), loops 5 (8 pts), boolean chains 7 (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.
Index::query (cognitive 23) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:749— Index::query has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 2 (4 pts), boolean chains 3 (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.
Index::begin_publish (cognitive 22) elixir/web-ng/native/god_view_nif/src/bitmap_staging.rs:115— Index::begin_publish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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_topology_atlas::layout::forest (cognitive 39) rust/topology-atlas/src/layout.rs:199— serviceradar_topology_atlas::layout::forest has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 7 (17 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.
serviceradar_topology_atlas::elk_hierarchy::compose (cognitive 37) rust/topology-atlas/src/elk_hierarchy.rs:31— serviceradar_topology_atlas::elk_hierarchy::compose has cognitive complexity 37 (threshold 15). Drivers by points: loops 10 (19 pts), if/else 9 (18 pts) (nesting depth added 18). 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_topology_atlas::spatial::clip (cognitive 26) rust/topology-atlas/src/spatial.rs:303— serviceradar_topology_atlas::spatial::clip has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, 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.
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.
otel::nats::publish::log_chunk_device_ids (cognitive 21) rust/otel/src/nats/publish.rs:45— otel::nats::publish::log_chunk_device_ids has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (10 pts), loops 4 (10 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.
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.
otel::http_server::handle_otlp (cognitive 17) rust/otel/src/http_server.rs:410— otel::http_server::handle_otlp has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 10 (17 pts) (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.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (8 members, 50+ identical tokens) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:17— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:17-35 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:39-52 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:73-89 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_analysis_worker_controller.ex:101-116 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_session_controller.ex:138-156 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_stream_controller.ex:15-67 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:102-124 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:393-439 — 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.
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-449 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:606-614 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:205-213 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:299-307 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:173-179 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:33-41 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:1504-1510 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:165-173 — 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.
Members sharing a duplicated core (8 members, 50+ identical tokens) REDACTED:861— REDACTED:861-877 | go/pkg/agent/adhoc_scan.go:426-441 | go/pkg/agent/mtr_bulk.go:488-508 | REDACTED:727-744 | REDACTED:446-465 | REDACTED:386-417 | go/pkg/mapper/discovery_schedule.go:227-247 | go/pkg/remoteaccess/sshca/sshca.go:256-271 — 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· Edited copy of a member (65 corresponding lines) · ×3
Edited copy of a member (65 corresponding lines) rust/srql/src/query/mtr_hops.rs:576— rust/srql/src/query/mtr_hops.rs:576-644 | rust/srql/src/query/mtr_traces.rs:1045-1109 — These two members are one piece of code written twice and then edited apart: 65 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 (65 corresponding lines) rust/otel/src/nats/publish.rs:158— rust/otel/src/nats/publish.rs:158-222 | rust/otel/src/nats/publish.rs:231-301 — These two members are one piece of code written twice and then edited apart: 65 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 (65 corresponding lines) go/pkg/scan/icmp_scanner_unix.go:242— go/pkg/scan/icmp_scanner_unix.go:242-309 | go/pkg/scan/icmp_scanner_windows.go:150-214 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×3
Edited copy of a member (55 corresponding lines) rust/srql/src/query/mtr_traces.rs:349— rust/srql/src/query/mtr_traces.rs:349-403 | rust/srql/src/query/mtr_traces.rs:408-462 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (55 corresponding lines) elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:70— elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:70-145 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention.ex:47-101 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (55 corresponding lines) 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-108 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:157-228 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×3
Edited copy of a member (53 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:288— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/falco_events.ex:288-340 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:468-535 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (53 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9686— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9686-9738 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:10144-10205 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (53 corresponding lines) REDACTED:287— REDACTED:287-339 | REDACTED:247-306 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (48 corresponding lines) · ×3
Edited copy of a member (48 corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:102— elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:102-155 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:206-253 — These two members are one piece of code written twice and then edited apart: 48 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 (48 corresponding lines) go/pkg/edgeonboarding/mtls/token.go:66— go/pkg/edgeonboarding/mtls/token.go:66-114 | go/pkg/edgeonboarding/token.go:75-122 — These two members are one piece of code written twice and then edited apart: 48 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 (48 corresponding lines) go/cmd/wasm-plugins/awx/launch_preflight.go:1234— go/cmd/wasm-plugins/awx/launch_preflight.go:1234-1281 | go/pkg/agent/plugin_runtime_host_authority.go:869-917 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×3
Edited copy of a member (42 corresponding lines) rust/srql/src/query/field_survey.rs:109— rust/srql/src/query/field_survey.rs:109-150 | rust/srql/src/query/wifi_map.rs:105-147 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) go/pkg/addon/grpc.go:174— go/pkg/addon/grpc.go:174-218 | go/pkg/addon/grpc.go:224-265 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:856— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:856-897 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:903-951 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×3
Edited copies of one member (3 members, 21+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:307— elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:307-331 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:415-435 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:677-701 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) 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-191 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:202-227 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/remote_desktop/webrtc_signaling_manager.ex:231-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:415— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:415-441 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:407-427 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:312-332 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 32+ corresponding lines) · ×3
Edited copies of one member (3 members, 32+ corresponding lines) go/pkg/bumblebee/spool.go:65— go/pkg/bumblebee/spool.go:65-96 | REDACTED:611-644 | go/pkg/endpointinventory/spool.go:145-179 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 32+ corresponding lines) go/pkg/edge/edgerecord/flow_attribution.go:48— go/pkg/edge/edgerecord/flow_attribution.go:48-89 | go/pkg/edge/edgerecord/otlp_relay.go:44-85 | go/pkg/edge/edgerecord/telemetry_batch.go:143-174 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 32+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:528— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:528-559 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:512-543 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:412-443 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×3
Edited copies of one member (3 members, 22+ corresponding lines) go/cmd/wasm-plugins/axis/signal_schema.go:29— go/cmd/wasm-plugins/axis/signal_schema.go:29-50 | go/cmd/wasm-plugins/proxmox/signal_schema.go:29-50 | go/cmd/wasm-plugins/unifi-protect/signal_schema.go:29-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:94— elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:94-115 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:119-143 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:147-172 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) rust/srql/src/query/devices/filters.rs:413— rust/srql/src/query/devices/filters.rs:413-437 | rust/srql/src/query/devices/stats/filters.rs:186-207 | rust/srql/src/query/endpoint_packages.rs:621-647 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×3
Edited copies of one member (4 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:655— elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:655-666 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:1057-1070 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/definition.ex:134-152 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/report_index.ex:93-112 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) rust/srql/src/query/bmp_events.rs:254— rust/srql/src/query/bmp_events.rs:254-267 | rust/srql/src/query/sweep_coverage.rs:203-214 | rust/srql/src/query/sweep_executions.rs:163-174 | rust/srql/src/query/sweep_results.rs:208-221 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/dgraph/canonical_rebuild.ex:72— elixir/serviceradar_core/lib/serviceradar/dgraph/canonical_rebuild.ex:72-83 | elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_facts.ex:134-165 | elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_metadata.ex:64-87 | elixir/serviceradar_core/lib/serviceradar/inventory/changes/remove_device_facts.ex:105-129 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 11+ corresponding lines) · ×3
Edited copies of one member (5 members, 11+ corresponding lines) REDACTED:390— REDACTED:390-400 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:659-671 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:199-211 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher/ash_adapter.ex:48-59 | elixir/serviceradar_core/lib/serviceradar/inventory/availability_source_profile_materializer.ex:59-69 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 11+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:123— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:123-134 | elixir/serviceradar_core/lib/serviceradar/edge/contract_registry.ex:598-608 | elixir/serviceradar_core/lib/serviceradar/flow_attribution/observations.ex:122-132 | elixir/serviceradar_core/lib/serviceradar/plugins/policy_owned_assignment_recovery/lease.ex:186-196 | elixir/web-ng/lib/serviceradar_web_ng_web/channels/dashboard_frame_channel/actions.ex:187-197 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:144— elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:144-154 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_operation.ex:100-110 | elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:482-492 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_delivery.ex:578-588 | elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_expression.ex:51-61 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×3
Edited copies of one member (4 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:381— elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:381-392 | elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:407-413 | elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:428-438 | elixir/serviceradar_core/lib/serviceradar/edge/publish_window.ex:700-718 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:345— elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:345-351 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:355-361 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:365-371 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_review.ex:375-381 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:2080— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:2080-2086 | elixir/web-ng/lib/serviceradar_web_ng/topology/god_view_stream.ex:6287-6295 | elixir/web-ng/lib/serviceradar_web_ng_web/components/plugin_results.ex:336-342 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7342-7350 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×3
Edited copies of one member (5 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:52— elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:52-60 | elixir/web-ng/lib/serviceradar_web_ng/ansible_controllers.ex:66-76 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:61-69 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:168-176 | elixir/web-ng/lib/serviceradar_web_ng/network_credentials.ex:182-191 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_assignment_controller.ex:25— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_assignment_controller.ex:25-34 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_assignment_controller.ex:88-96 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_controller.ex:24-33 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:33-42 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:269-277 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 9+ corresponding lines) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:72— go/cmd/wasm-plugins/proxmox/inventory_fetch.go:72-80 | go/cmd/wasm-plugins/proxmox/inventory_fetch.go:394-402 | go/cmd/wasm-plugins/proxmox/inventory_fetch.go:404-412 | go/cmd/wasm-plugins/proxmox/inventory_fetch.go:414-422 | go/cmd/wasm-plugins/proxmox/inventory_fetch.go:424-432 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Duplicated block (41 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:200— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:200-240 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:292-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (41 lines × 2) REDACTED:32— REDACTED:32-72 | go/pkg/scan/syn_scanner_stub.go:94-134 — 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 (41 lines × 2) rust/srql/src/query/otel_metric_points.rs:602— rust/srql/src/query/otel_metric_points.rs:602-642 | rust/srql/src/query/otel_metrics.rs:542-582 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (27 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/released_seed_shells.ex:227— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/released_seed_shells.ex:227-253 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_id_retire.ex:365-391 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/source_succession_merge.ex:188-214 — 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 (27 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-68 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex:73-99 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex:104-130 — 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 (27 lines × 3) REDACTED:256— REDACTED:256-282 | REDACTED:233-259 | REDACTED:245-271 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:256` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:364` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 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-82 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:116-132 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:145-161 — 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/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-429 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:271-287 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:137-153 — 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 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. 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–17 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/field_survey_stream_controller.ex:116— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/field_survey_stream_controller.ex:116-132 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/field_survey_stream_controller.ex:177-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 (15–17 lines × 2) rust/srql/src/query/devices/filters/params.rs:201— rust/srql/src/query/devices/filters/params.rs:201-217 | rust/srql/src/query/endpoint_packages.rs:716-730 — before extracting anything, compare `rust/srql/src/query/devices/filters/params.rs` and `rust/srql/src/query/endpoint_packages.rs` 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. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–17 lines × 2) rust/srql/src/query/mtr_hops.rs:620— rust/srql/src/query/mtr_hops.rs:620-636 | rust/srql/src/query/mtr_traces.rs:1087-1101 — before extracting anything, compare `rust/srql/src/query/mtr_hops.rs` and `rust/srql/src/query/mtr_traces.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 238 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/mtr_hops.rs:620` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 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-206 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:212-224 — 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 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) go/pkg/lifecycle/logger.go:57— go/pkg/lifecycle/logger.go:57-69 | go/pkg/logger/logger.go:72-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/lifecycle/logger.go:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) go/pkg/scan/icmp_scanner_unix.go:551— go/pkg/scan/icmp_scanner_unix.go:551-563 | go/pkg/scan/icmp_scanner_windows.go:355-369 — before extracting anything, compare `go/pkg/scan/icmp_scanner_unix.go` and `go/pkg/scan/icmp_scanner_windows.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
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:293-305 | 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:144-156 — 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 (13 lines × 4) REDACTED:311— REDACTED:311-323 | REDACTED:334-346 | REDACTED:361-373 | rust/srql/src/query/threat_intel_matches.rs:338-350 — before extracting anything, compare `REDACTED` and `rust/srql/src/query/threat_intel_matches.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 × 4) REDACTED:249— REDACTED:249-261 | REDACTED:226-238 | REDACTED:238-250 | rust/srql/src/query/threat_intel_matches.rs:309-321 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:249` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2297— elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2297-2308 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/panel_params.ex:8-19 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mail_live.ex:368-379 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/remote_access_desktop_targets_live.ex:982-993 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/admin/addon_package_live/index.ex:2297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) go/pkg/agent/desktop_media_sender.go:437— go/pkg/agent/desktop_media_sender.go:437-448 | go/pkg/agent/desktop_rdp_helper_adapter.go:300-311 | REDACTED:507-518 | go/pkg/agent/remoteaccess/desktop_adapter_probe.go:210-221 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/desktop_media_sender.go:437` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) go/pkg/agent/adhoc_scan.go:102— go/pkg/agent/adhoc_scan.go:102-113 | go/pkg/agent/control_stream.go:1963-1974 | go/pkg/agent/control_stream.go:1987-1998 | go/pkg/agent/endpoint_inventory_commands.go:220-231 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:356— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:356-365 | elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:377-388 — both copies are in the same file, so extract the 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:306— elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:306-317 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:339-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_data.ex:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data/overlays.ex:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 6) 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:1698-1705 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_event_writer.ex:73-80 | elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex:84-91 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_sync_worker.ex:456-463 — 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 (8 lines × 6) rust/srql/src/query/camera_sources.rs:126— rust/srql/src/query/camera_sources.rs:126-134 | rust/srql/src/query/identity/decisions.rs:83-91 | rust/srql/src/query/identity/deduplication_tasks.rs:81-89 | rust/srql/src/query/identity/device_revival_audit.rs:83-91 | rust/srql/src/query/identity/reconciliation_runs.rs:87-95 | rust/srql/src/query/security_events.rs:51-58 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/identity/decisions.rs` as WHOLE FILES: this scan already matched 5 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/identity/decisions.rs:93` calls `order_by` and `rust/srql/src/query/camera_sources.rs:135` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 6) rust/srql/src/query/camera_sources.rs:229— rust/srql/src/query/camera_sources.rs:229-236 | rust/srql/src/query/device_sweep_overlap.rs:200-207 | rust/srql/src/query/field_survey.rs:580-587 | rust/srql/src/query/public_endpoints.rs:168-175 | rust/srql/src/query/threat_intel_matches.rs:323-330 | rust/srql/src/query/wifi_map.rs:580-587 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 5) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:353— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:353-360 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:313-320 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1257-1264 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:212-219 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex:330-337 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) REDACTED:83— REDACTED:83-90 | rust/srql/src/query/endpoint_inventory_scans.rs:208-215 | rust/srql/src/query/endpoint_packages.rs:657-664 | rust/srql/src/query/mtr_traces.rs:297-304 | rust/srql/src/query/threat_intel_matches.rs:373-380 — before extracting anything, compare `REDACTED` and `rust/srql/src/query/threat_intel_matches.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 5) REDACTED:96— REDACTED:96-103 | rust/srql/src/query/devices/stats/spec.rs:13-20 | rust/srql/src/query/services.rs:206-213 | REDACTED:75-82 | REDACTED:75-82 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2824— elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2824-2830 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2910-2917 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2824` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7–8 lines × 2) elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:552— elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:552-558 | elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:566-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/native/god_view_nif/src/core/arrow_serde.rs:552` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) elixir/web-ng/native/god_view_nif/src/core/causality.rs:175— elixir/web-ng/native/god_view_nif/src/core/causality.rs:175-182 | rust/correlation-engine/src/god_view.rs:159-165 — before extracting anything, compare `elixir/web-ng/native/god_view_nif/src/core/causality.rs` and `rust/correlation-engine/src/god_view.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/native/god_view_nif/src/core/causality.rs:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 7) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:112— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:112-124 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:69-81 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:155-167 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_worker.ex:67-79 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_legacy_assignment_recovery_worker.ex:73-85 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_dispatch_worker.ex:83-95 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:88-100 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 7) REDACTED:864— REDACTED:864-877 | go/pkg/agent/adhoc_scan.go:429-441 | go/pkg/agent/mtr_bulk.go:495-508 | REDACTED:731-744 | REDACTED:453-465 | go/pkg/mapper/discovery_schedule.go:234-247 | go/pkg/remoteaccess/sshca/sshca.go:259-271 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:864` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:727` calls `normalizeReleaseCapabilities` and `go/pkg/agent/mtr_bulk.go:491` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 7) rust/srql/src/query/events/filters.rs:324— rust/srql/src/query/events/filters.rs:324-336 | rust/srql/src/query/events/filters.rs:390-402 | rust/srql/src/query/events/filters.rs:512-524 | rust/srql/src/query/events/filters.rs:603-615 | rust/srql/src/query/events/filters.rs:659-671 | rust/srql/src/query/events/filters.rs:807-819 | rust/srql/src/query/logs/metadata.rs:60-72 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/events/filters.rs:324` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) go/pkg/bumblebee/config.go:58— go/pkg/bumblebee/config.go:58-72 | go/pkg/endpointinventory/config.go:104-117 | go/pkg/scalibrinventory/config.go:37-50 — `go/pkg/bumblebee/config.go` and `go/pkg/endpointinventory/config.go` 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 50 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 × 3) swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:835— swift/FieldSurvey/FieldSurvey/Network/SidekickRelay.swift:835-848 | swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:890-904 | swift/FieldSurvey/FieldSurvey/Views/SignalMapView.swift:461-474 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:890` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) rust/srql/src/query/events/filters.rs:319— rust/srql/src/query/events/filters.rs:319-333 | rust/srql/src/query/events/filters.rs:508-521 | rust/srql/src/query/events/filters.rs:654-668 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/events/filters.rs:319` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) go/pkg/agent/netprobe/client.go:389— go/pkg/agent/netprobe/client.go:389-397 | go/pkg/agent/netprobe/client.go:399-407 | go/pkg/agent/netprobe/client.go:409-417 | go/pkg/agent/netprobe/client.go:419-427 | go/pkg/agent/netprobe/sidecar.go:199-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `go/pkg/agent/netprobe/sidecar.go:195` calls `Healthy`, `Load` and `go/pkg/agent/netprobe/client.go:385` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 5) rust/srql/src/query/camera_sources.rs:228— rust/srql/src/query/camera_sources.rs:228-236 | rust/srql/src/query/device_sweep_overlap.rs:190-198 | rust/srql/src/query/field_survey.rs:570-578 | rust/srql/src/query/public_endpoints.rs:167-175 | rust/srql/src/query/wifi_map.rs:570-578 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 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) integration_tests/srql_parity/src/fixture/logs.rs:131— integration_tests/srql_parity/src/fixture/logs.rs:131-139 | integration_tests/srql_parity/src/fixture/mtr.rs:153-161 | integration_tests/srql_parity/src/fixture/mtr.rs:193-201 | integration_tests/srql_parity/src/fixture/traces.rs:174-182 | integration_tests/srql_parity/src/fixture/traces.rs:213-221 — before extracting anything, compare `integration_tests/srql_parity/src/fixture/logs.rs` and `integration_tests/srql_parity/src/fixture/mtr.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `integration_tests/srql_parity/src/fixture/logs.rs:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `rows` to `&[LogRow]` in one and `&[TraceRow]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9–10 lines × 4) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:93— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:93-102 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:125-133 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:157-166 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:187-196 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:153` calls `failure`, `invalid`, `nextBuffer` and `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:92` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 4) REDACTED:45— REDACTED:45-54 | rust/srql/src/query/otel_metric_points.rs:45-53 | rust/srql/src/query/otel_metrics.rs:41-49 | rust/srql/src/query/traces.rs:46-54 — before extracting anything, compare `REDACTED` and `rust/srql/src/query/otel_metric_points.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:56` calls `as_select` and `rust/srql/src/query/otel_metric_points.rs:55` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 4) REDACTED:297— REDACTED:297-306 | REDACTED:320-329 | REDACTED:634-643 | REDACTED:1161-1169 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:297` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×3
JavaScript dependencies are not locked js/cli/templates/react-blank/package.json:11— js/cli/templates/react-blank/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
JavaScript dependencies are not locked js/cli/templates/react-map/package.json:11— js/cli/templates/react-map/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
JavaScript dependencies are not locked js/cli/templates/react-table/package.json:11— js/cli/templates/react-table/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / REDACTED beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Low contrast colour pair in CSS (3.8:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:784— `html[data-preset="editorial"] .diagram-container::after` sets color: #059669 on background-color: #ffffff — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:784— `html[data-preset="editorial"] .diagram-container::after` sets color: #059669 on background-color: #ffffff — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.1:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:1048— `.diagram-nav #btn-diagram-guide[aria-expanded="true"]` sets color: #d97706 on background-color: #fffdf8 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.1:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:1048— `.diagram-nav #btn-diagram-guide[aria-expanded="true"]` sets color: #d97706 on background-color: #fffdf8 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.6:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/change-impact.sequence.html:1267— `.diagram-nav #btn-overview-map[aria-expanded="true"]` sets color: #0891b2 on background-color: #fffdf8 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.6:1) openspec/changes/replace-age-topology-with-dgraph/diagrams/config-to-reason.dataflow.html:1267— `.diagram-nav #btn-overview-map[aria-expanded="true"]` sets color: #0891b2 on background-color: #fffdf8 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Converter::convert_ipfix (cyclomatic 81) rust/flow-collector/src/netflow/converter.rs:875— Converter::convert_ipfix has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent 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 48) rust/flow-collector/src/netflow/converter.rs:707— Converter::convert_v9 has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index::publish_complete (cyclomatic 42) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:462— Index::publish_complete has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index::query (cyclomatic 17) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:749— Index::query 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.
_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.
_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, a function literal at line 214, a function literal at line 166, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
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.
serviceradar_topology_atlas::spatial::clip (cyclomatic 19) rust/topology-atlas/src/spatial.rs:303— serviceradar_topology_atlas::spatial::clip 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_topology_atlas::elk_hierarchy::compose (cyclomatic 18) rust/topology-atlas/src/elk_hierarchy.rs:31— serviceradar_topology_atlas::elk_hierarchy::compose has cyclomatic complexity 18 (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.
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 154) rust/flow-collector/src/netflow/converter.rs:875— Converter::convert_ipfix has cognitive complexity 154 (threshold 15). Drivers by points: if/else 22 (131 pts), loops 5 (15 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 124). To reduce it, split the body into named stages: move each independent 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 81) rust/flow-collector/src/netflow/converter.rs:707— Converter::convert_v9 has cognitive complexity 81 (threshold 15). Drivers by points: if/else 10 (59 pts), loops 5 (15 pts), match/switch 2 (7 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent 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 68) rust/flow-collector/src/config.rs:566— Config::validate has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (50 pts), boolean chains 11, 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.
Config::validate (cognitive 23) rust/trapd/src/config.rs:115— Config::validate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 2 (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.
serviceradar_config_validator::evaluate (cognitive 47) config/manager_validator/rust/src/lib.rs:175— 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 20) rust/otel-addon/src/addon.rs:581— OtelCollectorAddon::relay_otlp has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 2 (7 pts), loops 3 (5 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.
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:263— 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.
dgraph_topology::reads::peer_ports (cognitive 25) rust/dgraph-topology/src/reads.rs:262— dgraph_topology::reads::peer_ports has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 6 (11 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.
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.
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.
(anonymous) (cognitive 16) elixir/web-ng/assets/god_view_world_gpu.playwright.js:353— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 6, loops 1 (nesting depth added 4). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 17 function items inside it that branch (a function literal at line 360, a function literal at line 387, a function literal at line 356, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cognitive 16) REDACTED:35— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 2 (3 pts) (nesting depth added 1). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 41, 54, 71). 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.
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/composite_checks/verdict_event_writer.ex:57— elixir/serviceradar_core/lib/serviceradar/composite_checks/verdict_event_writer.ex:57-85 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_event_writer.ex:265-296 | elixir/serviceradar_core/lib/serviceradar/events/health_writer.ex:31-59 | elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex:36-64 | elixir/serviceradar_core/lib/serviceradar/infrastructure/event_publisher.ex:240-276 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:1671-1716 | elixir/serviceradar_core/lib/serviceradar/inventory/bumblebee_catalog_refresh_event_writer.ex:66-99 | elixir/serviceradar_core/lib/serviceradar/observability/oban_failure_event_reporter.ex:109-154 | elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex:64-102 | elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_sync_worker.ex:451-474 — 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-382 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:479-497 | elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:527-545 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:197-205 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1214-1222 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1131-1139 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1148-1156 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1229-1237 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1441-1449 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:2113-2121 — 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.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (9 members, 50+ identical tokens) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:350— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:350-360 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_response_policy.ex:117-127 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:136-146 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:310-320 | elixir/serviceradar_core/lib/serviceradar/edge/sweep_projection.ex:105-115 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1254-1264 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:209-219 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:30-40 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex:327-337 — 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.
Members sharing a duplicated core (9 members, 50+ identical tokens) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:99— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:99-108 | 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/plugins/addon_profile_reconcile_worker.ex:40-49 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_worker.ex:54-63 | 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 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· Edited copy of a member (80 corresponding lines) · ×2
Edited copy of a member (80 corresponding lines) swift/FieldSurvey/FieldSurvey/Network/ArrowStreamer.swift:11— swift/FieldSurvey/FieldSurvey/Network/ArrowStreamer.swift:11-95 | swift/FieldSurvey/FieldSurvey/Network/PoseArrowEncoder.swift:21-100 — These two members are one piece of code written twice and then edited apart: 80 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 (80 corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:239— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:239-318 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ProtoUtil.swift:20-103 — These two members are one piece of code written twice and then edited apart: 80 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 (70 corresponding lines) · ×2
Edited copy of a member (70 corresponding lines) rust/srql/src/query/devices/order.rs:67— rust/srql/src/query/devices/order.rs:67-136 | rust/srql/src/query/devices/order.rs:141-210 — These two members are one piece of code written twice and then edited apart: 70 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 (70 corresponding lines) rust/anomaly-addon/src/shed.rs:57— rust/anomaly-addon/src/shed.rs:57-126 | rust/anomaly-addon/src/shed.rs:135-225 — These two members are one piece of code written twice and then edited apart: 70 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 (61 corresponding lines) · ×2
Edited copy of a member (61 corresponding lines) rust/srql/src/query/sweep_results.rs:257— rust/srql/src/query/sweep_results.rs:257-317 | rust/srql/src/query/sweep_results.rs:323-383 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (61 corresponding lines) REDACTED:331— REDACTED:331-397 | REDACTED:648-708 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×2
Edited copy of a member (58 corresponding lines) go/pkg/mapper/ubnt_topology.go:149— go/pkg/mapper/ubnt_topology.go:149-206 | go/pkg/mapper/ubnt_topology.go:226-300 — These two members are one piece of code written twice and then edited apart: 58 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 (58 corresponding lines) go/pkg/cli/edge_onboarding.go:609— go/pkg/cli/edge_onboarding.go:609-668 | go/pkg/cli/nats_bootstrap.go:181-238 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×2
Edited copy of a member (46 corresponding lines) go/pkg/agent/control_stream.go:1496— go/pkg/agent/control_stream.go:1496-1541 | go/pkg/agent/control_stream.go:1574-1630 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:19— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:19-70 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_target_intent_controller.ex:85-130 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×2
Edited copy of a member (50 corresponding lines) rust/srql/src/query/interfaces/filters.rs:91— rust/srql/src/query/interfaces/filters.rs:91-146 | rust/srql/src/query/trace_summaries.rs:305-354 — These two members are one piece of code written twice and then edited apart: 50 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 (50 corresponding lines) go/pkg/k8sinventory/publisher.go:142— go/pkg/k8sinventory/publisher.go:142-195 | go/pkg/trivysidecar/publisher.go:43-92 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×2
Edited copy of a member (56 corresponding lines) rust/netprobe/src/census.rs:580— rust/netprobe/src/census.rs:580-635 | rust/netprobe/src/mdns.rs:1967-2023 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (56 corresponding lines) go/pkg/mtr/hop.go:170— go/pkg/mtr/hop.go:170-227 | go/pkg/mtr/hop.go:231-286 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×2
Edited copy of a member (45 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1056— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1056-1102 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:482-526 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) integration_tests/srql_parity/src/fixture/otel.rs:162— integration_tests/srql_parity/src/fixture/otel.rs:162-206 | integration_tests/srql_parity/src/fixture/otel.rs:208-252 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) go/pkg/mtr/socket_darwin.go:201— go/pkg/mtr/socket_darwin.go:201-243 | go/pkg/mtr/socket_linux.go:263-306 — These two members are one piece of code written twice and then edited apart: 43 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 (43 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:237— elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:237-281 | elixir/web-ng/lib/serviceradar_web_ng_web/stats.ex:643-685 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×2
Edited copies of one member (3 members, 34+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:116— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:116-156 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:165-198 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_server.ex:209-250 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 34+ corresponding lines) rust/otel/src/nats/chunker.rs:56— rust/otel/src/nats/chunker.rs:56-89 | rust/otel/src/nats/chunker.rs:126-159 | rust/otel/src/nats/chunker.rs:197-234 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 31+ corresponding lines) · ×2
Edited copies of one member (3 members, 31+ corresponding lines) rust/otel/src/agent_forward/mod.rs:257— rust/otel/src/agent_forward/mod.rs:257-293 | rust/otel/src/agent_forward/mod.rs:301-331 | rust/otel/src/agent_forward/mod.rs:339-369 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 31+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:91— elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:91-121 | elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:173-203 | elixir/serviceradar_core/lib/serviceradar/nats/account_client.ex:264-296 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×2
Edited copies of one member (3 members, 24+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:48— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:48-71 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:22-45 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/visibility_profiles_live/index.ex:24-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 24+ corresponding lines) REDACTED:781— REDACTED:781-804 | go/pkg/hashutil/hash.go:20-45 | tools/go/derive_agent_release_public_key/main.go:64-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 21+ corresponding lines) · ×2
Edited copies of one member (4 members, 21+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:62— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:62-82 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:86-106 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:110-132 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_desktop_target_controller.ex:140-161 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 21+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:605— elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:605-625 | elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:629-649 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:235-256 | elixir/web-ng/lib/serviceradar_web_ng_web/live/dashboard_package_live/show.ex:260-281 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 20+ corresponding lines) · ×2
Edited copies of one member (5 members, 20+ corresponding lines) go/pkg/cli/cli.go:433— go/pkg/cli/cli.go:433-456 | go/pkg/cli/cli.go:462-481 | go/pkg/cli/cli.go:713-736 | go/pkg/cli/nats_bootstrap.go:124-143 | go/pkg/cli/nats_bootstrap.go:1116-1135 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 20+ corresponding lines) rust/srql/src/query/dashboards.rs:274— rust/srql/src/query/dashboards.rs:274-298 | rust/srql/src/query/field_survey.rs:670-689 | REDACTED:558-577 | REDACTED:728-747 | rust/srql/src/query/wifi_map.rs:726-745 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×2
Edited copies of one member (3 members, 27+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:203— elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:203-235 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:259-285 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_refresh_worker.ex:373-400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 27+ corresponding lines) go/pkg/addon/grpc.go:392— go/pkg/addon/grpc.go:392-419 | go/pkg/addon/grpc.go:421-448 | go/pkg/agent/kv.go:86-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 18+ corresponding lines) · ×2
Edited copies of one member (5 members, 18+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:836— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:836-853 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_contract.ex:886-903 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:210-227 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:350-367 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_child_launcher.ex:298-315 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 18+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:201— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:201-218 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/netflow_live/index.ex:222-239 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/forms.ex:14-31 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/profiles.ex:83-103 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:196-215 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×2
Edited copies of one member (4 members, 20+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/profiles.ex:59— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/profiles.ex:59-79 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/profiles.ex:111-133 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/events/profiles.ex:137-156 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:167-192 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 20+ corresponding lines) rust/srql/src/query/composite_results.rs:154— rust/srql/src/query/composite_results.rs:154-173 | rust/srql/src/query/sweep_coverage.rs:124-147 | rust/srql/src/query/sweep_executions.rs:88-107 | rust/srql/src/query/sweep_results.rs:118-137 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×2
Edited copies of one member (5 members, 8+ corresponding lines) rust/srql/src/query/downsample/bind.rs:18— rust/srql/src/query/downsample/bind.rs:18-27 | rust/srql/src/query/logs/stats.rs:51-58 | rust/srql/src/query/otel_metric_points.rs:374-382 | REDACTED:93-100 | rust/srql/src/query/trace_summaries.rs:143-152 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 8+ corresponding lines) rust/srql/src/query/downsample/bind.rs:29— rust/srql/src/query/downsample/bind.rs:29-37 | rust/srql/src/query/logs/stats.rs:61-68 | rust/srql/src/query/otel_metric_points.rs:385-393 | rust/srql/src/query/otel_metrics.rs:373-380 | REDACTED:1133-1140 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 7+ corresponding lines) · ×2
Edited copies of one member (5 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:441— elixir/serviceradar_core/lib/serviceradar/automation/ansible/variable_schema.ex:441-447 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:206-212 | elixir/web-ng/lib/serviceradar_web_ng/northbound/action_form.ex:253-261 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:891-897 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/anomaly_detection_live.ex:901-907 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 7+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:1423— elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex:1423-1429 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_broker.ex:354-360 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:637-644 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconciler.ex:721-729 | elixir/serviceradar_core/lib/serviceradar/plugins/value_utils.ex:19-37 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×2
Edited copies of one member (4 members, 18+ corresponding lines) go/pkg/nats/accounts/account_manager.go:166— go/pkg/nats/accounts/account_manager.go:166-185 | go/pkg/nats/accounts/operator.go:267-284 | go/pkg/nats/accounts/operator.go:287-304 | go/pkg/nats/accounts/operator.go:307-324 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 18+ corresponding lines) 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-305 | elixir/serviceradar_core/lib/serviceradar/object_store/release_artifact_retention.ex:194-211 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/package_retention.ex:124-142 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention.ex:138-155 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 2+ corresponding lines) · ×2
Edited copies of one member (5 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:549— elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:549-550 | elixir/serviceradar_core/lib/serviceradar/camera/archive_authority_config.ex:102-103 | elixir/serviceradar_core/lib/serviceradar/camera/archive_qualification_report.ex:77-78 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read.ex:64-65 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/upload.ex:257-258 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 2+ corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:439— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:439-440 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/desktop_media_session_tracker.ex:522-523 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:586-587 | elixir/web-ng/lib/serviceradar_web_ng/edge/enrollment_token.ex:187-188 | elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_token.ex:98-99 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×2
Edited copies of one member (5 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_config_defaults.ex:62— elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_config_defaults.ex:62-71 | elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_addon_id.ex:48-58 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/addon_assignment_params.ex:60-70 | elixir/serviceradar_core/lib/serviceradar/plugins/validations/no_duplicate_enabled_addon_assignment.ex:62-72 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:67-77 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 10+ corresponding lines) go/pkg/agent/remoteaccess/sftp.go:410— go/pkg/agent/remoteaccess/sftp.go:410-419 | go/pkg/agent/remoteaccess/sftp.go:421-430 | go/pkg/agent/remoteaccess/sftp.go:432-441 | go/pkg/agent/remoteaccess/sftp.go:443-455 | go/pkg/agent/remoteaccess/sftp.go:457-469 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×2
Edited copies of one member (4 members, 6+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:272— elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:272-279 | elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:736-743 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_schedule.ex:120-125 | elixir/serviceradar_nvr/lib/serviceradar_nvr/disk.ex:88-93 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 6+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/geoip.ex:151— elixir/serviceradar_core/lib/serviceradar/observability/geoip.ex:151-156 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo.ex:46-51 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:504-509 | elixir/serviceradar_core/lib/serviceradar/observability/reverse_dns.ex:56-61 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×2
Edited copies of one member (4 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/transports/http.ex:381— elixir/serviceradar_core/lib/serviceradar/notifications/transports/http.ex:381-383 | elixir/serviceradar_core/lib/serviceradar/notifications/transports/stream.ex:251-253 | elixir/serviceradar_core/lib/serviceradar/plugins/config_schema.ex:543-545 | elixir/web-ng/lib/serviceradar_web_ng_web/user_auth.ex:572-574 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 3+ corresponding lines) elixir/palisade/lib/palisade/outbound_fetch.ex:125— elixir/palisade/lib/palisade/outbound_fetch.ex:125-127 | elixir/serviceradar_core/lib/mix/tasks/serviceradar.wifi_map.seed.ex:88-90 | elixir/serviceradar_core/lib/serviceradar/policies/outbound_fetch.ex:93-95 | elixir/web-ng/lib/serviceradar_web_ng_web/auth/outbound_fetch.ex:93-95 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 3+ corresponding lines) · ×2
Edited copies of one member (7 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:537— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:537-539 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:451-453 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1784-1786 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes.ex:262-264 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/ash_store.ex:270-272 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/cipher.ex:254-256 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:392-394 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Edited copies of one member (7 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex:572— elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex:572-574 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/targeting.ex:543-545 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/action_redaction.ex:151-153 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:242-244 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:274-276 | elixir/serviceradar_core/lib/serviceradar/notifications/seed_fingerprint.ex:92-94 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:236-238 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Duplicated block (35 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1052— elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1052-1086 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1092-1126 — both copies are in the same file, so extract the 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 (35 lines × 2) elixir/serviceradar_core/lib/serviceradar/dashboards/paper_trail_mixin.ex:5— elixir/serviceradar_core/lib/serviceradar/dashboards/paper_trail_mixin.ex:5-39 | elixir/serviceradar_core/lib/serviceradar/security/paper_trail_mixin.ex:5-39 — `elixir/serviceradar_core/lib/serviceradar/dashboards/paper_trail_mixin.ex` and `elixir/serviceradar_core/lib/serviceradar/security/paper_trail_mixin.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 1 separate duplicated blocks between them, totalling at least 35 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 (29 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-63 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/plugin_package_controller.ex:158-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/addon_package_controller.ex:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) go/pkg/agent/multi_sweep_service.go:638— go/pkg/agent/multi_sweep_service.go:638-666 | go/pkg/agent/server.go:461-489 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/multi_sweep_service.go:638` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (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 11 separate duplicated blocks between them, totalling at least 115 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/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:139— elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:139-165 | elixir/web-ng/lib/serviceradar_web_ng/remote_desktop_webrtc.ex:174-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng/camera_relay_webrtc.ex:139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25 lines × 2) elixir/palisade/lib/palisade/network_address_policy.ex:100— elixir/palisade/lib/palisade/network_address_policy.ex:100-124 | elixir/serviceradar_core/lib/serviceradar/policies/network_address_policy.ex:95-119 — 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 53 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 (25 lines × 2) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:3488— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:3488-3512 | elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:4414-4438 — both copies are in the same file, so extract the 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 × 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 (24 lines × 3) go/cmd/wasm-plugins/axis/metric_telemetry.go:83— go/cmd/wasm-plugins/axis/metric_telemetry.go:83-106 | go/cmd/wasm-plugins/proxmox/metric_telemetry.go:86-109 | go/cmd/wasm-plugins/unifi-protect/metric_telemetry.go:66-89 — `go/cmd/wasm-plugins/axis/metric_telemetry.go` and `go/cmd/wasm-plugins/proxmox/metric_telemetry.go` 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 112 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 (21–24 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:368— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:368-391 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_contract.ex:283-303 — 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 11 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:368` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–24 lines × 2) rust/anomaly-addon/src/verdict.rs:163— rust/anomaly-addon/src/verdict.rs:163-186 | rust/anomaly-addon/src/verdict.rs:332-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/anomaly-addon/src/verdict.rs:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:553— elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:553-575 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:453-475 | 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 131 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 × 3) REDACTED:211— REDACTED:211-233 | REDACTED:180-202 | REDACTED:180-202 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:211` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–22 lines × 2) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:521— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:521-537 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:697-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–22 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:62— elixir/serviceradar_core/lib/serviceradar/inventory/identity/hardware_serial_backfill.ex:62-83 | elixir/serviceradar_core/lib/serviceradar/inventory/identity/mac_identifier_backfill.ex:83-99 — 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 170 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 × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:342— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:342-360 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/providers/alien_vault_otx.ex:267-285 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/stix_indicator.ex:101-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1364— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1364-1381 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:843-861 — 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 17 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:1364` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18–19 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:302— elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:302-319 | elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:339-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:302` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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 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. 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) rust/srql/src/query/logs/rollup.rs:107— rust/srql/src/query/logs/rollup.rs:107-120 | rust/srql/src/query/logs/stats_clauses.rs:36-49 | rust/srql/src/query/traces.rs:367-380 — before extracting anything, compare `rust/srql/src/query/logs/rollup.rs` and `rust/srql/src/query/logs/stats_clauses.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/rollup.rs:107` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/logs/rollup.rs:106` calls `enforce_list_limit` and `rust/srql/src/query/traces.rs:366` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:505— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:505-516 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:902-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:505` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9–12 lines × 2) go/pkg/scan/syn_scanner_bpf.go:71— go/pkg/scan/syn_scanner_bpf.go:71-79 | go/pkg/scan/syn_scanner_bpf.go:160-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 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-164 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:166-176 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:208-218 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:215-225 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:163-173 — 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 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:154` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 5) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:830— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:830-840 | elixir/serviceradar_nvr/lib/serviceradar_nvr/publication.ex:207-217 | elixir/serviceradar_nvr/lib/serviceradar_nvr/storage_bootstrap.ex:261-271 | elixir/serviceradar_recording/lib/serviceradar_recording/spool.ex:698-708 | elixir/serviceradar_recording/lib/serviceradar_recording/storage.ex:180-190 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:830` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_recording/lib/serviceradar_recording/spool.ex:695` calls `sync_directory`, `with_file` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/provider_probe.ex:827` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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:773-783 | 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 35 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–11 lines × 3) go/pkg/agent/push_loop_addons.go:598— go/pkg/agent/push_loop_addons.go:598-608 | go/pkg/devicealias/alias.go:139-147 | go/pkg/endpointinventory/hashes.go:599-609 — 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–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 9 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–10 lines × 4) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:90— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:90-98 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:120-126 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:149-158 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:175-184 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:90` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:160` calls `nextBuffer`, `failure`, `invalid` and `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–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:77-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–10 lines × 2) tools/anomaly-proof/gen.py:135— tools/anomaly-proof/gen.py:135-144 | tools/anomaly-proof/gen.py:205-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 (6 lines × 5) elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:168— elixir/serviceradar_core/lib/serviceradar/plugins/bumblebee_addon_package_seeder.ex:168-173 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:180-185 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:222-227 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:229-234 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:177-182 — 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 4 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 × 5) elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:321— elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:321-326 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_authorities.ex:132-137 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_bindings.ex:68-73 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_qualifications.ex:75-80 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_recording_configuration.ex:69-74 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_recording_configuration.ex:65` calls `installation`, `system` and `elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_bindings.ex:65` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (28 lines × 2) elixir/serviceradar_core/lib/serviceradar/observability/preset_rule_resource.ex:117— elixir/serviceradar_core/lib/serviceradar/observability/preset_rule_resource.ex:117-144 | elixir/serviceradar_core/lib/serviceradar/observability/zen_preset_resource.ex:111-138 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/observability/preset_rule_resource.ex` and `elixir/serviceradar_core/lib/serviceradar/observability/zen_preset_resource.ex` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/preset_rule_resource.ex:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) docker/images/export_rootfs_from_layout.py:34— docker/images/export_rootfs_from_layout.py:34-61 | docker/images/extract_rootfs.py:128-155 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (232 lines × 2) elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/record.pb.ex:17— elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/record.pb.ex:17-248 | elixir/serviceradar_core/lib/serviceradar/proto/edge/v1/sweep.pb.ex:17-255 — 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 (232 lines × 2) rust/srql/src/query/viz/sbom.rs:6— rust/srql/src/query/viz/sbom.rs:6-239 | rust/srql/src/query/viz/services.rs:6-237 — 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 × 7) elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:156— elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex:156-161 | elixir/serviceradar_core/lib/serviceradar/inventory/device_enrichment_rules.ex:728-733 | elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex:158-163 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_classifier.ex:354-359 | elixir/serviceradar_core/lib/serviceradar/inventory/passive_fingerprint_payload.ex:198-203 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/normalize.ex:102-107 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/normalize.ex:277-282 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/active_fingerprint_payload.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/dpi_payload.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 7) rust/srql/src/query/camera_sources.rs:121— rust/srql/src/query/camera_sources.rs:121-126 | rust/srql/src/query/identity/decisions.rs:78-83 | rust/srql/src/query/identity/deduplication_tasks.rs:76-81 | rust/srql/src/query/identity/device_revival_audit.rs:78-83 | rust/srql/src/query/identity/merge_audit.rs:110-115 | rust/srql/src/query/identity/reconciliation_runs.rs:82-87 | rust/srql/src/query/public_endpoints.rs:96-101 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/identity/decisions.rs` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 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 4 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 (10 lines × 5) go/cmd/wasm-plugins/unifi-protect/protect_network.go:66— go/cmd/wasm-plugins/unifi-protect/protect_network.go:66-75 | go/cmd/wasm-plugins/unifi-protect/protect_network.go:163-172 | go/cmd/wasm-plugins/unifi-protect/protect_network.go:207-216 | go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:25-34 | go/cmd/wasm-plugins/unifi-protect/protect_snapshot.go:121-130 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/unifi-protect/protect_network.go:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 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-342 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_components/formatters.ex:111-117 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/interface_components.ex:804-810 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ocsf_components.ex:496-502 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:229-235 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/virtualization_components.ex:498-504 | elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2006-2012 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7587-7593 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:7977-7983 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:238` calls `format_bytes` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/show.ex:2015` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 9) REDACTED:45— REDACTED:45-52 | rust/srql/src/query/composite_results.rs:87-93 | rust/srql/src/query/devices.rs:72-78 | rust/srql/src/query/interfaces.rs:38-44 | rust/srql/src/query/otel_metric_points.rs:45-51 | rust/srql/src/query/otel_metrics.rs:41-47 | rust/srql/src/query/sweep_coverage.rs:49-55 | rust/srql/src/query/sweep_results.rs:46-52 | rust/srql/src/query/traces.rs:46-52 — before extracting anything, compare `REDACTED` and `rust/srql/src/query/composite_results.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:56` calls `as_select` and `rust/srql/src/query/otel_metric_points.rs:55` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27 lines × 2) go/pkg/agent/cert_renewal.go:499— go/pkg/agent/cert_renewal.go:499-525 | go/pkg/grpc/security.go:529-555 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27 lines × 2) elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:723— elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl:723-749 | elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl:180-206 — before extracting anything, compare `elixir/serviceradar_core/src/otel_exporter_logs_otlp.erl` and `elixir/serviceradar_core/src/serviceradar_otel_exporter_traces_otlp.erl` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 171 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–17 lines × 2) go/pkg/scalibrinventory/skip_dirs.go:120— go/pkg/scalibrinventory/skip_dirs.go:120-133 | go/pkg/trivysidecar/envelope.go:282-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/trivysidecar/envelope.go:282` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–17 lines × 2) rust/srql/src/query/camera_sources.rs:126— rust/srql/src/query/camera_sources.rs:126-139 | rust/srql/src/query/device_sweep_overlap.rs:120-136 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) go/pkg/k8sinventory/publisher.go:263— go/pkg/k8sinventory/publisher.go:263-274 | go/pkg/trivysidecar/publisher.go:163-176 — `go/pkg/k8sinventory/publisher.go` and `go/pkg/trivysidecar/publisher.go` 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 8 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/k8sinventory/publisher.go:263` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–14 lines × 2) rust/anomaly-addon/src/shed.rs:68— rust/anomaly-addon/src/shed.rs:68-81 | rust/anomaly-addon/src/shed.rs:163-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/anomaly-addon/src/shed.rs:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) go/cmd/wasm-plugins/awx/main.go:2349— go/cmd/wasm-plugins/awx/main.go:2349-2358 | go/cmd/wasm-plugins/awx/main.go:3539-3549 | go/cmd/wasm-plugins/awx/main.go:3566-3575 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/cmd/wasm-plugins/awx/main.go:2349` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 3) rust/srql/src/query/logs/filters.rs:211— rust/srql/src/query/logs/filters.rs:211-221 | rust/srql/src/query/logs/stats.rs:186-196 | rust/srql/src/query/starrocks.rs:1143-1152 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 3) go/pkg/agent/managed_certificates_linux.go:415— go/pkg/agent/managed_certificates_linux.go:415-423 | go/pkg/scalibrinventory/skip_dirs.go:123-131 | go/pkg/trivysidecar/envelope.go:286-295 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `go/pkg/agent/managed_certificates_linux.go:424` calls `Sort` and `go/pkg/scalibrinventory/skip_dirs.go:132` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 3) swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:35— swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:35-44 | swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:46-55 | swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:56-64 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:35` calls `font` and `swift/FieldSurvey/FieldSurvey/Views/SettingsView.swift:56` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23–24 lines × 2) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:248— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:248-270 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:273-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowType.swift:248` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) rust/srql/src/query/devices.rs:123— rust/srql/src/query/devices.rs:123-146 | rust/srql/src/query/services.rs:120-142 — before extracting anything, compare `rust/srql/src/query/devices.rs` and `rust/srql/src/query/services.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) REDACTED:123— REDACTED:123-147 | REDACTED:102-126 | REDACTED:102-126 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:123` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 3) rust/otel/src/nats/stream.rs:25— rust/flowgger/src/flowgger/output/nats_output.rs:38-62 | rust/otel/src/nats/stream.rs:25-49 | rust/trapd/src/main.rs:202-226 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24–25 lines × 2) rust/anomaly-addon/src/verdict.rs:609— rust/anomaly-addon/src/verdict.rs:609-633 | rust/powerdns/src/lib.rs:697-720 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/anomaly-addon/src/verdict.rs:609` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–25 lines × 2) rust/netprobe/src/census.rs:598— rust/netprobe/src/census.rs:598-621 | rust/netprobe/src/mdns.rs:1985-2009 — before extracting anything, compare `rust/netprobe/src/census.rs` and `rust/netprobe/src/mdns.rs` as WHOLE FILES: this scan already matched 6 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/netprobe/src/census.rs:598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `snapshot` to `DeviceCensusSnapshot` in one and `MdnsSnapshot` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11–14 lines × 2) rust/netprobe/ebpf/src/lib.rs:1143— rust/netprobe/ebpf/src/lib.rs:1143-1156 | rust/netprobe/ebpf/src/lib.rs:1258-1268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/netprobe/ebpf/src/lib.rs:1143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–14 lines × 2) REDACTED:363— REDACTED:363-373 | rust/srql/src/query/threat_intel_matches.rs:340-353 — before extracting anything, compare `REDACTED` and `rust/srql/src/query/threat_intel_matches.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:363` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 6) rust/srql/src/query/camera_sources.rs:122— rust/srql/src/query/camera_sources.rs:122-128 | rust/srql/src/query/identity/decisions.rs:79-85 | rust/srql/src/query/identity/deduplication_tasks.rs:77-83 | rust/srql/src/query/identity/device_revival_audit.rs:79-85 | rust/srql/src/query/identity/reconciliation_runs.rs:83-89 | rust/srql/src/query/public_endpoints.rs:97-103 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/identity/decisions.rs` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) rust/srql/src/query/downsample/filters.rs:24— rust/srql/src/query/downsample/filters.rs:24-30 | rust/srql/src/query/logs/rollup.rs:83-89 | rust/srql/src/query/logs/stats_clauses.rs:12-18 | rust/srql/src/query/logs/stats_clauses.rs:67-73 | REDACTED:2334-2340 | rust/srql/src/query/traces.rs:344-350 — before extracting anything, compare `rust/srql/src/query/downsample/filters.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/downsample/filters.rs:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 3) rust/srql/src/query/logs/stats_expr.rs:107— rust/srql/src/query/logs/stats_expr.rs:107-112 | REDACTED:2536-2542 | rust/srql/src/query/trace_summaries.rs:680-686 — before extracting anything, compare `rust/srql/src/query/logs/stats_expr.rs` and `rust/srql/src/query/trace_summaries.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/stats_expr.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 3) rust/srql/src/query/logs/topn.rs:276— rust/srql/src/query/logs/topn.rs:276-281 | rust/srql/src/query/logs/topn.rs:289-294 | rust/srql/src/query/logs/topn.rs:357-363 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/topn.rs:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication· Duplicated block with local edits (27 matched lines × 2 locations) · ×2
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 with local edits (27 matched lines × 2 locations) elixir/web-ng/assets/js/lib/camera_relay/viewer.js:493— elixir/web-ng/assets/js/lib/camera_relay/viewer.js:493 · elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js:376 — the two spans are one implementation copied and then locally edited — 167 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 (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) 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 (22 lines × 2 locations) REDACTED:91— REDACTED:91 · elixir/web-ng/assets/camera_recording.playwright.js:111 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (22 lines × 2 locations) 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 (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.
Duplicated block (16 lines × 2 locations) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:514— elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:514 · elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:541 — 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.
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:79 — the two spans are one implementation copied and then locally edited — 82 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:129 — 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:287— elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:287 · 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.
_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.
exposure-reconciliation-audit.openspec.html.Archify.radar (cyclomatic 96) docs/architecture/exposure-reconciliation-audit.openspec.html:13109— exposure-reconciliation-audit.openspec.html.Archify.radar has cyclomatic complexity 96 (threshold 15). Most of this is not in the body itself: 1 of the 96 points is its own statement and the rest belongs to 26 function items inside it that branch (updateDocking, syncNow, visibleRect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.radar (cyclomatic 96) docs/architecture/exposure-source-validation.openspec.html:12364— exposure-source-validation.openspec.html.Archify.radar has cyclomatic complexity 96 (threshold 15). Most of this is not in the body itself: 1 of the 96 points is its own statement and the rest belongs to 26 function items inside it that branch (updateDocking, syncNow, visibleRect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
buildTopologySceneEdgeData (cyclomatic 89) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:420— buildTopologySceneEdgeData has cyclomatic complexity 89 (threshold 15). Most of this is not in the body itself: 10 of the 89 points are its own statements and the rest belongs to 36 function items inside it that branch (a function literal at line 498, a function literal at line 453, (anonymous)::(anonymous)::metadataNumber, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
renderSelectionDetails (cyclomatic 85) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:70— 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.
D1 · Cyclomatic Complexity· main (cyclomatic 83) · ×1
main (cyclomatic 83) REDACTED:10— main has cyclomatic complexity 83 (threshold 15). Of this number, 35 points are the body's own statements and 48 belong to 58 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.
aggregateVisibleEdges (cyclomatic 69) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:607— aggregateVisibleEdges has cyclomatic complexity 69 (threshold 15). Of this number, 35 points are the body's own statements and 34 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
god_view_bitmap_gpu_harness.mountBitmapGpuHarness (cyclomatic 67) elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:11— god_view_bitmap_gpu_harness.mountBitmapGpuHarness has cyclomatic complexity 67 (threshold 15). Of this number, 16 points are the body's own statements and 51 belong to 18 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.
exposure-reconciliation-audit.openspec.html.Archify.guidedViews (cyclomatic 64) docs/architecture/exposure-reconciliation-audit.openspec.html:10335— exposure-reconciliation-audit.openspec.html.Archify.guidedViews has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 4 of the 64 points are its own statements and the rest belongs to 18 function items inside it that branch (beginHandoff, settleHandoff, chapterAnchor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.guidedViews (cyclomatic 64) docs/architecture/exposure-source-validation.openspec.html:9590— exposure-source-validation.openspec.html.Archify.guidedViews has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 4 of the 64 points are its own statements and the rest belongs to 18 function items inside it that branch (beginHandoff, settleHandoff, chapterAnchor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:370— 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.
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 51) config/manager_validator/go/validate.go:74— validator.field has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent 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 51) elixir/web-ng/assets/component/src/RemoteAccessTerminal.jsx:125— RemoteAccessTerminal.Component has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 5 of the 51 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 163, 288, 330, …). 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.
world_overlay_frame.decodeWorldOverlay (cyclomatic 51) elixir/web-ng/assets/js/lib/god_view/world_overlay_frame.js:20— world_overlay_frame.decodeWorldOverlay has cyclomatic complexity 51 (threshold 15). Of this number, 23 points are the body's own statements and 28 belong to 12 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.
admitNodeLabelsForViewport (cyclomatic 51) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:446— admitNodeLabelsForViewport has cyclomatic complexity 51 (threshold 15). Of this number, 36 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.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.
edgerecord.ValidateSweepObservationBatch (cyclomatic 48) go/pkg/edge/edgerecord/domain.go:325— edgerecord.ValidateSweepObservationBatch has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
god_view_elk_scene_harness.start (cyclomatic 48) elixir/web-ng/assets/god_view_elk_scene_harness.js:106— god_view_elk_scene_harness.start has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 14 function items inside it that branch (startLiveAnimation, longestTwo, pickNodeAt, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.reachabilitySnapshot (cyclomatic 47) docs/architecture/exposure-reconciliation-audit.openspec.html:8920— exposure-reconciliation-audit.openspec.html.reachabilitySnapshot has cyclomatic complexity 47 (threshold 15). Of this number, 29 points are the body's own statements and 18 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.
exposure-source-validation.openspec.html.reachabilitySnapshot (cyclomatic 47) docs/architecture/exposure-source-validation.openspec.html:8175— exposure-source-validation.openspec.html.reachabilitySnapshot has cyclomatic complexity 47 (threshold 15). Of this number, 29 points are the body's own statements and 18 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.
createContext (cyclomatic 47) js/cli/harness/dev.js:39— createContext has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 6 of the 47 points are its own statements and the rest belongs to 16 function items inside it that branch (mount, loadFrames, swapFixture, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buildVisibleGraphData (cyclomatic 46) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:172— buildVisibleGraphData has cyclomatic complexity 46 (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.
exposure-reconciliation-audit.openspec.html.Archify.guide (cyclomatic 45) docs/architecture/exposure-reconciliation-audit.openspec.html:15789— exposure-reconciliation-audit.openspec.html.Archify.guide has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 9 of the 45 points are its own statements and the rest belongs to 11 function items inside it that branch (execute, open, a function literal at line 15921, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.guide (cyclomatic 45) docs/architecture/exposure-source-validation.openspec.html:15044— exposure-source-validation.openspec.html.Archify.guide has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 9 of the 45 points are its own statements and the rest belongs to 11 function items inside it that branch (execute, open, a function literal at line 15176, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.Archify.routeProbe (cyclomatic 44) docs/architecture/exposure-reconciliation-audit.openspec.html:14078— exposure-reconciliation-audit.openspec.html.Archify.routeProbe has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 13 function items inside it that branch (exportSnapshot, a function literal at line 14142, a function literal at line 14273, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.routeProbe (cyclomatic 44) docs/architecture/exposure-source-validation.openspec.html:13333— exposure-source-validation.openspec.html.Archify.routeProbe has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 13 function items inside it that branch (exportSnapshot, a function literal at line 13397, a function literal at line 13528, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_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.
selectNodeLabels (cyclomatic 44) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:289— selectNodeLabels has cyclomatic complexity 44 (threshold 15). Of this number, 33 points are the body's own statements and 11 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buildTransportAndEffectLayers (cyclomatic 44) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:62— buildTransportAndEffectLayers has cyclomatic complexity 44 (threshold 15). Of this number, 23 points are the body's own statements and 21 belong to 27 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.
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). Most of this is not in the body itself: 11 of the 43 points are its own statements and the rest belongs to 7 function items inside it that branch (handleApplicationFrame, sendRequest, a function literal at line 160, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
buildPacketFlowEdges (cyclomatic 43) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:12— buildPacketFlowEdges 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.
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, a function literal at line 111, formatBytes, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
validator.evaluate (cyclomatic 41) config/manager_validator/go/validate.go:241— 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.
edgerecord.ValidateMtrTraceBatch (cyclomatic 41) go/pkg/edge/edgerecord/domain.go:524— edgerecord.ValidateMtrTraceBatch 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.
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.
edgerecord.ValidateSweepAssignmentRecord (cyclomatic 38) go/pkg/edge/edgerecord/assignment.go:110— edgerecord.ValidateSweepAssignmentRecord 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:175— 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.
WorldTileLayer.renderSubLayers (cyclomatic 38) elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:328— WorldTileLayer.renderSubLayers has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to 14 function items inside it that branch (healthColor, shownEdge, a function literal at line 356, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
login.runDeviceCodeFlow (cyclomatic 38) js/cli/src/auth/login.ts:76— login.runDeviceCodeFlow has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteAccessSSHConsole.Component (cyclomatic 36) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— RemoteAccessSSHConsole.Component has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (RemoteAccessSSHConsole.Component::openSession) 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.
handleSnapshot (cyclomatic 36) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:76— 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.
edgerecord.DecodeTransportProvenance (cyclomatic 35) go/pkg/edge/edgerecord/publication_identity.go:474— edgerecord.DecodeTransportProvenance 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.
exposure-reconciliation-audit.openspec.html.Archify.intentTrace (cyclomatic 35) docs/architecture/exposure-reconciliation-audit.openspec.html:10126— exposure-reconciliation-audit.openspec.html.Archify.intentTrace has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (show, blocked, clear, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.intentTrace (cyclomatic 35) docs/architecture/exposure-source-validation.openspec.html:9381— exposure-source-validation.openspec.html.Archify.intentTrace has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (show, blocked, clear, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch (framePayloadBytes, encodedFrame, writeBytes, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
ProtoUtil.swift.fromProto (cyclomatic 34) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ProtoUtil.swift:20— ProtoUtil.swift.fromProto has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buildNodeAndLabelLayers (cyclomatic 34) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:566— buildNodeAndLabelLayers has cyclomatic complexity 34 (threshold 15). Of this number, 26 points are the body's own statements and 8 belong to 24 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.
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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginFleet.row (cyclomatic 33) elixir/web-ng/lib/serviceradar_web_ng/plugins/plugin_fleet.ex:495— PluginFleet.row has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ArrowReaderHelper.swift.findArrowType (cyclomatic 33) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:239— ArrowReaderHelper.swift.findArrowType 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.
WorldFilterPanel.renderCondition (cyclomatic 33) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:212— WorldFilterPanel.renderCondition has cyclomatic complexity 33 (threshold 15). Of this number, 32 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.
importsFor (cyclomatic 33) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1014— 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.
actionRun.swapTerminal (cyclomatic 32) go/cmd/wasm-plugins/starlink/actions.go:235— actionRun.swapTerminal 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.
edgerecord.validateExecutionGrantClaims (cyclomatic 32) go/pkg/edge/edgerecord/compiled_assignment.go:868— edgerecord.validateExecutionGrantClaims has cyclomatic complexity 32 (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.
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:282— 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.
world_tile_decode.decodeWorldTile (cyclomatic 32) elixir/web-ng/assets/js/lib/god_view/world_tile_decode.js:39— world_tile_decode.decodeWorldTile has cyclomatic complexity 32 (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.
_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:3083— 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). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (handleTCPFrame, a function literal at line 121, sendData, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
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.decodeDishDiagnostics (cyclomatic 30) go/cmd/wasm-plugins/starlink/local.go:167— main.decodeDishDiagnostics has cyclomatic complexity 30 (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.
main.runBGPSimulator (cyclomatic 30) REDACTED: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:1215— 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.parseMtrCheckConfig (cyclomatic 30) go/pkg/agent/mtr_checker.go:571— agent.parseMtrCheckConfig 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.
MultiSweepService.UpdateSweepGroupsContext (cyclomatic 30) go/pkg/agent/multi_sweep_service.go:292— MultiSweepService.UpdateSweepGroupsContext 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.
edgerecord.ValidatePlanPages (cyclomatic 30) go/pkg/edge/edgerecord/plan.go:241— edgerecord.ValidatePlanPages 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.
LaneSet.createGeneration (cyclomatic 30) go/pkg/edge/spool/lanes.go:672— LaneSet.createGeneration 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.
Spool.observeAttribution (cyclomatic 30) go/pkg/edge/spool/attribution_commit.go:385— Spool.observeAttribution 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.
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.
WorldFilterPanel.expression (cyclomatic 30) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:346— WorldFilterPanel.expression 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.
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:680— 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.
agent.deriveSweepGroupMtrChecks (cyclomatic 29) go/pkg/agent/mtr_checker.go:377— agent.deriveSweepGroupMtrChecks has cyclomatic complexity 29 (threshold 15). Of this number, 23 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.
agent.buildScheduledMtrTrace (cyclomatic 29) go/pkg/agent/push_loop_mtr_traces_edge.go:271— agent.buildScheduledMtrTrace 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.
managedCertificateStore.bootstrapLocalNATS (cyclomatic 29) go/pkg/agent/managed_local_nats_linux.go:82— managedCertificateStore.bootstrapLocalNATS 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.
pluginExecution.hostHTTPRequest (cyclomatic 29) go/pkg/agent/plugin_runtime_http.go:96— 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:468— 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.
edgerecord.ValidateManifestChain (cyclomatic 29) go/pkg/edge/edgerecord/recovery.go:238— edgerecord.ValidateManifestChain 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.
RecoveryOperation.readPublicationReceipt (cyclomatic 29) go/pkg/edge/spool/recovery_publication.go:247— RecoveryOperation.readPublicationReceipt 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.
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:198— 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 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.
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:1276— 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.validatePluginHostAuthorityBinding (cyclomatic 28) go/pkg/agent/plugin_runtime_host_authority.go:250— agent.validatePluginHostAuthorityBinding 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.
agent.validateProxmoxConsoleBindingTargetIDs (cyclomatic 28) go/pkg/agent/plugin_runtime_host_authority.go:392— 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.
agent.parseSystemdUnitStatusOutputForUnit (cyclomatic 28) go/pkg/agent/push_loop_capabilities.go:1026— agent.parseSystemdUnitStatusOutputForUnit 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.
otlpRelayPump.run (cyclomatic 28) go/pkg/agent/addon_otlp_relay.go:265— otlpRelayPump.run has cyclomatic complexity 28 (threshold 15). Of this number, 22 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.
pluginExecution.hostWebSocketConnect (cyclomatic 28) go/pkg/agent/plugin_runtime_network.go:354— 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.
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:99— 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.
spool.collectRecoveryArchive (cyclomatic 28) go/pkg/edge/spool/recovery_archive.go:208— spool.collectRecoveryArchive 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.
RecoveryCompletion.Finish (cyclomatic 28) go/pkg/edge/spool/recovery_completion.go:405— RecoveryCompletion.Finish 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.
Spool.commit (cyclomatic 28) go/pkg/edge/spool/spool.go:477— Spool.commit 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.
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.
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.
RemoteAccessSSHConsole.Component::openSession (cyclomatic 28) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:922— RemoteAccessSSHConsole.Component::openSession 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. This shape REPEATS in the file: one other method here (RemoteAccessSSHConsole.Component) 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.
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:353— 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.
MergeEngine.do_merge_devices (cyclomatic 27) elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:441— MergeEngine.do_merge_devices 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.
agent.proxmoxInventoryPathAllowed (cyclomatic 27) go/pkg/agent/plugin_runtime_host_authority.go:969— agent.proxmoxInventoryPathAllowed 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.
managedCertificateStore.install (cyclomatic 27) go/pkg/agent/managed_certificates_linux.go:454— managedCertificateStore.install 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.
managedCertificateStore.stage (cyclomatic 27) go/pkg/agent/managed_certificates_linux.go:526— managedCertificateStore.stage 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.
PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks (cyclomatic 27) go/pkg/agent/push_loop_addons.go:326— PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks 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.
edgerecord.validateScheduledMtrTraceEvent (cyclomatic 27) go/pkg/edge/edgerecord/scheduled_mtr.go:96— edgerecord.validateScheduledMtrTraceEvent 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.
edgerecord.ValidateAck (cyclomatic 27) go/pkg/edge/edgerecord/validate.go:1252— edgerecord.ValidateAck 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.
spool.InventoryRecoveryStorage (cyclomatic 27) go/pkg/edge/spool/recovery_inventory.go:85— spool.InventoryRecoveryStorage 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.
Spool.recover (cyclomatic 27) go/pkg/edge/spool/recover.go:63— Spool.recover 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.
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.
exposure-reconciliation-audit.openspec.html.renderShareCard (cyclomatic 27) docs/architecture/exposure-reconciliation-audit.openspec.html:7567— exposure-reconciliation-audit.openspec.html.renderShareCard has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 7584, 7582, 7669). 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.
exposure-reconciliation-audit.openspec.html.Archify.focus (cyclomatic 27) docs/architecture/exposure-reconciliation-audit.openspec.html:8689— exposure-reconciliation-audit.openspec.html.Archify.focus has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (computeReachability, a function literal at line 8757, a function literal at line 8741, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.renderShareCard (cyclomatic 27) docs/architecture/exposure-source-validation.openspec.html:6822— exposure-source-validation.openspec.html.renderShareCard has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 6839, 6837, 6924). 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.
exposure-source-validation.openspec.html.Archify.focus (cyclomatic 27) docs/architecture/exposure-source-validation.openspec.html:7944— exposure-source-validation.openspec.html.Archify.focus has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (computeReachability, a function literal at line 8012, a function literal at line 7996, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
renderLayers (cyclomatic 27) elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:230— renderLayers has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
expandableEndpointClusterId (cyclomatic 27) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:240— 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.
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.
AddonFleet.build_row (cyclomatic 26) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.ex:416— AddonFleet.build_row 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.
RemoteAccessStreamHandler.handle_in (cyclomatic 26) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:114— 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:660— 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.parseGRPCUnaryRequest (cyclomatic 26) go/pkg/agent/plugin_runtime_grpc.go:493— agent.parseGRPCUnaryRequest 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.
agent.validateProxmoxPublicParams (cyclomatic 26) go/pkg/agent/plugin_runtime_host_authority.go:477— 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 503). 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:2036— 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.
PushLoop.handleMtrBulkRun (cyclomatic 26) go/pkg/agent/mtr_bulk.go:144— PushLoop.handleMtrBulkRun has cyclomatic complexity 26 (threshold 15). Of this number, 20 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.
agentgateway.ReassembleConfigChunks (cyclomatic 26) go/pkg/agentgateway/gateway_client.go:717— 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.
spool.BeginRecoveryOperation (cyclomatic 26) go/pkg/edge/spool/recovery_begin.go:20— spool.BeginRecoveryOperation has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RecoveryStorageInventory.scanGeneration (cyclomatic 26) go/pkg/edge/spool/recovery_inventory.go:200— RecoveryStorageInventory.scanGeneration 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.
Spool.reclaimLocked (cyclomatic 26) go/pkg/edge/spool/reclaim.go:185— Spool.reclaimLocked 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.
Spool.scanChain (cyclomatic 26) go/pkg/edge/spool/recover.go:505— Spool.scanChain has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.
ArrowWriterHelper.swift.toFBType (cyclomatic 26) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowWriterHelper.swift:53— ArrowWriterHelper.swift.toFBType 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.
WorldTileCache.observe (cyclomatic 26) elixir/web-ng/assets/js/lib/god_view/world_tile_cache.js:29— WorldTileCache.observe has cyclomatic complexity 26 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WorldMapRenderer.syncMembership (cyclomatic 26) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:565— WorldMapRenderer.syncMembership has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 587, 577, 601). 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 (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.
managed.mergeManagedConfiguration (cyclomatic 26) js/cli/src/edge/managed.ts:206— managed.mergeManagedConfiguration has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
clusterEdges (cyclomatic 26) elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:169— 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 172). 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.
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.
ControllerProvenance.exact_command_payload (cyclomatic 25) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:601— 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:565— 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.
main.requireChecksumCoverage (cyclomatic 25) build/release/checksums.go:187— main.requireChecksumCoverage 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.
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:815— 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.buildSweepResultsChunks (cyclomatic 25) go/pkg/agent/push_loop_sweep_results.go:117— 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.
managedCertificateStore.validateAssignment (cyclomatic 25) go/pkg/agent/managed_certificates_linux.go:203— managedCertificateStore.validateAssignment 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.
PushLoop.applyConfigResponseWithSequence (cyclomatic 25) go/pkg/agent/push_loop_config.go:152— PushLoop.applyConfigResponseWithSequence 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.
edgerecord.validateProductionCapability (cyclomatic 25) go/pkg/edge/edgerecord/validate.go:751— edgerecord.validateProductionCapability 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.
spool.validateRecoveryPlan (cyclomatic 25) go/pkg/edge/spool/recovery_plan.go:105— spool.validateRecoveryPlan 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.
RecoveryOperation.CapturePublicationAck (cyclomatic 25) go/pkg/edge/spool/recovery_publication.go:183— RecoveryOperation.CapturePublicationAck 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.
Spool.quarantine (cyclomatic 25) go/pkg/edge/spool/quarantine.go:179— Spool.quarantine has cyclomatic complexity 25 (threshold 15). Of this number, 22 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.
Spool.terminalProof (cyclomatic 25) go/pkg/edge/spool/reclaim.go:352— Spool.terminalProof 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.
renderSvgFallback (cyclomatic 25) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1812— 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, a function literal at line 1881, a function literal at line 1915, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
createHarnessCameraApi.open (cyclomatic 25) js/cli/harness/camera.js:53— createHarnessCameraApi.open 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 12 function items inside it that branch (attach, animate, relaySessionId, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
receive (cyclomatic 25) elixir/web-ng/assets/js/lib/god_view/world_membership.js:44— receive has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs 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.
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:675— 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.
AddonRolloutView.fleet_health (cyclomatic 24) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_rollout_view.ex:179— AddonRolloutView.fleet_health 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.
main.reviewedAWXSurveyVariable (cyclomatic 24) go/cmd/wasm-plugins/awx/main.go:3164— 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:1588— 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 1590). 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:325— 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:376— 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:1541— 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.
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.
edgerecord.ValidateCompiledSweepAssignment (cyclomatic 24) go/pkg/edge/edgerecord/compiled_assignment.go:198— edgerecord.ValidateCompiledSweepAssignment 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.
RecoveryOperation.ReclaimSource (cyclomatic 24) go/pkg/edge/spool/recovery_reclaim.go:27— RecoveryOperation.ReclaimSource has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
LocalCertificateAuthorizer.Authorize (cyclomatic 24) go/pkg/natsutil/certificate_authorization.go:61— LocalCertificateAuthorizer.Authorize 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.
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.
exposure-reconciliation-audit.openspec.html.recordWebm (cyclomatic 24) docs/architecture/exposure-reconciliation-audit.openspec.html:7731— exposure-reconciliation-audit.openspec.html.recordWebm 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 6 function items inside it that branch (createMotionScene::samplesFor, createMotionScene::pointInRoot, a function literal at line 7788, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.recordWebm (cyclomatic 24) docs/architecture/exposure-source-validation.openspec.html:6986— exposure-source-validation.openspec.html.recordWebm 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 6 function items inside it that branch (createMotionScene::samplesFor, createMotionScene::pointInRoot, a function literal at line 7043, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorldMapRenderer.openScene (cyclomatic 24) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:754— WorldMapRenderer.openScene has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 items inside it that branch (a function literal at line 173, touch, a function literal at line 161, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
camera.createHarnessCameraApi.open (cyclomatic 24) js/cli/harness/camera.js:53— camera.createHarnessCameraApi.open has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
handleDetailsPanelClick (cyclomatic 24) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:207— 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.
AwxMembershipReconciler.upsert_membership (cyclomatic 23) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:610— AwxMembershipReconciler.upsert_membership 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.
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:2863— 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.runTelemetry (cyclomatic 23) go/cmd/wasm-plugins/starlink/plugin.go:119— main.runTelemetry 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.
main.run (cyclomatic 23) REDACTED:142— 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:1131— 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 29) 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.
systemHost.commitPrivilegedUnitInstall (cyclomatic 23) go/pkg/agent/addon_systemd.go:502— systemHost.commitPrivilegedUnitInstall has cyclomatic complexity 23 (threshold 15). Of this number, 20 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.
pluginExecution.proxmoxHostAuthorityForHTTPRequest (cyclomatic 23) go/pkg/agent/plugin_runtime_host_authority.go:1044— 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.
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:363— 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.
scan.computeRingLayout (cyclomatic 23) REDACTED:586— scan.computeRingLayout has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
exposure-reconciliation-audit.openspec.html.placeRelationshipLens (cyclomatic 23) docs/architecture/exposure-reconciliation-audit.openspec.html:9699— exposure-reconciliation-audit.openspec.html.placeRelationshipLens has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 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.
exposure-source-validation.openspec.html.placeRelationshipLens (cyclomatic 23) docs/architecture/exposure-source-validation.openspec.html:8954— exposure-source-validation.openspec.html.placeRelationshipLens has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 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.
layout_topology_state_methods.overviewTopologySceneFromGeometry (cyclomatic 23) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:285— 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_label_collision.admitTopologyLabels (cyclomatic 23) elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js:402— rendering_label_collision.admitTopologyLabels has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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_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.
update (cyclomatic 23) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:122— update 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.
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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:446— 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:450— 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:279— 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:302— 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:243— 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:1421— 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 29) 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.
cameraRelayManager.runSession (cyclomatic 22) go/pkg/agent/camera_relay.go:317— cameraRelayManager.runSession has cyclomatic complexity 22 (threshold 15). Of this number, 12 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.
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.
edgerecord.ValidateFrameSigned (cyclomatic 22) go/pkg/edge/edgerecord/validate.go:340— edgerecord.ValidateFrameSigned 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.
spool.OpenRecoveryOperation (cyclomatic 22) go/pkg/edge/spool/recovery_operation.go:40— spool.OpenRecoveryOperation 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.
RecoveryOperation.prepareCompletion (cyclomatic 22) go/pkg/edge/spool/recovery_completion.go:87— RecoveryOperation.prepareCompletion 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.
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.
doctor.doctorCommand (cyclomatic 22) js/cli/src/doctor.ts:34— doctor.doctorCommand 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.
packages.packageCreateCommand (cyclomatic 22) js/cli/src/edge/packages.ts:48— packages.packageCreateCommand 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.
install.acceptLocalOnboarding (cyclomatic 22) js/cli/src/edge/install.ts:152— install.acceptLocalOnboarding 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.
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:464— 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.
createDeckInstance (cyclomatic 22) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:562— createDeckInstance has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 11 function items inside it that branch (onError, onViewStateChange::applyViewState, onViewStateChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
chooseValues (cyclomatic 22) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:255— chooseValues has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (load, onConfirm, a function literal at line 272, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_draw (cyclomatic 22) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:118— _draw has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buildMtrPathEdgeDataUncached (cyclomatic 22) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:330— buildMtrPathEdgeDataUncached has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 338, 372). 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.
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:1288— 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.
CompiledAssignmentValidate.structure (cyclomatic 21) elixir/serviceradar_core/lib/serviceradar/edge/compiled_assignment_validate.ex:159— CompiledAssignmentValidate.structure 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.
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.
ExposureSnapshotWorker.publish (cyclomatic 21) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_worker.ex:139— ExposureSnapshotWorker.publish 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.
main.listRecentJobsBounded (cyclomatic 21) go/cmd/wasm-plugins/awx/main.go:1600— 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.
runConfig.applyModeDefaults (cyclomatic 21) go/cmd/tools/mapper-baseline/main.go:411— runConfig.applyModeDefaults 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.
main.validateVEXStatement (cyclomatic 21) go/cmd/tools/ubuntu-feed-merge/projector.go:836— 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.buildSweepMetricBatchFromMap (cyclomatic 21) go/pkg/agent/metric_envelope.go:387— agent.buildSweepMetricBatchFromMap 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.
SweepService.GetSweepResults (cyclomatic 21) go/pkg/agent/sweep_service.go:504— SweepService.GetSweepResults 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.
edgerecord.ValidateSweepExecutionEvent (cyclomatic 21) go/pkg/edge/edgerecord/domain.go:162— edgerecord.ValidateSweepExecutionEvent 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.
edgerecord.validateSourceAuthorization (cyclomatic 21) go/pkg/edge/edgerecord/validate.go:796— edgerecord.validateSourceAuthorization 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.
edgerecord.ValidateDeliveryFrame (cyclomatic 21) go/pkg/edge/edgerecord/validate.go:946— edgerecord.ValidateDeliveryFrame 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.
spool.RepairRecoveryPhases (cyclomatic 21) go/pkg/edge/spool/recovery_phase.go:194— spool.RepairRecoveryPhases 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.
RecoveryOperation.readCoverage (cyclomatic 21) go/pkg/edge/spool/recovery_coverage.go:158— RecoveryOperation.readCoverage 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.
Spool.Health (cyclomatic 21) go/pkg/edge/spool/health.go:60— Spool.Health 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.
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.
DiscoveryEngine.runDiscoveryJob (cyclomatic 21) go/pkg/mapper/discovery_run.go:25— DiscoveryEngine.runDiscoveryJob 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.
Tracer.matchProbeResponse (cyclomatic 21) go/pkg/mtr/tracer.go:703— Tracer.matchProbeResponse 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.
NetworkSweeper.runSweep (cyclomatic 21) go/pkg/sweeper/sweeper_run.go:248— NetworkSweeper.runSweep has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
exposure-reconciliation-audit.openspec.html.applyReachability (cyclomatic 21) docs/architecture/exposure-reconciliation-audit.openspec.html:8852— exposure-reconciliation-audit.openspec.html.applyReachability has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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.
exposure-reconciliation-audit.openspec.html.Archify.viewerChromeLayout::measure (cyclomatic 21) docs/architecture/exposure-reconciliation-audit.openspec.html:12408— exposure-reconciliation-audit.openspec.html.Archify.viewerChromeLayout::measure 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.
exposure-source-validation.openspec.html.applyReachability (cyclomatic 21) docs/architecture/exposure-source-validation.openspec.html:8107— exposure-source-validation.openspec.html.applyReachability has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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.
exposure-source-validation.openspec.html.Archify.viewerChromeLayout::measure (cyclomatic 21) docs/architecture/exposure-source-validation.openspec.html:11663— exposure-source-validation.openspec.html.Archify.viewerChromeLayout::measure 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.
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.
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.
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.
D1 · Cyclomatic Complexity· mount (cyclomatic 21) · ×1
mount (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:115— mount 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 23 function items inside it that branch (a function literal at line 164, onLocationHistory, a function literal at line 218, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
fromExpression (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:56— fromExpression has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
browserModuleApi (cyclomatic 21) js/cli/harness/harness.js:95— 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 19 function items inside it that branch (pushQuery, frameBytes, resolveFrame, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
decodeSnapshotTable (cyclomatic 21) elixir/web-ng/assets/js/lib/god_view/snapshot_columns.js:289— decodeSnapshotTable has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 13 function items inside it that branch (edgeDetailsAndMetadata, nodeDetails, nodeDetail, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:1402— 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.
Manifest.validate_producer_schedule (cyclomatic 20) elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1455— Manifest.validate_producer_schedule 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.
FirstPartyImporter.import (cyclomatic 20) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:133— FirstPartyImporter.import 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.
RemoteAccessStreamHandler.credential_broker_opts (cyclomatic 20) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:482— 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:854— 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:1940— 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.
main.decodeWifiDiagnostics (cyclomatic 20) go/cmd/wasm-plugins/starlink/local.go:253— main.decodeWifiDiagnostics 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.
builder.build (cyclomatic 20) build/packaging/agent/macos/package.go:206— 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:202— 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:1325— 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:987— 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.applyCredentialBrokerFormInjection (cyclomatic 20) go/pkg/agent/plugin_runtime_actions.go:507— 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.
otlpRelayPump.prepareEdgeRelayFrame (cyclomatic 20) go/pkg/agent/addon_otlp_relay_edge.go:142— otlpRelayPump.prepareEdgeRelayFrame 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.
PluginManager.credentialBrokerCacheDecision (cyclomatic 20) go/pkg/agent/plugin_runtime_http.go:517— PluginManager.credentialBrokerCacheDecision 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:1949— 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.
pluginExecution.applyCredentialBrokerOAuth2Bearer (cyclomatic 20) go/pkg/agent/plugin_runtime_oauth.go:99— pluginExecution.applyCredentialBrokerOAuth2Bearer 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.
SNMPCollector.processValue (cyclomatic 20) go/pkg/agent/snmp/collector.go:348— 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.
edgerecord.zstdFrameLen (cyclomatic 20) go/pkg/edge/edgerecord/compression.go:198— edgerecord.zstdFrameLen 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.
edgerecord.ValidateRecord (cyclomatic 20) go/pkg/edge/edgerecord/validate.go:628— edgerecord.ValidateRecord 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.
RecoveryOperation.RecordResolution (cyclomatic 20) go/pkg/edge/spool/recovery_reclaim.go:192— RecoveryOperation.RecordResolution 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.
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.
CoreServiceConfig.Validate (cyclomatic 20) REDACTED:386— CoreServiceConfig.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.
Tracer.Run (cyclomatic 20) go/pkg/mtr/tracer.go:230— Tracer.Run has cyclomatic complexity 20 (threshold 15). Of this number, 14 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.
natsutil.RevokeUnauthorizedLocalClients (cyclomatic 20) go/pkg/natsutil/local_certificate_revocation.go:46— natsutil.RevokeUnauthorizedLocalClients 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.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.
exposure-reconciliation-audit.openspec.html.relationshipTokenKind (cyclomatic 20) docs/architecture/exposure-reconciliation-audit.openspec.html:9227— exposure-reconciliation-audit.openspec.html.relationshipTokenKind has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
exposure-reconciliation-audit.openspec.html.applyJourneyState (cyclomatic 20) docs/architecture/exposure-reconciliation-audit.openspec.html:14562— exposure-reconciliation-audit.openspec.html.applyJourneyState has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 14570, 14586, 14578). 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.
exposure-source-validation.openspec.html.relationshipTokenKind (cyclomatic 20) docs/architecture/exposure-source-validation.openspec.html:8482— exposure-source-validation.openspec.html.relationshipTokenKind has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
exposure-source-validation.openspec.html.applyJourneyState (cyclomatic 20) docs/architecture/exposure-source-validation.openspec.html:13817— exposure-source-validation.openspec.html.applyJourneyState has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 13825, 13841, 13833). 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.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.
WorldFilterPanel.renderPrefixTag::load (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:315— WorldFilterPanel.renderPrefixTag::load 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. This is NOT this file's highest cyclomatic complexity: WorldFilterPanel.chooseValues (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 method is counted neither in this dimension's figures nor in its score.
manifest.manifestErrors (cyclomatic 20) js/cli/src/plugin/manifest.ts:131— 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.
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.
(anonymous) (cyclomatic 20) elixir/web-ng/assets/god_view_world_gpu.playwright.js:540— (anonymous) 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 46 function literals inside it that branch (lines 566, 553, 623, …). 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.
deterministicRelationPresentation (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:119— deterministicRelationPresentation has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 143, a function literal at line 120, (anonymous)::serializedDetails). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
nodeTypeHeroIcon (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:284— 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.
_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.
_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.
stateReasonForNode (cyclomatic 20) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:22— 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.
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.
PublicationIdentity.decode_transport_provenance (cyclomatic 19) elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:428— PublicationIdentity.decode_transport_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_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:487— 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.
RuntimeGraph.canonical_edge_to_runtime_row (cyclomatic 19) elixir/web-ng/lib/serviceradar_web_ng/topology/runtime_graph.ex:236— 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:229— 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:3247— 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:375— 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:886— 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:253— 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.
agent.validateSweepLease (cyclomatic 19) go/pkg/agent/sweep_lease.go:609— agent.validateSweepLease 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.
runOverrideStore.recordActionResult (cyclomatic 19) go/pkg/agent/plugin_runtime_overrides.go:227— runOverrideStore.recordActionResult 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.applyBumblebeeConfig (cyclomatic 19) go/pkg/agent/push_loop_config.go:653— 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.
edgerecord.joinSweepAuthority (cyclomatic 19) go/pkg/edge/edgerecord/domain.go:1229— edgerecord.joinSweepAuthority 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.
edgerecord.recoveryControlBody (cyclomatic 19) go/pkg/edge/edgerecord/recovery.go:646— edgerecord.recoveryControlBody 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.
recoveryArchiveWriter.write (cyclomatic 19) go/pkg/edge/spool/recovery_archive.go:356— recoveryArchiveWriter.write 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.
Spool.inspectRelocation (cyclomatic 19) go/pkg/edge/spool/attribution_commit.go:214— Spool.inspectRelocation 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.
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.
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.
World::plan (cyclomatic 19) rust/topology-atlas/src/tiles.rs:379— World::plan 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 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.
runtime.normalizeEventFilter (cyclomatic 19) js/cli/harness/runtime.js:53— runtime.normalizeEventFilter 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.
dev.watchProjectForValidation (cyclomatic 19) js/cli/src/dashboard/dev.ts:385— 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 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.
refreshManifest (cyclomatic 19) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:425— refreshManifest has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 427, (anonymous)::capability, a function literal at line 465). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cyclomatic 19) elixir/web-ng/assets/camera_codec_capability.playwright.js:27— (anonymous) 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 17 function items inside it that branch (a function literal at line 30, (anonymous)::onaudioprocess, (anonymous)::presented, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Rows.encode_row (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:171— Rows.encode_row 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.
AutomationResultSanitizer.job (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:384— 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:533— 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.
HypervisorEnrichmentIngestor.persist_records (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:330— HypervisorEnrichmentIngestor.persist_records 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.
SyncRunLedger.receipt_attrs (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/inventory/sync_run_ledger.ex:168— SyncRunLedger.receipt_attrs 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.
CertificateAuthorizationToken.decode_request (cyclomatic 18) elixir/serviceradar_core/lib/serviceradar/nats/certificate_authorization_token.ex:31— CertificateAuthorizationToken.decode_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.
ArchiveStorageListener.load! (cyclomatic 18) elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:38— ArchiveStorageListener.load! 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) js/cli/ensure_k8s_node_alerts.py: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:2610— 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:3208— 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.
main.decodeRunningConfigBody (cyclomatic 18) go/cmd/wasm-plugins/opentext-nom/config_retrieve.go:196— main.decodeRunningConfigBody 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.
Query.UnmarshalJSON (cyclomatic 18) go/cmd/wasm-plugins/opentext-nom/config.go:74— 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:153— 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.
main.checkVolume (cyclomatic 18) go/cmd/tools/camera-spool-preflight/inspect.go:69— main.checkVolume 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.
agent.stageAddonArtifactWithClient (cyclomatic 18) go/pkg/agent/addon_activation.go:182— agent.stageAddonArtifactWithClient 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.applyStagedAddonRuntimeConfig (cyclomatic 18) go/pkg/agent/addon_activation.go:377— agent.applyStagedAddonRuntimeConfig 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.
agent.selectHostInterfaceMACs (cyclomatic 18) go/pkg/agent/host_identity.go:225— agent.selectHostInterfaceMACs has cyclomatic complexity 18 (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.
agent.trustedProxmoxSSHTimeout (cyclomatic 18) go/pkg/agent/plugin_runtime_host_authority.go:2157— 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 2165). 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.newSweepLeaseStore (cyclomatic 18) go/pkg/agent/sweep_lease.go:208— agent.newSweepLeaseStore 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.
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.
managedCertificatePolicyStore.install (cyclomatic 18) go/pkg/agent/managed_certificate_policy_linux.go:76— managedCertificatePolicyStore.install 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.
PushLoop.pushFlowAttributionEdge (cyclomatic 18) go/pkg/agent/push_loop_flow_attribution_edge.go:189— PushLoop.pushFlowAttributionEdge 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.
RecoveryCoordinator.publish (cyclomatic 18) go/pkg/agent/recovery_transport.go:20— RecoveryCoordinator.publish 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:309— 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.
edgerecord.validateCollectionCapability (cyclomatic 18) go/pkg/edge/edgerecord/compiled_assignment.go:268— edgerecord.validateCollectionCapability 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.
edgerecord.validateSweepSummaries (cyclomatic 18) go/pkg/edge/edgerecord/domain.go:460— edgerecord.validateSweepSummaries 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.
edgerecord.validateSingleManifestPage (cyclomatic 18) go/pkg/edge/edgerecord/recovery.go:698— edgerecord.validateSingleManifestPage 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.
edgerecord.SweepCheckSetRun (cyclomatic 18) go/pkg/edge/edgerecord/sweep_lease_check_sets.go:164— edgerecord.SweepCheckSetRun 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.
spool.readRecoverySource (cyclomatic 18) go/pkg/edge/spool/generation.go:80— spool.readRecoverySource 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.
LaneSet.appendWithAttribution (cyclomatic 18) go/pkg/edge/spool/lanes.go:412— LaneSet.appendWithAttribution 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.
Spool.repairCopyTail (cyclomatic 18) go/pkg/edge/spool/recovery_copy.go:95— Spool.repairCopyTail 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.
Spool.ScanFrom (cyclomatic 18) go/pkg/edge/spool/spool.go:856— Spool.ScanFrom has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
edgeonboarding.extractBundle (cyclomatic 18) REDACTED:247— 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.
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.
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.
IpfixTlsConfig::validate (cyclomatic 18) rust/flow-collector/src/config.rs:293— IpfixTlsConfig::validate 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.
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.
exposure-reconciliation-audit.openspec.html.Archify.presentation (cyclomatic 18) docs/architecture/exposure-reconciliation-audit.openspec.html:13738— exposure-reconciliation-audit.openspec.html.Archify.presentation has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (setActive, render, updateUrl, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.begin (cyclomatic 18) docs/architecture/exposure-reconciliation-audit.openspec.html:14857— exposure-reconciliation-audit.openspec.html.begin 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.
exposure-source-validation.openspec.html.Archify.presentation (cyclomatic 18) docs/architecture/exposure-source-validation.openspec.html:12993— exposure-source-validation.openspec.html.Archify.presentation has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (setActive, render, updateUrl, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.begin (cyclomatic 18) docs/architecture/exposure-source-validation.openspec.html:14112— exposure-source-validation.openspec.html.begin 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.
WorldTileCache.load (cyclomatic 18) elixir/web-ng/assets/js/lib/god_view/world_tile_cache.js:167— WorldTileCache.load 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.
bitmap_frame.decodeBitmapFrame (cyclomatic 18) elixir/web-ng/assets/js/lib/god_view/bitmap_frame.js:55— bitmap_frame.decodeBitmapFrame has cyclomatic complexity 18 (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.
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.
CameraRelayViewer.connectWebRtc (cyclomatic 18) elixir/web-ng/assets/js/lib/camera_relay/viewer.js:380— CameraRelayViewer.connectWebRtc 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.
dashboard_camera.createDashboardCameraApi.open (cyclomatic 18) elixir/web-ng/assets/js/lib/camera_relay/dashboard_camera.js:112— dashboard_camera.createDashboardCameraApi.open 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. This shape REPEATS in the file: one other method here (dashboard_camera.createDashboardCameraApi.open::requestSession) 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.
DashboardWasmHost.buildSrqlQuery (cyclomatic 18) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:119— 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:537— 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 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.
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.
login.runWebPkceFlow (cyclomatic 18) js/cli/src/auth/login.ts:196— login.runWebPkceFlow 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.
install.installManaged (cyclomatic 18) js/cli/src/edge/install.ts:199— install.installManaged has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 221, 245, 230). 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.
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.
updateBrowserModuleHost (cyclomatic 18) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:356— 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.
buildElkSceneGraph (cyclomatic 18) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:333— 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 28 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.
isBlockedIPv4 (cyclomatic 18) elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js:901— 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.
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.
_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.
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.
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:2771— 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.
AssignmentValidate.validate_identity (cyclomatic 17) elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:308— AssignmentValidate.validate_identity 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.
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:656— 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:1234— 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:4089— 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.parseInterfaceCheckConfig (cyclomatic 17) go/cmd/wasm-plugins/opentext-nom/config_check.go:94— main.parseInterfaceCheckConfig 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.
localOAuthBroker.Handle (cyclomatic 17) go/cmd/wasm-plugins/opentext-nom/local_broker.go:99— localOAuthBroker.Handle 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.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.collectFlightStatus (cyclomatic 17) go/cmd/wasm-plugins/starlink/flights.go:35— main.collectFlightStatus has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 84, 53, 40). 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.prepareOne (cyclomatic 17) go/cmd/tools/ubuntu-feed-merge/main.go:489— 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 29) 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:624— 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) go/pkg/agent/camera_relay_rtsp.go:90— 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.validatePluginHostAuthorityGrant (cyclomatic 17) go/pkg/agent/plugin_runtime_host_authority.go:321— agent.validatePluginHostAuthorityGrant 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.dialProxmoxConsoleSSH (cyclomatic 17) go/pkg/agent/proxmox_console_ssh.go:270— 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:895— 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.
CertRenewalManager.Run (cyclomatic 17) go/pkg/agent/cert_renewal.go:162— CertRenewalManager.Run 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:1616— 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.
PushLoop.configApplyFailureStatuses (cyclomatic 17) go/pkg/agent/config_section_state.go:661— PushLoop.configApplyFailureStatuses 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.
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.
remoteaccess.destinationSymlinkFacts (cyclomatic 17) go/pkg/agent/remoteaccess/sftp.go:232— remoteaccess.destinationSymlinkFacts 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.
sweepLeaseExecutor.runSlot (cyclomatic 17) go/pkg/agent/sweep_lease_executor.go:286— sweepLeaseExecutor.runSlot has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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: agent.validateSweepLeaseSourceAuthorization (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.
SweepService.runLeaseToSpool (cyclomatic 17) go/pkg/agent/sweep_edge_producer.go:107— SweepService.runLeaseToSpool 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.
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.
GatewayClient.Connect (cyclomatic 17) go/pkg/agentgateway/gateway_client.go:141— GatewayClient.Connect 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.
Store.Apply (cyclomatic 17) go/pkg/certpolicy/policy.go:59— Store.Apply 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.
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.
edgerecord.ValidateAssignmentAgainstCompiled (cyclomatic 17) go/pkg/edge/edgerecord/compiled_assignment.go:321— edgerecord.ValidateAssignmentAgainstCompiled 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.
edgerecord.AuthorizeCollectionNow (cyclomatic 17) go/pkg/edge/edgerecord/compiled_assignment.go:570— edgerecord.AuthorizeCollectionNow 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.
edgerecord.validateMtrHop (cyclomatic 17) go/pkg/edge/edgerecord/domain.go:619— edgerecord.validateMtrHop 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.
edgerecord.ValidateHeaderSet (cyclomatic 17) go/pkg/edge/edgerecord/publication_identity.go:733— edgerecord.ValidateHeaderSet 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.
edgerecord.ValidateRecoveryResolution (cyclomatic 17) go/pkg/edge/edgerecord/recovery_resolution.go:30— edgerecord.ValidateRecoveryResolution 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.
edgerecord.ParseTrustDocument (cyclomatic 17) go/pkg/edge/edgerecord/trust_document.go:96— edgerecord.ParseTrustDocument 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.
Sender.runSession (cyclomatic 17) go/pkg/edge/sender/sender.go:237— Sender.runSession 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.
spool.ResolveSlot (cyclomatic 17) go/pkg/edge/spool/resolve.go:228— spool.ResolveSlot 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.
LaneSet.recoverGeneration (cyclomatic 17) go/pkg/edge/spool/lanes.go:915— LaneSet.recoverGeneration 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.
LaneSet.recoveryDestination (cyclomatic 17) go/pkg/edge/spool/recovery_generation.go:67— LaneSet.recoveryDestination 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.
RecoveryOperation.ArchiveTerminalEvidence (cyclomatic 17) go/pkg/edge/spool/recovery_archive.go:44— RecoveryOperation.ArchiveTerminalEvidence 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.
RecoveryOperation.resumeCopyTail (cyclomatic 17) go/pkg/edge/spool/recovery_copy.go:40— RecoveryOperation.resumeCopyTail 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.
RecoveryOperation.SealCoverage (cyclomatic 17) go/pkg/edge/spool/recovery_coverage.go:38— RecoveryOperation.SealCoverage 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.
Spool.initAttribution (cyclomatic 17) go/pkg/edge/spool/attribution.go:71— Spool.initAttribution 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.
Spool.cleanupReclaimed (cyclomatic 17) go/pkg/edge/spool/reclaim.go:441— Spool.cleanupReclaimed 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.
edgeonboarding.EnrollAgentFromToken (cyclomatic 17) REDACTED:74— edgeonboarding.EnrollAgentFromToken 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.
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.
CatalogBuild::resume (cyclomatic 17) elixir/serviceradar_core/native/prefix_tags_nif/src/catalog.rs:96— CatalogBuild::resume 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.
exposure-reconciliation-audit.openspec.html.relationshipHitRecords (cyclomatic 17) docs/architecture/exposure-reconciliation-audit.openspec.html:9101— exposure-reconciliation-audit.openspec.html.relationshipHitRecords has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 9107, 9121). 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.
exposure-source-validation.openspec.html.relationshipHitRecords (cyclomatic 17) docs/architecture/exposure-source-validation.openspec.html:8356— exposure-source-validation.openspec.html.relationshipHitRecords has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 8362, 8376). 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.
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:242— 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.
WorldMapRenderer.search (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:663— WorldMapRenderer.search has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: WorldMapRenderer.refreshManifest (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
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.
status.statusCommand (cyclomatic 17) js/cli/src/dashboard/status.ts:15— status.statusCommand 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.
cli.main (cyclomatic 17) js/cli/src/cli.ts:20— cli.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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deckLayer (cyclomatic 17) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1333— 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.
resizeCanvas (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:397— 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.
buildVisibleGraphData::expandedMemberEdge (cyclomatic 17) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:215— 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.
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.
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.
createDashboardCameraApi.open::requestSession (cyclomatic 17) elixir/web-ng/assets/js/lib/camera_relay/dashboard_camera.js:179— createDashboardCameraApi.open::requestSession 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.
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.
CredentialGrants.rule_covers_target? (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/automation/northbound/credential_grants.ex:323— CredentialGrants.rule_covers_target? 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.
ArchiveAuthorities.do_with_current (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:200— ArchiveAuthorities.do_with_current 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.
ScheduledMtrTrace.validate_trace_entry (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:336— ScheduledMtrTrace.validate_trace_entry 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.
RecoveryValidate.control_body (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/edge/recovery_validate.ex:562— RecoveryValidate.control_body 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.exact_product? (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:433— 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:653— 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.
ThreatIntelOTXSyncWorker.record_failure (cyclomatic 16) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_otx_sync_worker.ex:296— ThreatIntelOTXSyncWorker.record_failure 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:63— 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.
EdgePipelineComponents.explanation (cyclomatic 16) elixir/web-ng/lib/serviceradar_web_ng_web/components/edge_pipeline_components.ex:31— EdgePipelineComponents.explanation has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
main.extractLaunchPreflightJSONAnsibleHost (cyclomatic 16) go/cmd/wasm-plugins/awx/launch_preflight.go:1171— 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:1742— 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:2249— 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.
Collector.runInterfaceChecks (cyclomatic 16) go/cmd/wasm-plugins/opentext-nom/config_check.go:356— Collector.runInterfaceChecks 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.interfacesFromGuestConfig (cyclomatic 16) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:434— 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.buildDiscovery (cyclomatic 16) go/cmd/wasm-plugins/starlink/discovery.go:19— main.buildDiscovery 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.parseLocalConfig (cyclomatic 16) go/cmd/wasm-plugins/starlink/local.go:49— main.parseLocalConfig 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:140— 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:651— 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:1149— 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.runPushMode (cyclomatic 16) go/cmd/agent/main.go:159— main.runPushMode 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.
main.loadConfig (cyclomatic 16) REDACTED:259— 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:721— 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 29) 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:1540— 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 29) 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.extractAddonTarball (cyclomatic 16) go/pkg/agent/addon_activation.go:913— 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.parseAWXAuthFailedPingDetails (cyclomatic 16) go/pkg/agent/control_stream.go:1392— agent.parseAWXAuthFailedPingDetails 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: PushLoop.handleCommand (cyclomatic 23) 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.pluginResultItemFromPayload (cyclomatic 16) go/pkg/agent/plugin_result_convert.go:34— agent.pluginResultItemFromPayload 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.consumeUniqueJSONValue (cyclomatic 16) go/pkg/agent/plugin_runtime_host_authority.go:869— 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:226— 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.
agent.parseGatewaySweepConfig (cyclomatic 16) go/pkg/agent/sweep_config_gateway.go:122— agent.parseGatewaySweepConfig 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.validateSweepLeaseSlot (cyclomatic 16) go/pkg/agent/sweep_lease_executor.go:405— agent.validateSweepLeaseSlot 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: agent.validateSweepLeaseSourceAuthorization (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.
managedCertificatePolicySnapshot.validate (cyclomatic 16) go/pkg/agent/managed_certificate_policy_linux.go:129— managedCertificatePolicySnapshot.validate 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.
pluginExecution.protectProxmoxConsoleProxyResponse (cyclomatic 16) go/pkg/agent/plugin_runtime_host_authority.go:1765— 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.controlStreamLoop (cyclomatic 16) go/pkg/agent/control_stream.go:229— PushLoop.controlStreamLoop 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, separate the cases: extract each independent 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 23) 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.handlePluginRunAction (cyclomatic 16) go/pkg/agent/control_stream.go:806— 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 23) 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.serveManagedLocalNATS (cyclomatic 16) go/pkg/agent/managed_local_nats_linux.go:577— PushLoop.serveManagedLocalNATS has cyclomatic complexity 16 (threshold 15). Of this number, 10 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.
PushLoop.applySystemdAddonAtRoot (cyclomatic 16) go/pkg/agent/push_loop_addons.go:753— PushLoop.applySystemdAddonAtRoot 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.
remoteaccess.EvaluateFileTransferPolicy (cyclomatic 16) go/pkg/agent/remoteaccess/file_transfer_policy.go:90— remoteaccess.EvaluateFileTransferPolicy 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.validateSSHConfig (cyclomatic 16) go/pkg/agent/remoteaccess/ssh.go:356— 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:115— 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.
armis.transientReason (cyclomatic 16) REDACTED:177— armis.transientReason 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.
Server.Stop (cyclomatic 16) go/pkg/agent/server.go:692— 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:589— 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.
edgerecord.validateLocalBinding (cyclomatic 16) go/pkg/edge/edgerecord/local_binding.go:101— edgerecord.validateLocalBinding 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.
LaneSet.recoverLane (cyclomatic 16) go/pkg/edge/spool/lanes.go:837— LaneSet.recoverLane 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.
RecoveryCompletion.collectTransient (cyclomatic 16) go/pkg/edge/spool/recovery_completion.go:544— RecoveryCompletion.collectTransient has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecoveryGrant.restoreArtifacts (cyclomatic 16) go/pkg/edge/spool/reserve_resume.go:135— RecoveryGrant.restoreArtifacts 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.
DiscoveryEngine.querySingleUniFiAPI (cyclomatic 16) go/pkg/mapper/ubnt_poller.go:166— 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:121— 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:159— 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.
exposure-reconciliation-audit.openspec.html.Archify.preset (cyclomatic 16) docs/architecture/exposure-reconciliation-audit.openspec.html:6718— exposure-reconciliation-audit.openspec.html.Archify.preset has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 7 function items inside it that branch (open, a function literal at line 6787, apply, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.installRelationshipHitTargets (cyclomatic 16) docs/architecture/exposure-reconciliation-audit.openspec.html:9504— exposure-reconciliation-audit.openspec.html.installRelationshipHitTargets has cyclomatic complexity 16 (threshold 15). Of this number, 10 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.
exposure-source-validation.openspec.html.Archify.preset (cyclomatic 16) docs/architecture/exposure-source-validation.openspec.html:5973— exposure-source-validation.openspec.html.Archify.preset has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 7 function items inside it that branch (open, a function literal at line 6042, apply, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.installRelationshipHitTargets (cyclomatic 16) docs/architecture/exposure-source-validation.openspec.html:8759— exposure-source-validation.openspec.html.installRelationshipHitTargets has cyclomatic complexity 16 (threshold 15). Of this number, 10 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.
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:298— 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.
dashboard_camera.createDashboardCameraApi.open::requestSession (cyclomatic 16) elixir/web-ng/assets/js/lib/camera_relay/dashboard_camera.js:179— dashboard_camera.createDashboardCameraApi.open::requestSession has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (dashboard_camera.createDashboardCameraApi.open) 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.
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.
boot (cyclomatic 16) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:428— 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.
replaceFramePayload (cyclomatic 16) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:927— replaceFramePayload has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
trustRank (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:80— trustRank 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.
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.
mountBitmapGpuHarness::fetch (cyclomatic 16) elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:89— mountBitmapGpuHarness::fetch 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.
(anonymous) (cyclomatic 16) REDACTED:35— (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 41, 54, 71). 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.
handlePanMove (cyclomatic 16) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:138— 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.
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:94— 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.
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.
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 136) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:172— buildVisibleGraphData has cognitive complexity 136 (threshold 15). Drivers by points: boolean chains 72, ternaries 24 (29 pts), if/else 24 (28 pts), loops 4 (7 pts) (nesting depth added 12). Of this number, 49 points are the body's own statements and 87 belong to 18 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.
exposure-reconciliation-audit.openspec.html.Archify.radar (cognitive 91) docs/architecture/exposure-reconciliation-audit.openspec.html:13109— exposure-reconciliation-audit.openspec.html.Archify.radar has cognitive complexity 91 (threshold 15). Drivers by points: if/else 47 (49 pts), boolean chains 22, ternaries 16 (18 pts), error handling 2 (nesting depth added 4). None of this is in the body itself: all 91 points belong to 26 function items inside it that branch (updateDocking, syncNow, setOpen, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.radar (cognitive 91) docs/architecture/exposure-source-validation.openspec.html:12364— exposure-source-validation.openspec.html.Archify.radar has cognitive complexity 91 (threshold 15). Drivers by points: if/else 47 (49 pts), boolean chains 22, ternaries 16 (18 pts), error handling 2 (nesting depth added 4). None of this is in the body itself: all 91 points belong to 26 function items inside it that branch (updateDocking, syncNow, setOpen, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buildTopologySceneEdgeData (cognitive 91) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:420— buildTopologySceneEdgeData has cognitive complexity 91 (threshold 15). Drivers by points: boolean chains 41, ternaries 30 (35 pts), if/else 9 (10 pts), other 3, loops 2 (nesting depth added 6). Most of this is not in the body itself: 9 of the 91 points are its own statements and the rest belongs to 36 function items inside it that branch (a function literal at line 498, a function literal at line 453, (anonymous)::(anonymous)::metadataNumber, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity· main (cognitive 87) · ×1
main (cognitive 87) REDACTED:10— main has cognitive complexity 87 (threshold 15). Drivers by points: if/else 23 (31 pts), ternaries 13 (20 pts), loops 16 (17 pts), boolean chains 16, error handling 2 (3 pts) (nesting depth added 17). Of this number, 39 points are the body's own statements and 48 belong to 58 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.
Driver.Sync (cognitive 85) go/pkg/agent/syncsources/armis/driver.go:99— 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.
layout_elk_radial_overview.validateTopologyOverview (cognitive 81) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:370— 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) REDACTED: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:70— 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.
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.
edgerecord.ValidateSweepObservationBatch (cognitive 67) go/pkg/edge/edgerecord/domain.go:325— edgerecord.ValidateSweepObservationBatch has cognitive complexity 67 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 13, loops 4 (6 pts) (nesting depth added 23). Of this number, 62 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.
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.
RemoteAccessStreamHandler.handle_in (cognitive 64) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:114— 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.
exposure-reconciliation-audit.openspec.html.Archify.guidedViews (cognitive 63) docs/architecture/exposure-reconciliation-audit.openspec.html:10335— exposure-reconciliation-audit.openspec.html.Archify.guidedViews has cognitive complexity 63 (threshold 15). Drivers by points: if/else 32 (33 pts), boolean chains 19, ternaries 7 (8 pts), error handling 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 63 points are its own statements and the rest belongs to 18 function items inside it that branch (beginHandoff, chapterAnchor, settleHandoff, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.guidedViews (cognitive 63) docs/architecture/exposure-source-validation.openspec.html:9590— exposure-source-validation.openspec.html.Archify.guidedViews has cognitive complexity 63 (threshold 15). Drivers by points: if/else 32 (33 pts), boolean chains 19, ternaries 7 (8 pts), error handling 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 63 points are its own statements and the rest belongs to 18 function items inside it that branch (beginHandoff, chapterAnchor, settleHandoff, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
ExposureSnapshotWorker.publish (cognitive 61) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_worker.ex:139— ExposureSnapshotWorker.publish has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (50 pts), match/switch 4 (11 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
agent.deriveSweepGroupMtrChecks (cognitive 60) go/pkg/agent/mtr_checker.go:377— agent.deriveSweepGroupMtrChecks has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (39 pts), loops 7 (17 pts), boolean chains 4 (nesting depth added 32). Of this number, 48 points are the body's own statements and 12 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.
login.runDeviceCodeFlow (cognitive 60) js/cli/src/auth/login.ts:76— login.runDeviceCodeFlow has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 10, ternaries 4 (10 pts), error handling 3 (5 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.
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.
otlpRelayPump.run (cognitive 57) go/pkg/agent/addon_otlp_relay.go:265— otlpRelayPump.run has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 31). Of this number, 49 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.
selectNodeLabels (cognitive 57) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:289— selectNodeLabels has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 12, loops 9, ternaries 2 (nesting depth added 16). Of this number, 42 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildPacketFlowEdges (cognitive 57) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:12— buildPacketFlowEdges has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 12 (21 pts), boolean chains 18, if/else 7 (13 pts), other 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
actionRun.swapTerminal (cognitive 55) go/cmd/wasm-plugins/starlink/actions.go:235— actionRun.swapTerminal has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (51 pts), boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
agent.parseMtrCheckConfig (cognitive 53) go/pkg/agent/mtr_checker.go:571— agent.parseMtrCheckConfig has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 6 (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.
Tracer.sendProbes (cognitive 53) go/pkg/mtr/tracer.go:363— 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.
RemoteAccessSSHConsole.Component (cognitive 53) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:386— RemoteAccessSSHConsole.Component has cognitive complexity 53 (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). To reduce it, split the body into named stages: move each independent 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 (RemoteAccessSSHConsole.Component::openSession) 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.
admitNodeLabelsForViewport (cognitive 53) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:446— admitNodeLabelsForViewport has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 26, if/else 9 (14 pts), ternaries 10 (11 pts), loops 2 (nesting depth added 6). Of this number, 38 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.
validator.evaluate (cognitive 52) config/manager_validator/go/validate.go:241— 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.
edgerecord.ValidateMtrTraceBatch (cognitive 51) go/pkg/edge/edgerecord/domain.go:524— edgerecord.ValidateMtrTraceBatch has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 11, loops 2 (3 pts), 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.
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.
validator.field (cognitive 49) config/manager_validator/go/validate.go:74— validator.field has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (48 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.
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.
aggregateVisibleEdges (cognitive 49) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:607— aggregateVisibleEdges has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 18 (32 pts), boolean chains 28, if/else 14 (21 pts), loops 3 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edgerecord.ValidatePlanPages (cognitive 48) go/pkg/edge/edgerecord/plan.go:241— edgerecord.ValidatePlanPages has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (39 pts), loops 4 (5 pts), boolean chains 4 (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.
edgerecord.ValidateManifestChain (cognitive 48) go/pkg/edge/edgerecord/recovery.go:238— edgerecord.ValidateManifestChain has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (37 pts), loops 5 (7 pts), boolean chains 4 (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.
Spool.terminalProof (cognitive 48) go/pkg/edge/spool/reclaim.go:352— Spool.terminalProof has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.run (cognitive 47) REDACTED:142— 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.
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.
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.
createContext (cognitive 46) js/cli/harness/dev.js:39— createContext has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 12, ternaries 5, error handling 4, loops 2, other 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 46 points are its own statements and the rest belongs to 16 function items inside it that branch (mount, loadFrames, swapFixture, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
auditFrameWriter.Write (cognitive 45) go/cmd/tools/ubuntu-feed-merge/main.go:1421— 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.
PushLoop.handleMtrBulkRun (cognitive 45) go/pkg/agent/mtr_bulk.go:144— PushLoop.handleMtrBulkRun has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 21). Of this number, 27 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.
Spool.scanChain (cognitive 45) go/pkg/edge/spool/recover.go:505— Spool.scanChain has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 24). Of this number, 44 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.
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). Most of this is not in the body itself: 11 of the 45 points are its own statements and the rest belongs to 7 function items inside it that branch (handleApplicationFrame, sendRequest, a function literal at line 160, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
start (cognitive 45) elixir/web-ng/assets/god_view_elk_scene_harness.js:106— start has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 19, if/else 13 (15 pts), ternaries 7, loops 3, error handling 1 (nesting depth added 2). None of this is in the body itself: all 45 points belong to 32 function items inside it that branch (longestTwo, startLiveAnimation, startLiveAnimation::stop, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
managedCertificateStore.stage (cognitive 44) go/pkg/agent/managed_certificates_linux.go:526— managedCertificateStore.stage has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiSweepService.UpdateSweepGroupsContext (cognitive 44) go/pkg/agent/multi_sweep_service.go:292— MultiSweepService.UpdateSweepGroupsContext has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 9 (10 pts), boolean chains 3 (nesting depth added 15). Of this number, 41 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.
edgerecord.DecodeTransportProvenance (cognitive 44) go/pkg/edge/edgerecord/publication_identity.go:474— edgerecord.DecodeTransportProvenance has cognitive complexity 44 (threshold 15). Drivers by points: if/else 29 (41 pts), match/switch 2, 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.
ProtoUtil.swift.fromProto (cognitive 44) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ProtoUtil.swift:20— ProtoUtil.swift.fromProto has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 12 (17 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 20). 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.
RemoteAccessTerminal.Component (cognitive 44) elixir/web-ng/assets/component/src/RemoteAccessTerminal.jsx:125— RemoteAccessTerminal.Component has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 14, ternaries 9 (12 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 44 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 163, 288, 330, …). 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.
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.
exposure-reconciliation-audit.openspec.html.Archify.guide (cognitive 43) docs/architecture/exposure-reconciliation-audit.openspec.html:15789— exposure-reconciliation-audit.openspec.html.Archify.guide has cognitive complexity 43 (threshold 15). Drivers by points: if/else 33, boolean chains 7, ternaries 3. Most of this is not in the body itself: 8 of the 43 points are its own statements and the rest belongs to 11 function items inside it that branch (execute, open, a function literal at line 15921, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.guide (cognitive 43) docs/architecture/exposure-source-validation.openspec.html:15044— exposure-source-validation.openspec.html.Archify.guide has cognitive complexity 43 (threshold 15). Drivers by points: if/else 33, boolean chains 7, ternaries 3. Most of this is not in the body itself: 8 of the 43 points are its own statements and the rest belongs to 11 function items inside it that branch (execute, open, a function literal at line 15176, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorldFilterPanel.renderCondition (cognitive 43) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:212— WorldFilterPanel.renderCondition has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 12 (14 pts), boolean chains 8 (nesting depth added 12). 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.
god_view_bitmap_gpu_harness.mountBitmapGpuHarness (cognitive 43) elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:11— god_view_bitmap_gpu_harness.mountBitmapGpuHarness has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 14 (21 pts), if/else 8 (10 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 10). Most of this is not in the body itself: 5 of the 43 points are its own statements and the rest belongs to 18 function items inside it that branch (tile, a function literal at line 134, a function literal at line 128, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_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.
PushLoop.pushFlowAttributionEdge (cognitive 42) go/pkg/agent/push_loop_flow_attribution_edge.go:189— PushLoop.pushFlowAttributionEdge has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (40 pts), boolean chains 1, 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.
ArrowReaderHelper.swift.findArrowType (cognitive 42) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:239— ArrowReaderHelper.swift.findArrowType has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 9 (16 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (2 pts) (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.
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.
buildTransportAndEffectLayers (cognitive 42) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:62— buildTransportAndEffectLayers has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 27, boolean chains 10, other 4, if/else 1. Of this number, 21 points are the body's own statements and 21 belong to 27 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.
PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks (cognitive 41) go/pkg/agent/push_loop_addons.go:326— PushLoop.applyEffectiveAddonAssignmentsWithActivationBlocks has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 5, loops 2, match/switch 1 (2 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.
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.
world_overlay_frame.decodeWorldOverlay (cognitive 41) elixir/web-ng/assets/js/lib/god_view/world_overlay_frame.js:20— world_overlay_frame.decodeWorldOverlay has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22, boolean chains 12, loops 4, ternaries 3. Most of this is not in the body itself: 15 of the 41 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 80, flowAt, text, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ExposureSnapshotIngestion.prepare_and_settle (cognitive 40) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_snapshot_ingestion.ex:84— ExposureSnapshotIngestion.prepare_and_settle has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
main.projectPreparedPass (cognitive 40) go/cmd/tools/ubuntu-feed-merge/main.go:1215— 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.
rendering_label_collision.admitTopologyLabels (cognitive 40) elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js:402— rendering_label_collision.admitTopologyLabels has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 7, loops 4 (7 pts), ternaries 3 (4 pts) (nesting depth added 18). Of this number, 38 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.
main.requireChecksumCoverage (cognitive 39) build/release/checksums.go:187— main.requireChecksumCoverage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 3, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.buildScheduledMtrTrace (cognitive 39) go/pkg/agent/push_loop_mtr_traces_edge.go:271— agent.buildScheduledMtrTrace has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoveryStorageInventory.scanGeneration (cognitive 39) go/pkg/edge/spool/recovery_inventory.go:200— RecoveryStorageInventory.scanGeneration has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 6, 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.
Spool.quarantine (cognitive 39) go/pkg/edge/spool/quarantine.go:179— Spool.quarantine has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 5 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 14). Of this number, 33 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). None of this is in the body itself: all 39 points belong 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:302— 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:987— 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:717— 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.
spool.collectRecoveryArchive (cognitive 38) go/pkg/edge/spool/recovery_archive.go:208— spool.collectRecoveryArchive has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 5, loops 5 (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.
LaneSet.createGeneration (cognitive 38) go/pkg/edge/spool/lanes.go:672— LaneSet.createGeneration has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 3 (nesting depth added 9). Of this number, 36 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.
RecoveryOperation.SealCoverage (cognitive 38) go/pkg/edge/spool/recovery_coverage.go:38— RecoveryOperation.SealCoverage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (34 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.
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.runDiscoveryJob (cognitive 38) go/pkg/mapper/discovery_run.go:25— DiscoveryEngine.runDiscoveryJob has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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.
natsutil.RevokeUnauthorizedLocalClients (cognitive 38) go/pkg/natsutil/local_certificate_revocation.go:46— natsutil.RevokeUnauthorizedLocalClients has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 3 (4 pts), boolean chains 3 (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.
managed.mergeManagedConfiguration (cognitive 38) js/cli/src/edge/managed.ts:206— managed.mergeManagedConfiguration has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 4 (10 pts), boolean chains 7 (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.
renderLayers (cognitive 38) elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:230— renderLayers has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 7, loops 4 (7 pts), ternaries 4 (6 pts), other 1 (nesting depth added 15). Of this number, 34 points are the body's own statements and 4 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_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:76— 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:477— 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 503). 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.
Spool.recover (cognitive 37) go/pkg/edge/spool/recover.go:63— Spool.recover has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, loops 4 (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.
_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.
PluginFleet.row (cognitive 36) elixir/web-ng/lib/serviceradar_web_ng/plugins/plugin_fleet.ex:495— PluginFleet.row has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31, 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.buildLaunchBody (cognitive 36) go/cmd/wasm-plugins/awx/main.go:1276— 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.buildSweepMetricBatchFromMap (cognitive 36) go/pkg/agent/metric_envelope.go:387— agent.buildSweepMetricBatchFromMap 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:468— 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.
edgerecord.ValidateAck (cognitive 36) go/pkg/edge/edgerecord/validate.go:1252— edgerecord.ValidateAck has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 6, match/switch 1 (2 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.
scan.computeRingLayout (cognitive 36) REDACTED:586— scan.computeRingLayout has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). Of this number, 35 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.
renderSubLayers (cognitive 36) elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:328— renderSubLayers has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15, boolean chains 14, if/else 7. Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 17 function items inside it that branch (healthColor, shownEdge, getColor, …). 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.
AnalyticsSignals.do_process_batch (cognitive 35) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:129— AnalyticsSignals.do_process_batch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 5 (12 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.consumeLaunchPreflightJSONValue (cognitive 35) go/cmd/wasm-plugins/awx/launch_preflight.go:1234— 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:1600— 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:680— 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.
systemHost.commitPrivilegedUnitInstall (cognitive 35) go/pkg/agent/addon_systemd.go:502— systemHost.commitPrivilegedUnitInstall has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 4 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). Of this number, 30 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.
cameraRelayManager.runSession (cognitive 35) go/pkg/agent/camera_relay.go:317— cameraRelayManager.runSession has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 16). Of this number, 24 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.
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.
buildNodeAndLabelLayers (cognitive 35) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:566— buildNodeAndLabelLayers has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 13, boolean chains 10, if/else 5 (8 pts), loops 2 (3 pts), other 1 (nesting depth added 4). Of this number, 27 points are the body's own statements and 8 belong to 24 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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.
PluginResultIngestor.do_insert_status (cognitive 34) elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:237— PluginResultIngestor.do_insert_status has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 4 (11 pts) (nesting depth added 20). 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.decodeDishDiagnostics (cognitive 34) go/cmd/wasm-plugins/starlink/local.go:167— main.decodeDishDiagnostics has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 10, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
spool.InventoryRecoveryStorage (cognitive 34) go/pkg/edge/spool/recovery_inventory.go:85— spool.InventoryRecoveryStorage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 4, loops 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoveryOperation.readCoverage (cognitive 34) go/pkg/edge/spool/recovery_coverage.go:158— RecoveryOperation.readCoverage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 5, loops 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.
DiscoveryEngine.querySingleUniFiAPI (cognitive 34) go/pkg/mapper/ubnt_poller.go:166— 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.
exposure-reconciliation-audit.openspec.html.Archify.routeProbe (cognitive 34) docs/architecture/exposure-reconciliation-audit.openspec.html:14078— exposure-reconciliation-audit.openspec.html.Archify.routeProbe has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 12 (13 pts), ternaries 3 (4 pts), error handling 1 (nesting depth added 2). None of this is in the body itself: all 34 points belong to 13 function items inside it that branch (exportSnapshot, a function literal at line 14273, stopJourneyTimer, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.routeProbe (cognitive 34) docs/architecture/exposure-source-validation.openspec.html:13333— exposure-source-validation.openspec.html.Archify.routeProbe has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 12 (13 pts), ternaries 3 (4 pts), error handling 1 (nesting depth added 2). None of this is in the body itself: all 34 points belong to 13 function items inside it that branch (exportSnapshot, a function literal at line 13528, stopJourneyTimer, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
expression (cognitive 34) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:346— expression has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 12, ternaries 2 (3 pts) (nesting depth added 5). Of this number, 33 points are the body's own statements and 1 belongs 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.
handlePick (cognitive 34) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:353— 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.
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 (a function literal at line 111, formatValue, formatBytes, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:117— 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.
CertRenewalManager.Run (cognitive 33) go/pkg/agent/cert_renewal.go:162— CertRenewalManager.Run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 2 (6 pts), boolean chains 1, loops 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.
pluginExecution.hostWebSocketConnect (cognitive 33) go/pkg/agent/plugin_runtime_network.go:354— 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.
edgerecord.ValidateSweepAssignmentRecord (cognitive 33) go/pkg/edge/edgerecord/assignment.go:110— edgerecord.ValidateSweepAssignmentRecord has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 9 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Spool.Health (cognitive 33) go/pkg/edge/spool/health.go:60— Spool.Health has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 5, 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.
Spool.commit (cognitive 33) go/pkg/edge/spool/spool.go:477— Spool.commit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 3 (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.
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:282— 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 items inside it that branch (framePayloadBytes, writeBytes, encodedFrame, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
handleDetailsPanelClick (cognitive 33) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:207— 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.
ManagedCertificateLifecycle.confirm_use (cognitive 32) elixir/serviceradar_core/lib/serviceradar/edge/managed_certificate_lifecycle.ex:132— ManagedCertificateLifecycle.confirm_use has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 2 (5 pts) (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.buildDiscovery (cognitive 32) go/cmd/wasm-plugins/starlink/discovery.go:19— main.buildDiscovery has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
managedCertificateStore.install (cognitive 32) go/pkg/agent/managed_certificates_linux.go:454— managedCertificateStore.install has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 7, 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.
Spool.ScanFrom (cognitive 32) go/pkg/edge/spool/spool.go:856— Spool.ScanFrom has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1, loops 1 (nesting depth added 16). 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.
exposure-reconciliation-audit.openspec.html.Archify.intentTrace (cognitive 32) docs/architecture/exposure-reconciliation-audit.openspec.html:10126— exposure-reconciliation-audit.openspec.html.Archify.intentTrace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 10, ternaries 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (show, clear, nodeLabel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.Archify.intentTrace (cognitive 32) docs/architecture/exposure-source-validation.openspec.html:9381— exposure-source-validation.openspec.html.Archify.intentTrace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 10, ternaries 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (show, clear, nodeLabel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 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.
createDeckInstance (cognitive 32) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:562— createDeckInstance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 4 (9 pts), boolean chains 4 (nesting depth added 8). None of this is in the body itself: all 32 points belong to 11 function items inside it that branch (onError, onViewStateChange::applyViewState, onViewStateChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
receive (cognitive 32) elixir/web-ng/assets/js/lib/god_view/world_membership.js:44— receive has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1, other 1 (nesting depth added 9). Of this number, 31 points are the body's own statements and 1 belongs 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.
main.newRunfileResolver (cognitive 31) build/release/publish_packages.go:1071— 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:1325— 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:895— 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) go/pkg/agent/plugin_runtime_http.go:96— 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.
PushLoop.applyConfigResponseWithSequence (cognitive 31) go/pkg/agent/push_loop_config.go:152— PushLoop.applyConfigResponseWithSequence has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 4 (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.
RecoveryCoordinator.publish (cognitive 31) go/pkg/agent/recovery_transport.go:20— RecoveryCoordinator.publish has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 2, 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.
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.
Spool.observeAttribution (cognitive 31) go/pkg/edge/spool/attribution_commit.go:385— Spool.observeAttribution has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Spool.reclaimLocked (cognitive 31) go/pkg/edge/spool/reclaim.go:185— Spool.reclaimLocked has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 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, 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.
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.
decodeWorldTile (cognitive 31) elixir/web-ng/assets/js/lib/god_view/world_tile_decode.js:39— decodeWorldTile has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (10 pts), loops 6 (7 pts), if/else 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.
AgentCommandBus.validate_preallocated_transmit_payload (cognitive 30) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_bus.ex:2771— 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.
main.tokenExpiryFromMap (cognitive 30) go/cmd/wasm-plugins/awx/main.go:2472— main.tokenExpiryFromMap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (7 pts), boolean chains 2 (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.
runConfig.applyModeDefaults (cognitive 30) go/cmd/tools/mapper-baseline/main.go:411— runConfig.applyModeDefaults has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 1, 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.
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.
RemoteAccessSSHConsole.Component::openSession (cognitive 30) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:922— RemoteAccessSSHConsole.Component::openSession has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, ternaries 3 (4 pts), error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (RemoteAccessSSHConsole.Component) 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.
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). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 6 function items inside it that branch (handleTCPFrame, a function literal at line 121, a function literal at line 64, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1014— 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.
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.
RemoteAccessStreamHandler.credential_broker_opts (cognitive 29) elixir/web-ng/lib/serviceradar_web_ng_web/channels/remote_access_stream_handler.ex:482— 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:854— 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.decodeRunningConfigBody (cognitive 29) go/cmd/wasm-plugins/opentext-nom/config_retrieve.go:196— main.decodeRunningConfigBody has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.parseGRPCUnaryRequest (cognitive 29) go/pkg/agent/plugin_runtime_grpc.go:493— agent.parseGRPCUnaryRequest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 5, match/switch 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.
agent.trustedProxmoxSSHTimeout (cognitive 29) go/pkg/agent/plugin_runtime_host_authority.go:2157— 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 2165). 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:886— 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.
managedCertificateStore.bootstrapLocalNATS (cognitive 29) go/pkg/agent/managed_local_nats_linux.go:82— managedCertificateStore.bootstrapLocalNATS has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
edgerecord.validateSweepSummaries (cognitive 29) go/pkg/edge/edgerecord/domain.go:460— edgerecord.validateSweepSummaries has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (27 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.
RecoveryGrant.restoreArtifacts (cognitive 29) go/pkg/edge/spool/reserve_resume.go:135— RecoveryGrant.restoreArtifacts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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.
ExposureSnapshotIngestion.apply_retained (cognitive 28) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_snapshot_ingestion.ex:180— ExposureSnapshotIngestion.apply_retained has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 3 (6 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.
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:660— 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:869— 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.
managedCertificateStore.validateAssignment (cognitive 28) go/pkg/agent/managed_certificates_linux.go:203— managedCertificateStore.validateAssignment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runOverrideStore.recordActionResult (cognitive 28) go/pkg/agent/plugin_runtime_overrides.go:227— runOverrideStore.recordActionResult has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 3 (6 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.
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.
LaneSet.recoverLane (cognitive 28) go/pkg/edge/spool/lanes.go:837— LaneSet.recoverLane has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (nesting depth added 13). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoveryCompletion.Finish (cognitive 28) go/pkg/edge/spool/recovery_completion.go:405— RecoveryCompletion.Finish has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 4, loops 3 (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.
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:155— 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.
doctor.doctorCommand (cognitive 28) js/cli/src/doctor.ts:34— doctor.doctorCommand has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), ternaries 3 (6 pts), error handling 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.
renderSvgFallback (cognitive 28) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1812— 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, a function literal at line 1881, a function literal at line 1915, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_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 (a function literal at line 214, colorFor, a function literal at line 237, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ManagedComponentRegistration.do_register (cognitive 27) elixir/serviceradar_core/lib/serviceradar/edge/managed_component_registration.ex:35— ManagedComponentRegistration.do_register has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, 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.
MergeEngine.do_merge_devices (cognitive 27) elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:441— MergeEngine.do_merge_devices has cognitive complexity 27 (threshold 15). Drivers by points: if/else 26, 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.listAWXPathBounded (cognitive 27) go/cmd/wasm-plugins/awx/main.go:2610— 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.parseSystemdUnitStatusOutputForUnit (cognitive 27) go/pkg/agent/push_loop_capabilities.go:1026— agent.parseSystemdUnitStatusOutputForUnit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5, match/switch 2 (3 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.
agent.spoolEdgeMetrics (cognitive 27) go/pkg/agent/push_loop_metrics_edge.go:350— agent.spoolEdgeMetrics has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, loops 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.
agent.newSweepEdgeProducer (cognitive 27) go/pkg/agent/sweep_edge_producer.go:333— agent.newSweepEdgeProducer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (9 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.
otlpRelayPump.prepareEdgeRelayFrame (cognitive 27) go/pkg/agent/addon_otlp_relay_edge.go:142— otlpRelayPump.prepareEdgeRelayFrame has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2, boolean chains 1 (nesting depth added 10). Of this number, 23 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.
PushLoop.controlStreamLoop (cognitive 27) go/pkg/agent/control_stream.go:229— PushLoop.controlStreamLoop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 15). Of this number, 17 points are the body's own statements and 10 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.
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.
LaneSet.recoveryDestination (cognitive 27) go/pkg/edge/spool/recovery_generation.go:67— LaneSet.recoveryDestination has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (26 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.
RecoveryOperation.ReclaimSource (cognitive 27) go/pkg/edge/spool/recovery_reclaim.go:27— RecoveryOperation.ReclaimSource has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 2 (nesting depth added 4). Of this number, 17 points are the body's own statements and 10 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.
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:159— 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.
WorldMapRenderer.openScene (cognitive 27) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:754— WorldMapRenderer.openScene has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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, a function literal at line 173, touch, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
PluginIntegrationProvisioner.bind_schedule (cognitive 26) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:238— PluginIntegrationProvisioner.bind_schedule has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 5 (12 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.
ExposureSnapshotIngestion.resume (cognitive 26) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_snapshot_ingestion.ex:308— ExposureSnapshotIngestion.resume has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 5 (11 pts), boolean chains 1 (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.
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.
MediaUpload.upload_once (cognitive 26) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_recording/media_upload.ex:29— MediaUpload.upload_once has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), 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.
FirstPartyReleaseClient.fetch_binary_asset (cognitive 26) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_release_client.ex:221— FirstPartyReleaseClient.fetch_binary_asset has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
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.
Collector.runInterfaceChecks (cognitive 26) go/cmd/wasm-plugins/opentext-nom/config_check.go:356— Collector.runInterfaceChecks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.runTelemetry (cognitive 26) go/cmd/wasm-plugins/starlink/plugin.go:119— main.runTelemetry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 4 (5 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.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:913— 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:94— 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.
remoteaccess.destinationSymlinkFacts (cognitive 26) go/pkg/agent/remoteaccess/sftp.go:232— remoteaccess.destinationSymlinkFacts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 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.
edgerecord.ValidateFrameSigned (cognitive 26) go/pkg/edge/edgerecord/validate.go:340— edgerecord.ValidateFrameSigned has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (24 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.
edgerecord.ValidateDeliveryFrame (cognitive 26) go/pkg/edge/edgerecord/validate.go:946— edgerecord.ValidateDeliveryFrame has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (25 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.
spool.validateRecoveryPlan (cognitive 26) go/pkg/edge/spool/recovery_plan.go:105— spool.validateRecoveryPlan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, 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.knownDeviceIPv4Set (cognitive 26) go/pkg/mapper/snmp_l2_bridge.go:376— 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.
LocalCertificateAuthorizer.Authorize (cognitive 26) go/pkg/natsutil/certificate_authorization.go:61— LocalCertificateAuthorizer.Authorize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
topology_atlas_nif::model::normalize (cognitive 26) elixir/serviceradar_core/native/topology_atlas_nif/src/model.rs:558— topology_atlas_nif::model::normalize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exposure-reconciliation-audit.openspec.html.applyJourneyState (cognitive 26) docs/architecture/exposure-reconciliation-audit.openspec.html:14562— exposure-reconciliation-audit.openspec.html.applyJourneyState has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 11, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 14570, 14586, 14578). 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.
exposure-source-validation.openspec.html.applyJourneyState (cognitive 26) docs/architecture/exposure-source-validation.openspec.html:13817— exposure-source-validation.openspec.html.applyJourneyState has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 11, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 13825, 13841, 13833). 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 (cognitive 26) elixir/web-ng/assets/js/lib/god_view/layout_topology_state_methods.js:198— 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 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.
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.
dev.watchProjectForValidation (cognitive 26) js/cli/src/dashboard/dev.ts:385— 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 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.
deterministicRelationPresentation (cognitive 26) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:119— deterministicRelationPresentation has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (8 pts), ternaries 4 (8 pts), other 1 (nesting depth added 7). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 143, a function literal at line 120, (anonymous)::serializedDetails). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
ControllerProvenance.exact_command_payload (cognitive 25) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:601— 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.
ArchiveAuthorities.do_revoke (cognitive 25) elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:145— ArchiveAuthorities.do_revoke has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (10 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.
PluginIntegrationProvisioner.upsert_assignment (cognitive 25) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:154— 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.
ManagedCertificateLifecycle.advance (cognitive 25) elixir/serviceradar_core/lib/serviceradar/edge/managed_certificate_lifecycle.ex:322— ManagedCertificateLifecycle.advance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (4 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.
NatsLeafConfigGenerator.generate_config (cognitive 25) elixir/serviceradar_core/lib/serviceradar/edge/nats_leaf_config_generator.ex:49— NatsLeafConfigGenerator.generate_config has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, 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.
ExposureSnapshotFinalizer.scan (cognitive 25) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_finalizer.ex:31— ExposureSnapshotFinalizer.scan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (6 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.
Manifest.validate_producer_schedule (cognitive 25) elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1455— Manifest.validate_producer_schedule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10, match/switch 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.
AddonFleet.build_row (cognitive 25) elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_fleet.ex:416— AddonFleet.build_row has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 21, 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.
BitmapQueries.query (cognitive 25) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_queries.ex:236— BitmapQueries.query has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (7 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:66— 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:3164— 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:3247— 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:279— 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:434— 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:507— 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:226— 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:653— 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.
edgerecord.joinSweepAuthority (cognitive 25) go/pkg/edge/edgerecord/domain.go:1229— edgerecord.joinSweepAuthority has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (23 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.
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.
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.
prefix_tags_nif::catalog::walk (cognitive 25) elixir/serviceradar_core/native/prefix_tags_nif/src/catalog.rs:212— prefix_tags_nif::catalog::walk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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.
syncMembership (cognitive 25) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:565— syncMembership has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 10, error handling 1. Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 587, 577, 601, …). 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.
wireSidePanel (cognitive 25) js/cli/harness/dev.js:406— 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.
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.
ArchiveAuthorities.do_apply (cognitive 24) elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:123— ArchiveAuthorities.do_apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 2 (3 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.
SRQL.execute_query (cognitive 24) elixir/web-ng/lib/serviceradar_web_ng/srql.ex:98— SRQL.execute_query has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 4 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Events.event_query (cognitive 24) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/audit_live/events.ex:211— Events.event_query has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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:1149— 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:403— 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:325— 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.
agent.newSweepLeaseStore (cognitive 24) go/pkg/agent/sweep_lease.go:208— agent.newSweepLeaseStore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (5 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.
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.
PushLoop.serveManagedLocalNATS (cognitive 24) go/pkg/agent/managed_local_nats_linux.go:577— PushLoop.serveManagedLocalNATS has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). 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 into named stages: move each independent 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:348— 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.
SweepService.GetSweepResults (cognitive 24) go/pkg/agent/sweep_service.go:504— SweepService.GetSweepResults has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8 (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.
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.
edgerecord.validateScheduledMtrTraceEvent (cognitive 24) go/pkg/edge/edgerecord/scheduled_mtr.go:96— edgerecord.validateScheduledMtrTraceEvent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 9, 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.
spool.RepairRecoveryPhases (cognitive 24) go/pkg/edge/spool/recovery_phase.go:194— spool.RepairRecoveryPhases has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4, boolean chains 3, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoveryOperation.prepareCompletion (cognitive 24) go/pkg/edge/spool/recovery_completion.go:87— RecoveryOperation.prepareCompletion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 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.
Spool.writeCopyTail (cognitive 24) go/pkg/edge/spool/recovery_copy.go:264— Spool.writeCopyTail has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 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.
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.
CoreServiceConfig.Validate (cognitive 24) REDACTED:386— CoreServiceConfig.Validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
sysmon.firstUsableIPv4FromInventory (cognitive 24) go/pkg/sysmon/host.go:69— sysmon.firstUsableIPv4FromInventory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
CatalogBuild::resume (cognitive 24) elixir/serviceradar_core/native/prefix_tags_nif/src/catalog.rs:96— CatalogBuild::resume has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 2, 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.
exposure-reconciliation-audit.openspec.html.Archify.focus (cognitive 24) docs/architecture/exposure-reconciliation-audit.openspec.html:8689— exposure-reconciliation-audit.openspec.html.Archify.focus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 3, loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (computeReachability, a function literal at line 8741, a function literal at line 8757, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.placeRelationshipLens (cognitive 24) docs/architecture/exposure-reconciliation-audit.openspec.html:9699— exposure-reconciliation-audit.openspec.html.placeRelationshipLens has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, ternaries 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 5 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, 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.
exposure-source-validation.openspec.html.Archify.focus (cognitive 24) docs/architecture/exposure-source-validation.openspec.html:7944— exposure-source-validation.openspec.html.Archify.focus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 3, loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (computeReachability, a function literal at line 7996, a function literal at line 8012, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.placeRelationshipLens (cognitive 24) docs/architecture/exposure-source-validation.openspec.html:8954— exposure-source-validation.openspec.html.placeRelationshipLens has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, ternaries 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 5 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, 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.packageCreateCommand (cognitive 24) js/cli/src/edge/packages.ts:48— packages.packageCreateCommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
renderPrefixTag (cognitive 24) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:300— renderPrefixTag has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (8 pts), error handling 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 10 function items inside it that branch (load, a function literal at line 308, a function literal at line 330, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_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.
createHarnessCameraApi.open (cognitive 24) js/cli/harness/camera.js:53— createHarnessCameraApi.open has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 2, loops 1, other 1. Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 12 function items inside it that branch (attach, animate, relaySessionId, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:675— 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.
World.activate_relayout (cognitive 23) elixir/serviceradar_core/lib/serviceradar/network_discovery/world.ex:243— World.activate_relayout has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
main.extractAnsibleHostsFromVariables (cognitive 23) go/cmd/wasm-plugins/awx/main.go:4033— main.extractAnsibleHostsFromVariables has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). Of this number, 21 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.
main.decodeRow (cognitive 23) go/cmd/wasm-plugins/starlink/telemetry.go:233— main.decodeRow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
builder.build (cognitive 23) build/packaging/agent/macos/package.go:206— 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.
agent.applyStagedAddonRuntimeConfig (cognitive 23) go/pkg/agent/addon_activation.go:377— agent.applyStagedAddonRuntimeConfig 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.
PluginManager.ApplyConfig (cognitive 23) go/pkg/agent/plugin_runtime_manager.go:183— 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.
PushLoop.configApplyFailureStatuses (cognitive 23) go/pkg/agent/config_section_state.go:661— PushLoop.configApplyFailureStatuses has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (6 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.
PushLoop.monitorReleaseActivation (cognitive 23) go/pkg/agent/push_loop_enroll.go:239— PushLoop.monitorReleaseActivation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (2 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.
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.
spool.BeginRecoveryOperation (cognitive 23) go/pkg/edge/spool/recovery_begin.go:20— spool.BeginRecoveryOperation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 4, loops 1 (nesting depth added 2). Of this number, 12 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.
recoveryArchiveWriter.write (cognitive 23) go/pkg/edge/spool/recovery_archive.go:356— recoveryArchiveWriter.write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 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.
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.Run (cognitive 23) go/pkg/mtr/tracer.go:230— Tracer.Run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5 (nesting depth added 4). Of this number, 16 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.
ICMPSweeper.processResults (cognitive 23) go/pkg/scan/icmp_scanner_unix.go:763— 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.
NetworkSweeper.runSweep (cognitive 23) go/pkg/sweeper/sweeper_run.go:248— NetworkSweeper.runSweep has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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_cert_policy::nats::monitor (cognitive 23) rust/cert-policy/src/nats.rs:293— serviceradar_cert_policy::nats::monitor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 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.
HealthIndex::apply (cognitive 23) rust/topology-atlas/src/health.rs:212— HealthIndex::apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (7 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.
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:298— 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.
bitmap_frame.decodeBitmapFrame (cognitive 23) elixir/web-ng/assets/js/lib/god_view/bitmap_frame.js:55— bitmap_frame.decodeBitmapFrame has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (11 pts), boolean chains 6, if/else 3 (5 pts), ternaries 1 (nesting depth added 8). 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.
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.
camera.createHarnessCameraApi.open (cognitive 23) js/cli/harness/camera.js:53— camera.createHarnessCameraApi.open has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 2, loops 1. Of this number, 18 points are the body's own statements and 5 belong to 3 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.
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 105). 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.
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.
update (cognitive 23) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:122— update has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 7, if/else 3, loops 1, other 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.
normalizeEventFilter (cognitive 23) js/cli/harness/runtime.js:53— normalizeEventFilter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, 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.
(anonymous) (cognitive 23) elixir/web-ng/assets/camera_codec_capability.playwright.js:27— (anonymous) has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (6 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 30, (anonymous)::onaudioprocess, (anonymous)::presented, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stateReasonForNode (cognitive 23) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:22— 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.
AwxMembershipReconciler.upsert_membership (cognitive 22) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:610— AwxMembershipReconciler.upsert_membership has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CallbackCommandContract.broker_matches? (cognitive 22) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_contract.ex:446— 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.
RecorderOwnership.acquire (cognitive 22) elixir/serviceradar_core/lib/serviceradar/camera/recorder_ownership.ex:32— RecorderOwnership.acquire has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 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.
MergeEngine.recreate_device (cognitive 22) elixir/serviceradar_core/lib/serviceradar/inventory/identity/merge_engine.ex:1291— MergeEngine.recreate_device has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (5 pts), boolean chains 4 (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.
WorldWorker.ensure_scheduled (cognitive 22) elixir/serviceradar_core/lib/serviceradar/network_discovery/world_worker.ex:32— WorldWorker.ensure_scheduled has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (8 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.
ProxmoxHostAuthority.canonical_origin (cognitive 22) elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:656— 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:450— 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.
Index.mount (cognitive 22) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex:32— Index.mount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), 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.
main.normalizeLaunchPreflightAddress (cognitive 22) go/cmd/wasm-plugins/awx/launch_preflight.go:565— 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.runInventorySyncController (cognitive 22) go/cmd/wasm-plugins/awx/main.go:3800— main.runInventorySyncController has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 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.
main.decodeWifiDiagnostics (cognitive 22) go/cmd/wasm-plugins/starlink/local.go:253— main.decodeWifiDiagnostics has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 7, match/switch 2 (6 pts), if/else 3 (5 pts), 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.drainTelemetry (cognitive 22) go/cmd/wasm-plugins/starlink/telemetry.go:411— main.drainTelemetry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (7 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.mergeRunGroup (cognitive 22) go/cmd/tools/ubuntu-feed-merge/main.go:721— 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 735). 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:836— 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:1588— 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.pluginResultItemFromPayload (cognitive 22) go/pkg/agent/plugin_result_convert.go:34— agent.pluginResultItemFromPayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (6 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.
agent.proxyProxmoxConsoleSSHInput (cognitive 22) go/pkg/agent/proxmox_console_ssh.go:217— 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.
SweepService.runLeaseToSpool (cognitive 22) go/pkg/agent/sweep_edge_producer.go:107— SweepService.runLeaseToSpool has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). Of this number, 21 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.
client.enrichAssetFields (cognitive 22) go/pkg/agent/syncsources/armis/asset_enrichment.go:210— 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:692— 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.
edgerecord.ValidateSweepExecutionEvent (cognitive 22) go/pkg/edge/edgerecord/domain.go:162— edgerecord.ValidateSweepExecutionEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5 (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.
edgerecord.recoveryControlBody (cognitive 22) go/pkg/edge/edgerecord/recovery.go:646— edgerecord.recoveryControlBody has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
edgerecord.AppliedThroughSequence (cognitive 22) go/pkg/edge/edgerecord/recovery.go:781— edgerecord.AppliedThroughSequence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, 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.
edgerecord.SweepCheckSetRun (cognitive 22) go/pkg/edge/edgerecord/sweep_lease_check_sets.go:164— edgerecord.SweepCheckSetRun has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 2, 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.
models.DeepCopyHostResult (cognitive 22) go/pkg/models/sweep.go:186— 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.
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:285— 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.
NetflowStackedAreaChart.renderTotalOverlays (cognitive 22) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:537— 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 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.
install.acceptLocalOnboarding (cognitive 22) js/cli/src/edge/install.ts:152— install.acceptLocalOnboarding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity· mount (cognitive 22) · ×1
mount (cognitive 22) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:115— mount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 7, loops 1, other 1, ternaries 1. Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 23 function items inside it that branch (onDeviceInitialized, a function literal at line 164, onLocationHistory, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buildMtrPathEdgeDataUncached (cognitive 22) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:330— buildMtrPathEdgeDataUncached has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7, boolean chains 6, if/else 4 (5 pts), other 3, loops 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 338, 372). 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.
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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
AWXResultProjection.do_project (cognitive 21) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_result_projection.ex:68— AWXResultProjection.do_project has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (2 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.
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.
CompiledAssignmentValidate.structure (cognitive 21) elixir/serviceradar_core/lib/serviceradar/edge/compiled_assignment_validate.ex:159— CompiledAssignmentValidate.structure has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 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.
RecoveryOperations.consume_control (cognitive 21) elixir/serviceradar_core/lib/serviceradar/edge/recovery_operations.ex:231— RecoveryOperations.consume_control 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.
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.
ExposureSnapshotFinalizer.settle (cognitive 21) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_finalizer.ex:98— ExposureSnapshotFinalizer.settle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyncRunLedger.receipt_attrs (cognitive 21) elixir/serviceradar_core/lib/serviceradar/inventory/sync_run_ledger.ex:168— SyncRunLedger.receipt_attrs has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, 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.
main.isProbablyIP (cognitive 21) go/cmd/wasm-plugins/awx/main.go:4089— 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:74— 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:375— 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.
edgeLaneSender.runSource (cognitive 21) go/cmd/agent/edge_record_sender.go:210— edgeLaneSender.runSource has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (21 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.
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.stageAgentRelease (cognitive 21) REDACTED:253— 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.fetchVerifiedWasm (cognitive 21) go/pkg/agent/plugin_runtime_wazero.go:309— PluginManager.fetchVerifiedWasm 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:806— 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.
RecoveryDelivery.RenewDeliveryGrants (cognitive 21) go/pkg/agent/recovery_transport.go:237— RecoveryDelivery.RenewDeliveryGrants has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (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.
cli.RunEdgePackageList (cognitive 21) go/pkg/cli/edge_onboarding.go:309— 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.
edgerecord.zstdFrameLen (cognitive 21) go/pkg/edge/edgerecord/compression.go:198— edgerecord.zstdFrameLen has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 2 (3 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.
RecoveryCompletion.collectTransient (cognitive 21) go/pkg/edge/spool/recovery_completion.go:544— RecoveryCompletion.collectTransient has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (nesting depth added 9). Of this number, 17 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.
Spool.resync (cognitive 21) go/pkg/edge/spool/recover.go:609— Spool.resync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 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.
grpc.extractKeyPairFromBundle (cognitive 21) go/pkg/grpc/security.go:484— grpc.extractKeyPairFromBundle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:303— 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.
serviceradar_trapd::main (cognitive 21) rust/trapd/src/main.rs:81— serviceradar_trapd::main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 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.
exposure-reconciliation-audit.openspec.html.applyReachability (cognitive 21) docs/architecture/exposure-reconciliation-audit.openspec.html:8852— exposure-reconciliation-audit.openspec.html.applyReachability has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, boolean chains 7, error handling 1 (2 pts), ternaries 2 (nesting depth added 1). Of this number, 14 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.
exposure-reconciliation-audit.openspec.html.Archify.viewerChromeLayout::measure (cognitive 21) docs/architecture/exposure-reconciliation-audit.openspec.html:12408— exposure-reconciliation-audit.openspec.html.Archify.viewerChromeLayout::measure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (6 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.
exposure-source-validation.openspec.html.applyReachability (cognitive 21) docs/architecture/exposure-source-validation.openspec.html:8107— exposure-source-validation.openspec.html.applyReachability has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, boolean chains 7, error handling 1 (2 pts), ternaries 2 (nesting depth added 1). Of this number, 14 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.
exposure-source-validation.openspec.html.Archify.viewerChromeLayout::measure (cognitive 21) docs/architecture/exposure-source-validation.openspec.html:11663— exposure-source-validation.openspec.html.Archify.viewerChromeLayout::measure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (6 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.
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.
requestTopologyProfileLayout (cognitive 21) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:464— 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.
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.
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.
_draw (cognitive 21) elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:118— _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 8 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.
browserModuleApi (cognitive 21) js/cli/harness/harness.js:95— 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 19 function items inside it that branch (pushQuery, frameBytes, resolveFrame, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mountBitmapGpuHarness::fetch (cognitive 21) elixir/web-ng/assets/god_view_bitmap_gpu_harness.js:89— mountBitmapGpuHarness::fetch has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 7, 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.
decodeSnapshotTable (cognitive 21) elixir/web-ng/assets/js/lib/god_view/snapshot_columns.js:289— decodeSnapshotTable has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 4 (5 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 13 function items inside it that branch (edgeDetailsAndMetadata, nodeDetails, nodeDetail, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AwxClient.valid_launch_args? (cognitive 20) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_client.ex:1288— 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.
ExposureSnapshotIngestion.settle_plan (cognitive 20) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_snapshot_ingestion.ex:130— ExposureSnapshotIngestion.settle_plan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 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.
ExposureTransitions.lifecycle (cognitive 20) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/exposure_transitions.ex:136— ExposureTransitions.lifecycle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 pts), 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.
EndpointVulnerabilityAdjudicator.version_scope_parent_context? (cognitive 20) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_adjudicator.ex:533— 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:1402— 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.
ExposureReconciliationWorker.enumerate (cognitive 20) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_reconciliation_worker.ex:51— ExposureReconciliationWorker.enumerate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 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.
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.
FirstPartyImporter.import (cognitive 20) elixir/web-ng/lib/serviceradar_web_ng/plugins/first_party_importer.ex:133— FirstPartyImporter.import has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, 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.
NativeAddonSync.sync_import (cognitive 20) elixir/web-ng/lib/serviceradar_web_ng/plugins/native_addon_sync.ex:281— NativeAddonSync.sync_import has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (8 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.
CatalogLive.handle_event (cognitive 20) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/catalog_live.ex:879— CatalogLive.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:229— 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:1940— 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.runtimeRetrieveDevices (cognitive 20) go/cmd/wasm-plugins/opentext-nom/runtime_config.go:20— main.runtimeRetrieveDevices has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:140— 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.
main.pollEdgeRecovery (cognitive 20) go/cmd/agent/edge_recovery.go:69— main.pollEdgeRecovery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.runPushMode (cognitive 20) go/cmd/agent/main.go:159— main.runPushMode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.run (cognitive 20) go/cmd/tools/bazel-reclaim/main.go:46— main.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.parseProtoSNMPConfig (cognitive 20) REDACTED:734— agent.parseProtoSNMPConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
managedCertificatePolicyStore.install (cognitive 20) go/pkg/agent/managed_certificate_policy_linux.go:76— managedCertificatePolicyStore.install has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 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.
PluginManager.credentialBrokerCacheDecision (cognitive 20) go/pkg/agent/plugin_runtime_http.go:517— PluginManager.credentialBrokerCacheDecision has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 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.
PushLoop.pushSweepResults (cognitive 20) go/pkg/agent/push_loop_sweep_results.go:33— PushLoop.pushSweepResults has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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.
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.
edgerecord.ValidateCompiledSweepAssignment (cognitive 20) go/pkg/edge/edgerecord/compiled_assignment.go:198— edgerecord.ValidateCompiledSweepAssignment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
edgerecord.validateExecutionGrantClaims (cognitive 20) go/pkg/edge/edgerecord/compiled_assignment.go:868— edgerecord.validateExecutionGrantClaims has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, 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.
edgerecord.helloCapabilitySet (cognitive 20) go/pkg/edge/edgerecord/hello_capabilities.go:61— edgerecord.helloCapabilitySet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edgerecord.ValidateHeaderSet (cognitive 20) go/pkg/edge/edgerecord/publication_identity.go:733— edgerecord.ValidateHeaderSet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
edgerecord.validateSingleManifestPage (cognitive 20) go/pkg/edge/edgerecord/recovery.go:698— edgerecord.validateSingleManifestPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, 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.
Sender.renewGrants (cognitive 20) go/pkg/edge/sender/grants.go:93— Sender.renewGrants has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
spool.RepairRecoveryCompletion (cognitive 20) go/pkg/edge/spool/recovery_completion.go:305— spool.RepairRecoveryCompletion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoveryOperation.RecordResolution (cognitive 20) go/pkg/edge/spool/recovery_reclaim.go:192— RecoveryOperation.RecordResolution has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 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.
Spool.initAttribution (cognitive 20) go/pkg/edge/spool/attribution.go:71— Spool.initAttribution has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 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.
Spool.ensureEvidence (cognitive 20) go/pkg/edge/spool/spool.go:691— Spool.ensureEvidence has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:121— 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:598— 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.
ArrowWriterHelper.swift.toFBType (cognitive 20) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowWriterHelper.swift:53— ArrowWriterHelper.swift.toFBType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 pts), match/switch 2 (4 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.
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.
exposure-reconciliation-audit.openspec.html.recordWebm (cognitive 20) docs/architecture/exposure-reconciliation-audit.openspec.html:7731— exposure-reconciliation-audit.openspec.html.recordWebm has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5, error handling 3, ternaries 2, loops 1. Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (createMotionScene::samplesFor, createMotionScene::pointInRoot, createMotionScene::authoredStep, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.syncViewFromHash (cognitive 20) docs/architecture/exposure-reconciliation-audit.openspec.html:11930— exposure-reconciliation-audit.openspec.html.syncViewFromHash has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, error handling 1 (nesting depth added 8). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 11942). 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.
exposure-reconciliation-audit.openspec.html.begin (cognitive 20) docs/architecture/exposure-reconciliation-audit.openspec.html:14857— exposure-reconciliation-audit.openspec.html.begin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, error handling 2 (5 pts), boolean chains 2, ternaries 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.
exposure-source-validation.openspec.html.recordWebm (cognitive 20) docs/architecture/exposure-source-validation.openspec.html:6986— exposure-source-validation.openspec.html.recordWebm has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5, error handling 3, ternaries 2, loops 1. Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (createMotionScene::samplesFor, createMotionScene::pointInRoot, createMotionScene::authoredStep, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.syncViewFromHash (cognitive 20) docs/architecture/exposure-source-validation.openspec.html:11185— exposure-source-validation.openspec.html.syncViewFromHash has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, error handling 1 (nesting depth added 8). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 11197). 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.
exposure-source-validation.openspec.html.begin (cognitive 20) docs/architecture/exposure-source-validation.openspec.html:14112— exposure-source-validation.openspec.html.begin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, error handling 2 (5 pts), boolean chains 2, ternaries 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.
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.
login.runWebPkceFlow (cognitive 20) js/cli/src/auth/login.ts:196— login.runWebPkceFlow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (6 pts), boolean chains 3, error handling 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.
_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.
handlePanMove (cognitive 20) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:138— 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.
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.
StreamLoad.retry_load (cognitive 19) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/stream_load.ex:90— StreamLoad.retry_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 5). 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.
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.
PublicationIdentity.decode_transport_provenance (cognitive 19) elixir/serviceradar_core/lib/serviceradar/edge/publication_identity.ex:428— PublicationIdentity.decode_transport_provenance 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.
HealthTracker.record_health_check (cognitive 19) elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex:237— HealthTracker.record_health_check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, match/switch 2 (3 pts) (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.
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.
HypervisorEnrichmentIngestor.persist_records (cognitive 19) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:330— HypervisorEnrichmentIngestor.persist_records has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17 (18 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.
Dispatcher.route (cognitive 19) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:353— 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:419— Loader.do_reload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 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.
BitmapIndex.handle_call (cognitive 19) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_index.ex:89— BitmapIndex.handle_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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.
MtrRuntime.load_traces (cognitive 19) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/mtr_runtime.ex:143— 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:387— 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) js/cli/ensure_k8s_node_alerts.py: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:1134— 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:1171— 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:1742— 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.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.enrichNodes (cognitive 19) go/cmd/wasm-plugins/proxmox/inventory_fetch.go:119— main.enrichNodes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 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.
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). None of this is in the body itself: all 19 points belong 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:942— 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.stageAddonArtifactWithClient (cognitive 19) go/pkg/agent/addon_activation.go:182— agent.stageAddonArtifactWithClient has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 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.selectHostInterfaceMACs (cognitive 19) go/pkg/agent/host_identity.go:225— agent.selectHostInterfaceMACs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 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.
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:392— 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.proxmoxInventoryPathAllowed (cognitive 19) go/pkg/agent/plugin_runtime_host_authority.go:969— agent.proxmoxInventoryPathAllowed has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 14, 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.dialProxmoxConsoleSSH (cognitive 19) go/pkg/agent/proxmox_console_ssh.go:270— 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.
agent.parseGatewaySweepConfig (cognitive 19) go/pkg/agent/sweep_config_gateway.go:122— agent.parseGatewaySweepConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.loadStoreEntry (cognitive 19) go/pkg/agent/sweep_lease.go:276— agent.loadStoreEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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.
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:327— 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:1044— 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.applySystemdAddonAtRoot (cognitive 19) go/pkg/agent/push_loop_addons.go:753— PushLoop.applySystemdAddonAtRoot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 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.
PushLoop.systemdAddonRuntimeReady (cognitive 19) go/pkg/agent/push_loop_addons.go:895— 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.
PushLoop.enrollOnce (cognitive 19) go/pkg/agent/push_loop_enroll.go:113— PushLoop.enrollOnce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
RecoveryCoordinator.publicationNeedsRefresh (cognitive 19) go/pkg/agent/recovery_transport.go:85— RecoveryCoordinator.publicationNeedsRefresh has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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.
remoteaccess.copyWithFileTransferQuota (cognitive 19) go/pkg/agent/remoteaccess/sftp.go:493— 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.
edgerecord.PlanMtrWindows (cognitive 19) go/pkg/edge/edgerecord/plan.go:530— edgerecord.PlanMtrWindows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edgerecord.SweepLeaseCheckSets (cognitive 19) go/pkg/edge/edgerecord/sweep_lease_check_sets.go:83— edgerecord.SweepLeaseCheckSets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), 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.
edgerecord.ValidateUnleasedSweepResultsBatch (cognitive 19) go/pkg/edge/edgerecord/unleased_sweep.go:48— edgerecord.ValidateUnleasedSweepResultsBatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edgerecord.ValidateRecord (cognitive 19) go/pkg/edge/edgerecord/validate.go:628— edgerecord.ValidateRecord has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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.
spool.checkRecoveryPhaseBudget (cognitive 19) go/pkg/edge/spool/recovery_phase.go:151— spool.checkRecoveryPhaseBudget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, 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.
LaneSet.appendWithAttribution (cognitive 19) go/pkg/edge/spool/lanes.go:412— LaneSet.appendWithAttribution has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 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.
RecoveryOperation.CapturePublicationAck (cognitive 19) go/pkg/edge/spool/recovery_publication.go:183— RecoveryOperation.CapturePublicationAck has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 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.
Spool.laneBytes (cognitive 19) go/pkg/edge/spool/reclaim.go:467— Spool.laneBytes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 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.
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.
mapper.filterBroadcastAddresses (cognitive 19) go/pkg/mapper/snmp_interface_ipaddr.go:421— mapper.filterBroadcastAddresses has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 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.
mapper.collectIPAddressTable (cognitive 19) go/pkg/mapper/snmp_interface_ipaddr.go:471— mapper.collectIPAddressTable 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.
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) go/pkg/mapper/ubnt_poller.go:114— 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.
tcpHandshake.stats (cognitive 19) go/pkg/mtr/tcp_handshake.go:178— tcpHandshake.stats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
ICMPSweeper.processReply (cognitive 19) go/pkg/scan/icmp_scanner_unix.go:671— 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.
Stage::add (cognitive 19) elixir/web-ng/native/god_view_nif/src/bitmap_staging.rs:31— Stage::add has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 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.
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.
IpfixTlsConfig::validate (cognitive 19) rust/flow-collector/src/config.rs:293— IpfixTlsConfig::validate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 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.
FlowAttributionRuntime::start (cognitive 19) rust/netprobe/src/attribution.rs:1667— 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.
RPerfTestOrchestrator::start (cognitive 19) rust/rperf-client/src/server.rs:78— RPerfTestOrchestrator::start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (6 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.
exposure-reconciliation-audit.openspec.html.reachabilitySnapshot (cognitive 19) docs/architecture/exposure-reconciliation-audit.openspec.html:8920— exposure-reconciliation-audit.openspec.html.reachabilitySnapshot has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 14, if/else 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
exposure-reconciliation-audit.openspec.html.Archify.presentation (cognitive 19) docs/architecture/exposure-reconciliation-audit.openspec.html:13738— exposure-reconciliation-audit.openspec.html.Archify.presentation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (setActive, updateUrl, render, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.select (cognitive 19) docs/architecture/exposure-reconciliation-audit.openspec.html:13918— exposure-reconciliation-audit.openspec.html.select has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (8 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.
exposure-source-validation.openspec.html.reachabilitySnapshot (cognitive 19) docs/architecture/exposure-source-validation.openspec.html:8175— exposure-source-validation.openspec.html.reachabilitySnapshot has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 14, if/else 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
exposure-source-validation.openspec.html.Archify.presentation (cognitive 19) docs/architecture/exposure-source-validation.openspec.html:12993— exposure-source-validation.openspec.html.Archify.presentation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (setActive, updateUrl, render, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.select (cognitive 19) docs/architecture/exposure-source-validation.openspec.html:13173— exposure-source-validation.openspec.html.select has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (8 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.
WorldTileLayer.refineMembershipTiles (cognitive 19) elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:176— WorldTileLayer.refineMembershipTiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 5). Of this number, 14 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.
dashboard_camera.createDashboardCameraApi.open (cognitive 19) elixir/web-ng/assets/js/lib/camera_relay/dashboard_camera.js:112— dashboard_camera.createDashboardCameraApi.open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 18, error handling 3 (5 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. This shape REPEATS in the file: one other method here (dashboard_camera.createDashboardCameraApi.open::requestSession) 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.
DashboardWasmHost.buildSrqlQuery (cognitive 19) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:119— 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.
status.statusCommand (cognitive 19) js/cli/src/dashboard/status.ts:15— status.statusCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
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.
(anonymous) (cognitive 19) elixir/web-ng/assets/god_view_world_gpu.playwright.js:540— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 46 function literals inside it that branch (lines 566, 553, 623, …). 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.
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.
fromExpression (cognitive 19) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:56— fromExpression has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 6, boolean chains 4, other 2 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
nodeTypeHeroIcon (cognitive 19) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:284— 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.
createDashboardCameraApi.open::requestSession (cognitive 19) elixir/web-ng/assets/js/lib/camera_relay/dashboard_camera.js:179— createDashboardCameraApi.open::requestSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, error handling 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.
_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.
startAnimationLoop::tick (cognitive 19) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:8— startAnimationLoop::tick has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, error handling 2 (4 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SNMPCompiler.compile_profile_target (cognitive 18) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1156— SNMPCompiler.compile_profile_target has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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.
AutomationResultSanitizer.job (cognitive 18) elixir/serviceradar_core/lib/serviceradar/automation/ansible/automation_result_sanitizer.ex:384— 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:349— 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.
ArchiveUploads.archive_metadata (cognitive 18) elixir/serviceradar_core/lib/serviceradar/camera/archive_uploads.ex:178— ArchiveUploads.archive_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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.
ArchiveUploads.archive_inventory (cognitive 18) elixir/serviceradar_core/lib/serviceradar/camera/archive_uploads.ex:223— ArchiveUploads.archive_inventory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (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.
RelaySessionLifecycle.finish_session (cognitive 18) elixir/serviceradar_core/lib/serviceradar/camera/relay_session_lifecycle.ex:131— RelaySessionLifecycle.finish_session 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.
AgentConfigGenerator.map_proxmox_input_items (cognitive 18) elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:1993— 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.
TrivyReports.process_batch (cognitive 18) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/trivy_reports.ex:147— TrivyReports.process_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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.
DeviceDiscoveryIngestor.attach_matching_virtualization_guest (cognitive 18) elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:992— DeviceDiscoveryIngestor.attach_matching_virtualization_guest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 5). 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.
HypervisorEnrichmentIngestor.reconcile_saved_projection (cognitive 18) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:557— HypervisorEnrichmentIngestor.reconcile_saved_projection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (4 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.
IntegrationIdentity.validate_v3_record (cognitive 18) elixir/serviceradar_core/lib/serviceradar/inventory/integration_identity.ex:285— 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.
CertificateAuthorizationToken.decode_request (cognitive 18) elixir/serviceradar_core/lib/serviceradar/nats/certificate_authorization_token.ex:31— CertificateAuthorizationToken.decode_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.
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:1090— 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.
CredentialResolver.resolve_default (cognitive 18) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:394— CredentialResolver.resolve_default has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 4 (8 pts), boolean chains 2 (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.
ArchiveStorageListener.load! (cognitive 18) elixir/web-ng/lib/serviceradar_web_ng/archive_storage_listener.ex:38— ArchiveStorageListener.load! 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.
RuntimeGraph.canonical_edge_to_runtime_row (cognitive 18) elixir/web-ng/lib/serviceradar_web_ng/topology/runtime_graph.ex:236— 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:2079— 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:3208— 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.
main.parseInterfaceCheckConfig (cognitive 18) go/cmd/wasm-plugins/opentext-nom/config_check.go:94— main.parseInterfaceCheckConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, 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.
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.
main.protoFields (cognitive 18) go/cmd/wasm-plugins/starlink/proto.go:37— main.protoFields 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.
options.validate (cognitive 18) build/packaging/agent/macos/package.go:153— 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:243— 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.newNATSAccountServer (cognitive 18) go/cmd/data-services/main.go:145— main.newNATSAccountServer 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.
main.generateMACAddresses (cognitive 18) go/cmd/faker/main.go:1550— 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:259— 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:425— 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:624— 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:1143— 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:1518— 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:1194— 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.summarizeSNMPTargets (cognitive 18) REDACTED:341— agent.summarizeSNMPTargets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
systemHost.loadPrivilegedUnitPayloads (cognitive 18) go/pkg/agent/addon_systemd.go:443— systemHost.loadPrivilegedUnitPayloads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), 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.
PushLoop.handleControlStream (cognitive 18) go/pkg/agent/control_stream.go:446— PushLoop.handleControlStream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 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.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:557— 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.
PushLoop.spoolTelemetry (cognitive 18) go/pkg/agent/push_loop_telemetry_edge.go:156— PushLoop.spoolTelemetry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 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.
remoteaccess.EvaluateFileTransferPolicy (cognitive 18) go/pkg/agent/remoteaccess/file_transfer_policy.go:90— remoteaccess.EvaluateFileTransferPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 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.
sweepEdgeProducer.addResult (cognitive 18) go/pkg/agent/sweep_edge_producer.go:392— sweepEdgeProducer.addResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
GatewayClient.Connect (cognitive 18) go/pkg/agentgateway/gateway_client.go:141— GatewayClient.Connect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, loops 1 (nesting depth added 3). 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, 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.
NATSStore.handleWatchWithReconnect (cognitive 18) go/pkg/datasvc/nats.go:366— 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.
edgerecord.hasUnknownFields (cognitive 18) go/pkg/edge/edgerecord/canonical.go:66— edgerecord.hasUnknownFields has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 10). 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 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.
edgerecord.joinMtrAuthority (cognitive 18) go/pkg/edge/edgerecord/domain.go:1318— edgerecord.joinMtrAuthority has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 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.
edgerecord.TransportProvenancePreimage (cognitive 18) go/pkg/edge/edgerecord/publication_identity.go:327— edgerecord.TransportProvenancePreimage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Sender.runSession (cognitive 18) go/pkg/edge/sender/sender.go:237— Sender.runSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Allocator.resumeRecovery (cognitive 18) go/pkg/edge/spool/reserve_resume.go:50— Allocator.resumeRecovery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3, 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.
Spool.observeSlot (cognitive 18) go/pkg/edge/spool/recover.go:263— Spool.observeSlot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, 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.
edgeonboarding.EnrollAgentFromToken (cognitive 18) REDACTED:74— edgeonboarding.EnrollAgentFromToken has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 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.
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.
Tracer.runTCPHandshake (cognitive 18) go/pkg/mtr/tcp_handshake.go:239— Tracer.runTCPHandshake has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (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.
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:63— 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.
Tree::previous (cognitive 18) elixir/web-ng/native/god_view_nif/src/bitmap_addresses.rs:173— Tree::previous has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (6 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.
Query::values (cognitive 18) elixir/web-ng/native/god_view_nif/src/bitmap_index.rs:1005— Query::values has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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_radial_overview.indexElkLayout (cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:242— 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:423— 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.
WorldTileCache.load (cognitive 18) elixir/web-ng/assets/js/lib/god_view/world_tile_cache.js:167— WorldTileCache.load has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, 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.
boot (cognitive 18) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:428— 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.
buildElkSceneGraph (cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:333— 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 28 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.
aggregateVisibleEdges::classBucketForEdge (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:622— 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.
expandableEndpointClusterId (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:240— 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.
selectEdgeLabels (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:425— selectEdgeLabels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 2 (4 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.
(anonymous) (cognitive 18) REDACTED:216— (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts) (nesting depth added 10). Of this number, 9 points are the body's own statements and 9 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.
clusterEdges (cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:169— clusterEdges has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 8, if/else 1. None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 172). 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.
humanizeCausalReason (cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_style_node_reason_methods.js:94— 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.
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.
Rows.encode_row (cognitive 17) elixir/serviceradar_core/lib/serviceradar/analytics/starrocks/rows.ex:171— Rows.encode_row has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 17. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SchemaMigrator.migrate (cognitive 17) REDACTED:180— SchemaMigrator.migrate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (6 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerProvenance.label_summary (cognitive 17) elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:931— 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.
AssignmentValidate.validate_identity (cognitive 17) elixir/serviceradar_core/lib/serviceradar/edge/assignment_validate.ex:308— AssignmentValidate.validate_identity 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.
ManagedCertificateLifecycle.rotate (cognitive 17) elixir/serviceradar_core/lib/serviceradar/edge/managed_certificate_lifecycle.ex:25— ManagedCertificateLifecycle.rotate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, match/switch 2 (4 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.
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.
ExposureSnapshotIngestion.cleanup (cognitive 17) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_snapshot_ingestion.ex:259— ExposureSnapshotIngestion.cleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (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.
AnomalyEpisodeRegistry.transition_row (cognitive 17) elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:347— 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.
RecordRoleChange.change (cognitive 17) elixir/serviceradar_core/lib/serviceradar/identity/changes/record_role_change.ex:18— RecordRoleChange.change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, match/switch 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.
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.
DeviceDiscoveryIngestor.reconcile_one_awx_update (cognitive 17) elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:1098— DeviceDiscoveryIngestor.reconcile_one_awx_update has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (7 pts), match/switch 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.
BatchResolver.strong_match (cognitive 17) elixir/serviceradar_core/lib/serviceradar/inventory/identity/batch_resolver.ex:432— BatchResolver.strong_match has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, match/switch 2 (3 pts) (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.
JetstreamConsumer.existing_stream (cognitive 17) elixir/serviceradar_core/lib/serviceradar/nats/jetstream_consumer.ex:87— JetstreamConsumer.existing_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (7 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TelemetryIndexRead.run_warehouse (cognitive 17) elixir/serviceradar_core/lib/serviceradar/observability/telemetry_index_read.ex:215— TelemetryIndexRead.run_warehouse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 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.
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.
CredentialResolver.describe_for_device (cognitive 17) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/credential_resolver.ex:499— CredentialResolver.describe_for_device has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 4 (6 pts), boolean chains 4 (nesting depth added 5). 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.
SPIFFE.parse_spiffe_id (cognitive 17) elixir/serviceradar_core/lib/serviceradar/spiffe.ex:141— 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.
LeaseDelivery.send_push (cognitive 17) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/lease_delivery.ex:530— LeaseDelivery.send_push has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (6 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.
Router.receive_staged (cognitive 17) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/router.ex:63— Router.receive_staged has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, match/switch 3 (8 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BitmapFrame.encode (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng/topology/bitmap_frame.ex:22— BitmapFrame.encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, 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.
WorldOverlayReader.prepare (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng/topology/world_overlay_reader.ex:14— WorldOverlayReader.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Show.handle_event (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng_web/live/authored_dashboard_live/show.ex:551— 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.
DataRetentionLive.mount (cognitive 17) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/data_retention_live.ex:81— DataRetentionLive.mount has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 2 (4 pts), boolean chains 3, 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.
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:396— 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.collectAlerts (cognitive 17) go/cmd/wasm-plugins/starlink/alerts.go:128— main.collectAlerts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 144, 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.
actionRun.setProduct (cognitive 17) go/cmd/wasm-plugins/starlink/actions.go:406— actionRun.setProduct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (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.
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.run (cognitive 17) go/cmd/tools/ubuntu-feed-merge/main.go:1540— 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:535— 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.stagedTimerService (cognitive 17) go/pkg/agent/addon_systemd.go:602— agent.stagedTimerService has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.buildMapperResultsPayload (cognitive 17) go/pkg/agent/mapper_service.go:592— 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.validatePluginHostAuthorityBinding (cognitive 17) go/pkg/agent/plugin_runtime_host_authority.go:250— agent.validatePluginHostAuthorityBinding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 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.
agent.validatePluginHostAuthorityGrant (cognitive 17) go/pkg/agent/plugin_runtime_host_authority.go:321— agent.validatePluginHostAuthorityGrant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, 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.validatePluginHostAuthorityTargetIDs (cognitive 17) go/pkg/agent/plugin_runtime_host_authority.go:357— 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:2130— 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.
agent.preferLocalSourceIP (cognitive 17) go/pkg/agent/push_loop.go:697— agent.preferLocalSourceIP has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
agent.agentCapabilities (cognitive 17) go/pkg/agent/push_loop_capabilities.go:565— agent.agentCapabilities 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.
agent.unleasedSweepHost (cognitive 17) go/pkg/agent/push_loop_sweep_results_edge.go:625— agent.unleasedSweepHost has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 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.
agent.addSweepCheckResult (cognitive 17) go/pkg/agent/sweep_edge_producer.go:469— agent.addSweepCheckResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 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.
agent.validateSweepLease (cognitive 17) go/pkg/agent/sweep_lease.go:609— agent.validateSweepLease has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, 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.
managedCertificateStore.activateGeneration (cognitive 17) go/pkg/agent/managed_certificates_linux.go:611— managedCertificateStore.activateGeneration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), 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.
PluginManager.refreshPluginHostAuthorities (cognitive 17) go/pkg/agent/plugin_runtime_manager.go:284— 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:903— 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:2036— 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) go/pkg/agent/plugin_runtime_http.go:278— 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.applyVisibilityConfig (cognitive 17) go/pkg/agent/push_loop_config.go:924— 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.
RecoveryCoordinator.openOperation (cognitive 17) go/pkg/agent/recovery_coordinator.go:214— RecoveryCoordinator.openOperation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), 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.
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.
sweepLeaseStore.Install (cognitive 17) go/pkg/agent/sweep_lease.go:545— sweepLeaseStore.Install has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
sweepLeaseExecutor.step (cognitive 17) go/pkg/agent/sweep_lease_executor.go:142— sweepLeaseExecutor.step has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
SyncRuntime.ApplyConfig (cognitive 17) go/pkg/agent/sync_runtime.go:127— 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:547— 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.
GatewayClient.UploadMedia (cognitive 17) go/pkg/agentgateway/gateway_client.go:902— GatewayClient.UploadMedia 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.
Runner.Run (cognitive 17) go/pkg/bumblebee/runner.go:66— 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:589— 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:391— 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.
edgerecord.rangeSpanSize (cognitive 17) go/pkg/edge/edgerecord/plan.go:451— edgerecord.rangeSpanSize 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.
fairsched.NewLaneTaxonomy (cognitive 17) go/pkg/edge/fairsched/scheduler.go:144— fairsched.NewLaneTaxonomy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, 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.
LaneSet.recoverGeneration (cognitive 17) go/pkg/edge/spool/lanes.go:915— LaneSet.recoverGeneration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RecoveryOperation.FreezePublications (cognitive 17) go/pkg/edge/spool/recovery_operation.go:148— RecoveryOperation.FreezePublications has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
RecoveryGrant.prepareAppendCharge (cognitive 17) go/pkg/edge/spool/reserve_resume.go:264— RecoveryGrant.prepareAppendCharge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 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.
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:242— 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:419— 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.matchProbeResponse (cognitive 17) go/pkg/mtr/tracer.go:703— Tracer.matchProbeResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, 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.
Tracer.resolveHopHostnames (cognitive 17) go/pkg/mtr/tracer.go:760— 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.
Elk::layout (cognitive 17) rust/topology-atlas/src/elk.rs:43— Elk::layout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
exposure-reconciliation-audit.openspec.html.Archify.preset (cognitive 17) docs/architecture/exposure-reconciliation-audit.openspec.html:6718— exposure-reconciliation-audit.openspec.html.Archify.preset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 3, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function items inside it that branch (open, a function literal at line 6787, apply, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-reconciliation-audit.openspec.html.relationshipHitRecords (cognitive 17) docs/architecture/exposure-reconciliation-audit.openspec.html:9101— exposure-reconciliation-audit.openspec.html.relationshipHitRecords has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 9107, 9121). 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.
exposure-source-validation.openspec.html.Archify.preset (cognitive 17) docs/architecture/exposure-source-validation.openspec.html:5973— exposure-source-validation.openspec.html.Archify.preset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 3, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function items inside it that branch (open, a function literal at line 6042, apply, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
exposure-source-validation.openspec.html.relationshipHitRecords (cognitive 17) docs/architecture/exposure-source-validation.openspec.html:8356— exposure-source-validation.openspec.html.relationshipHitRecords has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 8362, 8376). 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_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.
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.
WorldMapRenderer.pick (cognitive 17) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:688— WorldMapRenderer.pick has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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.
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:131— 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.
updateBrowserModuleHost (cognitive 17) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:356— 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) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1333— 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) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1436— 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.
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.
refreshManifest (cognitive 17) elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:425— refreshManifest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2, other 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 427, (anonymous)::capability, a function literal at line 465). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
resizeCanvas (cognitive 17) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:397— 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.
connectWebsocket (cognitive 17) elixir/web-ng/assets/js/lib/camera_relay/viewer.js:266— 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). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 320, 284, 304, …). 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 (cognitive 17) elixir/web-ng/assets/js/lib/camera_relay/viewer.js:380— connectWebRtc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 7, error handling 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.
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.
decodeArrowGraph (cognitive 17) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_decode_methods.js:26— decodeArrowGraph has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 2 (3 pts), boolean chains 2, loops 2, other 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.
CertIssuer.sign_csr_certificate (cognitive 16) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:776— CertIssuer.sign_csr_certificate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 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.
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.
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.
ArchiveAuthorities.do_with_current (cognitive 16) elixir/serviceradar_core/lib/serviceradar/camera/archive_authorities.ex:200— ArchiveAuthorities.do_with_current has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, 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.
ScheduledMtrTrace.validate_trace_entry (cognitive 16) elixir/serviceradar_core/lib/serviceradar/edge/projectors/scheduled_mtr_trace.ex:336— ScheduledMtrTrace.validate_trace_entry 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.
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.
RecoveryAssignments.commit_issuance (cognitive 16) elixir/serviceradar_core/lib/serviceradar/edge/recovery_assignments.ex:48— RecoveryAssignments.commit_issuance 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.
RecoveryValidate.control_body (cognitive 16) elixir/serviceradar_core/lib/serviceradar/edge/recovery_validate.ex:562— RecoveryValidate.control_body has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, 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.
ExposureDelivery.recover_capture (cognitive 16) elixir/serviceradar_core/lib/serviceradar/event_writer/exposure_delivery.ex:360— ExposureDelivery.recover_capture has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (8 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.
FlowEnrichment.tags_from_active_ti_match (cognitive 16) elixir/serviceradar_core/lib/serviceradar/event_writer/flow_enrichment.ex:440— 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:433— 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.
ExposureSnapshotWorker.coordinate (cognitive 16) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_snapshot_worker.ex:104— ExposureSnapshotWorker.coordinate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (6 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.
HypervisorEnrichmentIngestor.validate_trusted_proxmox_source_binding (cognitive 16) elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:740— 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.
Events.emit (cognitive 16) elixir/serviceradar_core/lib/serviceradar/inventory/source_facts/events.ex:15— Events.emit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, 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.
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.
FrameRunner.collect_json_pages (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng/dashboards/frame_runner.ex:183— FrameRunner.collect_json_pages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, 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.
ReleaseSourceImporter.import (cognitive 16) elixir/web-ng/lib/serviceradar_web_ng/edge/release_source_importer.ex:63— 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:276— 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.
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:2025— 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.countResourceBottlenecks (cognitive 16) go/cmd/wasm-plugins/proxmox/summaries.go:349— 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.collectFlightStatus (cognitive 16) go/cmd/wasm-plugins/starlink/flights.go:35— main.collectFlightStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1. Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 84, 53, 40). 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.decodeTelemetryStream (cognitive 16) go/cmd/wasm-plugins/starlink/telemetry.go:113— main.decodeTelemetryStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.buildMetricRecordsFor (cognitive 16) go/cmd/wasm-plugins/starlink/telemetry.go:297— main.buildMetricRecordsFor has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 2 (5 pts) (nesting depth added 8). 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.
main.ensureRelease (cognitive 16) build/release/publish_packages.go:651— 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:315— 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.loadFakerConfig (cognitive 16) go/cmd/faker/main.go:1062— main.loadFakerConfig 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.
fakeArmis.shuffleIPs (cognitive 16) go/cmd/faker/main.go:658— fakeArmis.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.
main.scanRun (cognitive 16) go/cmd/tools/ubuntu-feed-merge/main.go:987— main.scanRun has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
projectionBuilder.addSet (cognitive 16) go/cmd/tools/ubuntu-feed-merge/projector.go:1401— 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:583— 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) go/pkg/agent/camera_relay_rtsp.go:90— 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.WriteRenewedCertificateAtomically (cognitive 16) go/pkg/agent/cert_renewal.go:418— agent.WriteRenewedCertificateAtomically has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 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.
agent.expandSweepMtrTarget (cognitive 16) go/pkg/agent/mtr_checker.go:535— agent.expandSweepMtrTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.reduceConditionTemplate (cognitive 16) go/pkg/agent/plugin_condition_debounce.go:521— agent.reduceConditionTemplate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.parseGRPCRequestMetadata (cognitive 16) go/pkg/agent/plugin_runtime_grpc.go:587— agent.parseGRPCRequestMetadata 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.
agent.newConsoleSpecAuthorityState (cognitive 16) go/pkg/agent/plugin_runtime_host_authority.go:1541— 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:199— 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.
MultiSweepService.GetSweepResults (cognitive 16) go/pkg/agent/multi_sweep_service.go:422— 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.addonDeliveryFailureStatuses (cognitive 16) go/pkg/agent/addon_delivery.go:374— PushLoop.addonDeliveryFailureStatuses has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3, 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.applySweepConfig (cognitive 16) go/pkg/agent/push_loop_config.go:1117— 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.spoolPluginResults (cognitive 16) go/pkg/agent/push_loop_plugin_results_edge.go:128— PushLoop.spoolPluginResults 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.
discoveryKind.spec (cognitive 16) go/pkg/agent/push_loop_discovery_edge.go:78— discoveryKind.spec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (7 pts), match/switch 1 (nesting depth added 8). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 86, 104, 138, …). 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.
RecoveryCoordinator.advanceCoverage (cognitive 16) go/pkg/agent/recovery_coordinator.go:315— RecoveryCoordinator.advanceCoverage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 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.
remoteaccess.validateSSHOpenPayloadScope (cognitive 16) go/pkg/agent/remoteaccess/ssh_open.go:115— 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.
SNMPAgentService.ApplyProtoConfig (cognitive 16) REDACTED:653— SNMPAgentService.ApplyProtoConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
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.
cli.findAccountJWT (cognitive 16) go/pkg/cli/nats_account_limits.go:154— cli.findAccountJWT has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
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:885— 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.
edgerecord.ValidateAssignmentAgainstPlan (cognitive 16) go/pkg/edge/edgerecord/assignment.go:232— edgerecord.ValidateAssignmentAgainstPlan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 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.
edgerecord.ValidateZstdPayload (cognitive 16) go/pkg/edge/edgerecord/compression.go:84— edgerecord.ValidateZstdPayload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edgerecord.validateDeliveryClaims (cognitive 16) go/pkg/edge/edgerecord/validate.go:504— edgerecord.validateDeliveryClaims has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
spool.readRecoverySource (cognitive 16) go/pkg/edge/spool/generation.go:80— spool.readRecoverySource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
spool.ensureRecoveryOperationDirectory (cognitive 16) go/pkg/edge/spool/recovery_begin.go:109— spool.ensureRecoveryOperationDirectory 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.
RecoveryCompletion.reclaimTarget (cognitive 16) go/pkg/edge/spool/recovery_completion.go:487— RecoveryCompletion.reclaimTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). 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 494). 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.
RecoveryOperation.ArchiveTerminalEvidence (cognitive 16) go/pkg/edge/spool/recovery_archive.go:44— RecoveryOperation.ArchiveTerminalEvidence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 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.
RecoveryOperation.resumeCopyTail (cognitive 16) go/pkg/edge/spool/recovery_copy.go:40— RecoveryOperation.resumeCopyTail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 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.
RecoveryOperation.readPublicationReceipt (cognitive 16) go/pkg/edge/spool/recovery_publication.go:247— RecoveryOperation.readPublicationReceipt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, 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.
RecoveryOperation.PublicationProgress (cognitive 16) go/pkg/edge/spool/recovery_publication.go:325— RecoveryOperation.PublicationProgress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (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.
Spool.recoveryPreviousEnd (cognitive 16) go/pkg/edge/spool/recovery_copy.go:166— Spool.recoveryPreviousEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
Spool.commitLocked (cognitive 16) go/pkg/edge/spool/spool.go:589— Spool.commitLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 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.
edgeonboarding.extractBundle (cognitive 16) REDACTED:247— 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:711— 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.
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.
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.associateIPsWithInterfaces (cognitive 16) go/pkg/mapper/snmp_interface_ipaddr.go:175— DiscoveryEngine.associateIPsWithInterfaces has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:510— 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:606— 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.
NetworkSweeper.Start (cognitive 16) go/pkg/sweeper/sweeper_lifecycle.go:29— NetworkSweeper.Start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (3 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.
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.
Store::apply_inner (cognitive 16) rust/cert-policy/src/lib.rs:81— Store::apply_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 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.
SqliteDatabase::scan_table (cognitive 16) rust/netprobe/src/executable_ownership/sqlite.rs:145— SqliteDatabase::scan_table has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (7 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.
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.
SegmentIndex::visit_page (cognitive 16) rust/topology-atlas/src/spatial.rs:172— SegmentIndex::visit_page has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exposure-reconciliation-audit.openspec.html.relationshipTokenKind (cognitive 16) docs/architecture/exposure-reconciliation-audit.openspec.html:9227— exposure-reconciliation-audit.openspec.html.relationshipTokenKind has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 2. Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
exposure-reconciliation-audit.openspec.html.renderShareCue (cognitive 16) docs/architecture/exposure-reconciliation-audit.openspec.html:10892— exposure-reconciliation-audit.openspec.html.renderShareCue has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5, boolean chains 2 (nesting depth added 3). Of this number, 9 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
exposure-reconciliation-audit.openspec.html.pulseStoryStep (cognitive 16) docs/architecture/exposure-reconciliation-audit.openspec.html:11190— exposure-reconciliation-audit.openspec.html.pulseStoryStep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
exposure-source-validation.openspec.html.relationshipTokenKind (cognitive 16) docs/architecture/exposure-source-validation.openspec.html:8482— exposure-source-validation.openspec.html.relationshipTokenKind has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 2. Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
exposure-source-validation.openspec.html.renderShareCue (cognitive 16) docs/architecture/exposure-source-validation.openspec.html:10147— exposure-source-validation.openspec.html.renderShareCue has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5, boolean chains 2 (nesting depth added 3). Of this number, 9 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
exposure-source-validation.openspec.html.pulseStoryStep (cognitive 16) docs/architecture/exposure-source-validation.openspec.html:10445— exposure-source-validation.openspec.html.pulseStoryStep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
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:468— 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:58— 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.
ValueBrowser.renderItems (cognitive 16) elixir/web-ng/assets/js/lib/value_browser.js:111— ValueBrowser.renderItems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard_camera.createDashboardCameraApi.open::requestSession (cognitive 16) elixir/web-ng/assets/js/lib/camera_relay/dashboard_camera.js:179— dashboard_camera.createDashboardCameraApi.open::requestSession has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), error handling 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. This shape REPEATS in the file: one other method here (dashboard_camera.createDashboardCameraApi.open) 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.
install.installManaged (cognitive 16) js/cli/src/edge/install.ts:199— install.installManaged has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3. 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 221, 245, 230). 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.
navigationPath (cognitive 16) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:832— 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.
replaceFramePayload (cognitive 16) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:927— replaceFramePayload has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3, loops 1 (nesting depth added 1). 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: 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.
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.
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.
prefetch (cognitive 16) elixir/web-ng/assets/js/lib/god_view/world_tile_cache.js:133— prefetch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), boolean chains 4, error handling 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.
_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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
Change-coupling hub: entity.rs → engine.rs, mod.rs, translate.rs, mod.rs rust/srql/src/parser/entity.rs— `rust/srql/src/parser/entity.rs` changes together with 4 other files — `rust/srql/src/query/engine.rs`, `rust/srql/src/query/mod.rs`, `rust/srql/src/query/translate.rs`, `rust/srql/src/query/viz/mod.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication· Near-duplicate member family (21 members, 21 shared lines) · ×1
Near-duplicate member family (21 members, 21 shared lines) rust/srql/src/query/addon_statuses.rs:41— rust/srql/src/query/addon_statuses.rs:41-71 | rust/srql/src/query/agents.rs:51-84 | REDACTED:66-103 | rust/srql/src/query/bmp_events.rs:47-77 | rust/srql/src/query/capacity_forecasts.rs:74-104 | rust/srql/src/query/composite_results.rs:108-143 | rust/srql/src/query/devices.rs:102-179 | rust/srql/src/query/endpoint_inventory_scans.rs:57-88 | rust/srql/src/query/endpoint_package_catalog.rs:54-90 | rust/srql/src/query/endpoint_packages.rs:72-114 | rust/srql/src/query/gateways.rs:136-166 | rust/srql/src/query/mtr_hops.rs:183-217 | rust/srql/src/query/mtr_traces.rs:98-134 | rust/srql/src/query/otel_metric_points.rs:67-107 | rust/srql/src/query/otel_metrics.rs:60-100 | rust/srql/src/query/services.rs:103-174 | rust/srql/src/query/sweep_executions.rs:47-77 | rust/srql/src/query/sweep_groups.rs:41-71 | rust/srql/src/query/sweep_profiles.rs:88-118 | rust/srql/src/query/sweep_results.rs:64-100 | rust/srql/src/query/traces.rs:66-107 — These 21 members are variants of one another: a block of 21 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 21 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 21 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 13 shared lines) · ×1
Near-duplicate member family (6 members, 13 shared lines) rust/srql/src/query/downsample/filters.rs:23— rust/srql/src/query/downsample/filters.rs:23-66 | rust/srql/src/query/logs/rollup.rs:82-128 | rust/srql/src/query/logs/stats_clauses.rs:11-57 | rust/srql/src/query/logs/stats_clauses.rs:66-112 | REDACTED:2333-2376 | rust/srql/src/query/traces.rs:343-388 — These 6 members are variants of one another: a block of 13 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 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.
D4 · Code Duplication· Near-duplicate member family (4 members, 17 shared lines) · ×1
Near-duplicate member family (4 members, 17 shared lines) go/pkg/cli/edge_onboarding.go:309— go/pkg/cli/edge_onboarding.go:309-388 | go/pkg/cli/edge_onboarding.go:391-465 | go/pkg/cli/nats_bootstrap.go:1020-1070 | go/pkg/cli/nats_bootstrap.go:1152-1212 — These 4 members are variants of one another: a block of 17 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 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 11 shared lines) · ×1
Near-duplicate member family (3 members, 11 shared lines) 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-98 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:68-90 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1063-1085 — These 3 members are variants of one another: a block of 11 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 3 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 3 times.
Near-duplicate member pair (62 shared lines) rust/anomaly-addon/src/verdict.rs:90— rust/anomaly-addon/src/verdict.rs:90-215 | rust/anomaly-addon/src/verdict.rs:255-389 — These two members are variants of one another: 62 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) REDACTED:166— REDACTED:166-233 | REDACTED:145-202 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (51 shared lines) rust/netprobe/ebpf/src/lib.rs:1089— rust/netprobe/ebpf/src/lib.rs:1089-1186 | rust/netprobe/ebpf/src/lib.rs:1204-1296 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (44 shared lines) REDACTED:1718— REDACTED:1718-1915 | REDACTED:1921-2073 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (39 shared lines) go/pkg/mtr/socket_darwin.go:141— go/pkg/mtr/socket_darwin.go:141-186 | go/pkg/mtr/socket_linux.go:161-215 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (36 shared lines) rust/dgraph-topology/src/client.rs:329— rust/dgraph-topology/src/client.rs:329-382 | rust/dgraph-topology/src/client.rs:408-461 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) rust/srql/src/query/devices/stats/clauses.rs:14— rust/srql/src/query/devices/stats/clauses.rs:14-61 | rust/srql/src/query/devices/stats/clauses.rs:66-114 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (23 shared lines) rust/srql/src/query/virtualization.rs:369— rust/srql/src/query/virtualization.rs:369-414 | rust/srql/src/query/virtualization.rs:416-457 — These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (19 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (19 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:179-188 | elixir/serviceradar_core/lib/serviceradar/inventory/device_identifier_gc_worker.ex:218-225 | elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_assessment_worker.ex:47-54 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_match_worker.ex:49-56 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:105-112 | elixir/serviceradar_core/lib/serviceradar/jobs/schedule_health_worker.ex:124-131 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:257-264 | 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:55-62 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:59-66 | 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:59-66 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_feed_refresh_worker.ex:52-59 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_data_cleanup_worker.ex:100-107 — These 19 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 19 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 19 times.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) REDACTED:39— REDACTED:39-56 | rust/srql/src/query/camera_sources.rs:33-48 | rust/srql/src/query/device_sweep_overlap.rs:33-53 | rust/srql/src/query/field_survey.rs:23-46 | rust/srql/src/query/identity/decisions.rs:39-56 | rust/srql/src/query/identity/deduplication_tasks.rs:37-54 | rust/srql/src/query/identity/device_identifiers.rs:80-104 | rust/srql/src/query/identity/device_revival_audit.rs:32-56 | rust/srql/src/query/identity/evidence_edges.rs:39-63 | rust/srql/src/query/identity/merge_audit.rs:31-55 | rust/srql/src/query/identity/reconciliation_runs.rs:36-60 | rust/srql/src/query/public_endpoints.rs:25-47 | rust/srql/src/query/threat_intel_matches.rs:40-59 | rust/srql/src/query/wifi_map.rs:23-45 — These 14 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 14 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 14 times.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (11 members, 50+ identical tokens) REDACTED:31— REDACTED:31-64 | rust/srql/src/query/composite_results.rs:75-106 | rust/srql/src/query/devices.rs:42-100 | rust/srql/src/query/events.rs:25-61 | rust/srql/src/query/interfaces.rs:27-58 | rust/srql/src/query/logs/mod.rs:80-122 | rust/srql/src/query/otel_metric_points.rs:38-65 | rust/srql/src/query/otel_metrics.rs:34-58 | rust/srql/src/query/sweep_coverage.rs:37-65 | rust/srql/src/query/sweep_results.rs:34-62 | rust/srql/src/query/traces.rs:38-64 — These 11 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 11 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 11 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) rust/srql/src/query/camera_sources.rs:214— rust/srql/src/query/camera_sources.rs:214-242 | rust/srql/src/query/device_sweep_overlap.rs:172-213 | rust/srql/src/query/field_survey.rs:552-593 | rust/srql/src/query/public_endpoints.rs:153-181 | rust/srql/src/query/threat_intel_matches.rs:308-335 | rust/srql/src/query/wifi_map.rs:552-593 — 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.
D4 · Code Duplication· Edited copy of a member (123 corresponding lines) · ×1
Edited copy of a member (123 corresponding lines) elixir/web-ng/native/god_view_nif/src/core/causality.rs:86— elixir/web-ng/native/god_view_nif/src/core/causality.rs:86-244 | rust/correlation-engine/src/god_view.rs:99-221 — These two members are one piece of code written twice and then edited apart: 123 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) rust/srql/src/query/agents.rs:476— rust/srql/src/query/agents.rs:476-552 | rust/srql/src/query/agents.rs:558-634 — These two members are one piece of code written twice and then edited apart: 77 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 (84 corresponding lines) · ×1
Edited copy of a member (84 corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:81— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:81-184 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:69-152 — These two members are one piece of code written twice and then edited apart: 84 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 (99 corresponding lines) · ×1
Edited copy of a member (99 corresponding lines) rust/fieldsurvey-sidekick/src/arrow_stream.rs:102— rust/fieldsurvey-sidekick/src/arrow_stream.rs:102-216 | rust/fieldsurvey-sidekick/src/arrow_stream.rs:221-319 — These two members are one piece of code written twice and then edited apart: 99 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 (143 corresponding lines) · ×1
Edited copy of a member (143 corresponding lines) elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:170— elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex:170-312 | elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_seeder.ex:237-393 — These two members are one piece of code written twice and then edited apart: 143 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 (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) rust/srql/src/query/otel_metric_points.rs:440— rust/srql/src/query/otel_metric_points.rs:440-491 | rust/srql/src/query/otel_metrics.rs:414-465 — These two members are one piece of code written twice and then edited apart: 52 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 (96 corresponding lines) · ×1
Edited copy of a member (96 corresponding lines) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:317— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:317-412 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/cert_issuer.ex:777-876 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 73+ corresponding lines) · ×1
Edited copies of one member (3 members, 73+ corresponding lines) rust/srql/src/query/advisory_coordinates.rs:42— rust/srql/src/query/advisory_coordinates.rs:42-117 | rust/srql/src/query/endpoint_vulnerability_matches.rs:63-135 | rust/srql/src/query/vulnerability_advisories.rs:39-116 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 73 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 60+ corresponding lines) · ×1
Edited copies of one member (3 members, 60+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_file_transfer_controller.ex:56— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_file_transfer_controller.ex:56-115 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:177-260 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:264-350 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 60 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) rust/fieldsurvey-sidekick/src/api/streams.rs:19— rust/fieldsurvey-sidekick/src/api/streams.rs:19-86 | rust/fieldsurvey-sidekick/src/api/streams.rs:118-186 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 45+ corresponding lines) · ×1
Edited copies of one member (6 members, 45+ corresponding lines) rust/srql/src/query/endpoint_inventory_scans.rs:283— rust/srql/src/query/endpoint_inventory_scans.rs:283-327 | rust/srql/src/query/endpoint_inventory_scans.rs:333-377 | rust/srql/src/query/endpoint_package_catalog.rs:269-313 | rust/srql/src/query/endpoint_package_catalog.rs:319-363 | rust/srql/src/query/endpoint_packages.rs:770-818 | rust/srql/src/query/endpoint_packages.rs:824-872 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (76 corresponding lines) · ×1
Edited copy of a member (76 corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:500— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:500-593 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:648-723 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 45+ corresponding lines) · ×1
Edited copies of one member (3 members, 45+ corresponding lines) REDACTED:237— REDACTED:237-290 | rust/srql/src/query/bmp_events.rs:269-313 | rust/srql/src/query/services.rs:492-536 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (69 corresponding lines) · ×1
Edited copy of a member (69 corresponding lines) go/pkg/agent/plugin_runtime_manager.go:1002— go/pkg/agent/plugin_runtime_manager.go:1002-1070 | go/pkg/agent/proxmox_console_plugin.go:121-192 — These two members are one piece of code written twice and then edited apart: 69 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 (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) rust/srql/src/query/otel_metrics.rs:196— rust/srql/src/query/otel_metrics.rs:196-269 | rust/srql/src/query/traces.rs:413-474 — These two members are one piece of code written twice and then edited apart: 62 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 (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) rust/rdp-adapter/src/backend_ironrdp/connector_handshake/handoff_flow.rs:266— rust/rdp-adapter/src/backend_ironrdp/connector_handshake/handoff_flow.rs:266-319 | rust/rdp-adapter/src/backend_ironrdp/live_probe.rs:143-197 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:412— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:412-462 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/integrations_live/index.ex:466-519 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 53+ corresponding lines) · ×1
Edited copies of one member (5 members, 53+ corresponding lines) REDACTED:117— REDACTED:117-176 | REDACTED:95-147 | rust/srql/src/query/devices/stats/spec.rs:12-64 | REDACTED:74-126 | REDACTED:74-126 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 53 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 40+ corresponding lines) · ×1
Edited copies of one member (4 members, 40+ corresponding lines) rust/srql/src/query/sweep_coverage.rs:250— rust/srql/src/query/sweep_coverage.rs:250-289 | rust/srql/src/query/sweep_coverage.rs:295-334 | rust/srql/src/query/sweep_executions.rs:210-249 | rust/srql/src/query/sweep_executions.rs:255-294 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) 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-1657 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/controller_provenance.ex:326-353 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1410-1434 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 37+ corresponding lines) · ×1
Edited copies of one member (3 members, 37+ corresponding lines) rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:37— rust/rdp-adapter/src/backend_ironrdp/connector_handshake/blocking_begin.rs:37-78 | rust/rdp-adapter/src/connector_link_probe.rs:15-51 | rust/rdp-connector-probe/src/probe/model.rs:305-348 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) go/pkg/agent/bumblebee_spool_service.go:173— go/pkg/agent/bumblebee_spool_service.go:173-238 | go/pkg/agent/bumblebee_spool_service.go:240-307 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:417— elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:417-451 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:462-498 | elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex:509-554 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 28+ corresponding lines) · ×1
Edited copies of one member (6 members, 28+ corresponding lines) rust/srql/src/query/camera_sources.rs:116— rust/srql/src/query/camera_sources.rs:116-147 | rust/srql/src/query/identity/decisions.rs:73-111 | rust/srql/src/query/identity/deduplication_tasks.rs:71-111 | rust/srql/src/query/identity/device_revival_audit.rs:73-110 | rust/srql/src/query/identity/reconciliation_runs.rs:77-120 | rust/srql/src/query/public_endpoints.rs:91-118 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 29+ corresponding lines) · ×1
Edited copies of one member (3 members, 29+ corresponding lines) swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:1025— swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:1025-1061 | swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:1063-1092 | swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:1094-1122 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 24+ corresponding lines) · ×1
Edited copies of one member (6 members, 24+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/archive_qualifications.ex:174— elixir/serviceradar_core/lib/serviceradar/camera/archive_qualifications.ex:174-204 | elixir/serviceradar_core/lib/serviceradar/camera/archive_uploads.ex:999-1033 | elixir/serviceradar_core/lib/serviceradar/camera/recording_blocks.ex:287-315 | elixir/serviceradar_core/lib/serviceradar/edge/component_certificate_authority.ex:590-620 | elixir/serviceradar_core/lib/serviceradar/edge/managed_certificate_lifecycle.ex:579-609 | elixir/serviceradar_core/lib/serviceradar/edge/recovery_transaction.ex:9-32 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 16+ corresponding lines) · ×1
Edited copies of one member (8 members, 16+ corresponding 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-84 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:88-107 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:113-130 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/camera_relay_webrtc_controller.ex:134-151 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:83-100 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:104-121 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:127-142 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_desktop_webrtc_controller.ex:146-161 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 26+ corresponding lines) · ×1
Edited copies of one member (4 members, 26+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:150— elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:150-175 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:184-209 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:218-243 | elixir/serviceradar_core/lib/serviceradar/edge/proxmox_console_sessions.ex:252-280 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:100— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:100-110 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:179-189 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:265-275 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowBufferBuilder.swift:436-446 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 22+ corresponding lines) · ×1
Edited copies of one member (5 members, 22+ corresponding lines) REDACTED:418— REDACTED:418-439 | rust/srql/src/query/camera_sources.rs:244-265 | rust/srql/src/query/device_sweep_overlap.rs:264-298 | rust/srql/src/query/public_endpoints.rs:210-231 | rust/srql/src/query/threat_intel_matches.rs:435-456 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 22+ corresponding lines) · ×1
Edited copies of one member (4 members, 22+ corresponding lines) go/pkg/mtr/socket_darwin.go:245— go/pkg/mtr/socket_darwin.go:245-267 | go/pkg/mtr/socket_darwin.go:289-310 | go/pkg/mtr/socket_linux.go:308-330 | go/pkg/mtr/socket_linux.go:354-375 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1233— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1233-1257 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1350-1374 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2197-2225 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1182-1209 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) rust/srql/src/query/dashboard_service_views.rs:123— rust/srql/src/query/dashboard_service_views.rs:123-204 | rust/srql/src/query/dashboard_service_views.rs:258-330 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 17+ corresponding lines) · ×1
Edited copies of one member (5 members, 17+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_ip_enrichment.ex:86— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_ip_enrichment.ex:86-102 | elixir/web-ng/lib/serviceradar_web_ng_web/live/flows/attributed_live.ex:412-428 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9643-9660 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/enrichment.ex:51-70 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/dashboard/enrichment.ex:74-92 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 25+ corresponding lines) · ×1
Edited copies of one member (7 members, 25+ corresponding lines) go/cmd/tools/ubuntu-feed-merge/structure.go:406— go/cmd/tools/ubuntu-feed-merge/structure.go:406-430 | go/cmd/tools/ubuntu-feed-merge/structure.go:432-459 | go/cmd/tools/ubuntu-feed-merge/structure.go:482-511 | go/cmd/tools/ubuntu-feed-merge/structure.go:513-537 | go/cmd/tools/ubuntu-feed-merge/structure.go:547-571 | go/cmd/tools/ubuntu-feed-merge/structure.go:726-755 | go/cmd/tools/ubuntu-feed-merge/structure.go:757-781 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 20+ corresponding lines) · ×1
Edited copies of one member (7 members, 20+ corresponding lines) go/pkg/agentgateway/gateway_client.go:880— go/pkg/agentgateway/gateway_client.go:880-899 | go/pkg/agentgateway/gateway_client.go:958-977 | go/pkg/agentgateway/gateway_client.go:980-999 | go/pkg/agentgateway/gateway_client.go:1005-1024 | go/pkg/agentgateway/gateway_client.go:1029-1048 | go/pkg/agentgateway/gateway_client.go:1054-1073 | go/pkg/agentgateway/gateway_client.go:1079-1098 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 16+ corresponding lines) · ×1
Edited copies of one member (5 members, 16+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/projectors/bumblebee_scan.ex:27— elixir/serviceradar_core/lib/serviceradar/edge/projectors/bumblebee_scan.ex:27-47 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/endpoint_inventory.ex:45-65 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_devices.ex:36-51 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_interfaces.ex:33-49 | elixir/serviceradar_core/lib/serviceradar/edge/projectors/mapper_topology.ex:34-49 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 43+ corresponding lines) · ×1
Edited copies of one member (4 members, 43+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:474— elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:474-522 | elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:526-592 | elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:596-647 | elixir/serviceradar_core/lib/serviceradar/inventory/source_identity_drift.ex:651-693 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 12+ corresponding lines) · ×1
Edited copies of one member (6 members, 12+ corresponding lines) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:21— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:21-32 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:34-45 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:93-109 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:111-122 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:124-136 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReaderHelper.swift:138-159 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 15+ corresponding lines) · ×1
Edited copies of one member (5 members, 15+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:426— elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:426-442 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:626-640 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:644-664 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:668-683 | elixir/web-ng/lib/serviceradar_web_ng_web/live/plugins/show_live.ex:687-704 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 9+ corresponding lines) · ×1
Edited copies of one member (6 members, 9+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:23— elixir/web-ng/lib/serviceradar_web_ng/dashboards/packages.ex:23-35 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:24-34 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_packages.ex:23-31 | elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_profiles.ex:17-27 | elixir/web-ng/lib/serviceradar_web_ng/plugins/assignments.ex:22-37 | elixir/web-ng/lib/serviceradar_web_ng/plugins/packages.ex:34-46 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2624— elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2624-2631 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2717-2734 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2751-2758 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2785-2800 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:2814-2830 | elixir/serviceradar_core/lib/serviceradar/notifications/dispatcher.ex:3022-3037 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 19+ corresponding lines) · ×1
Edited copies of one member (5 members, 19+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:373— elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:373-391 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:395-413 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:417-436 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:440-458 | elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:465-483 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) go/pkg/agent/netprobe/sidecar.go:385— go/pkg/agent/netprobe/sidecar.go:385-403 | go/pkg/agent/netprobe/sidecar.go:405-423 | go/pkg/agent/netprobe/sidecar.go:425-443 | go/pkg/agent/netprobe/sidecar.go:445-463 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 12+ corresponding lines) · ×1
Edited copies of one member (5 members, 12+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1326— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1326-1342 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1362-1376 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1419-1435 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1443-1454 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:1462-1473 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 7+ corresponding lines) · ×1
Edited copies of one member (8 members, 7+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/components/observability/detail_stream_components.ex:244— elixir/web-ng/lib/serviceradar_web_ng_web/components/observability/detail_stream_components.ex:244-250 | elixir/web-ng/lib/serviceradar_web_ng_web/components/observability/signal_display_components.ex:345-351 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/log_components.ex:131-137 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:2133-2139 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:3088-3094 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:5351-5357 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:8220-8226 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:1980-1986 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) rust/srql/src/query/viz/metrics.rs:108— rust/srql/src/query/viz/metrics.rs:108-137 | rust/srql/src/query/viz/observability.rs:341-415 | rust/srql/src/query/viz/observability.rs:417-454 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 11+ corresponding lines) · ×1
Edited copies of one member (7 members, 11+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:541— elixir/serviceradar_core/lib/serviceradar/automation/northbound/event_handler_runner.ex:541-553 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:4274-4284 | elixir/serviceradar_core/lib/serviceradar/edge/remote_access_sessions.ex:1495-1507 | elixir/serviceradar_core/lib/serviceradar/inventory/vulnerability_advisory_ingestor.ex:360-372 | elixir/serviceradar_core/lib/serviceradar/observability/mtr_baseline_scheduler.ex:338-350 | elixir/serviceradar_core/lib/serviceradar/observability/seasonal_disposition/edge_baseline_producer.ex:976-988 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:348-360 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:2038— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:2038-2047 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:2079-2092 | elixir/serviceradar_core/lib/serviceradar/integrations/sync_config_generator.ex:319-328 | elixir/serviceradar_core/lib/serviceradar/inventory/device_hostname_rdns.ex:454-466 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 23+ corresponding lines) · ×1
Edited copies of one member (4 members, 23+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/credentials/paper_trail_mixin.ex:34— elixir/serviceradar_core/lib/serviceradar/credentials/paper_trail_mixin.ex:34-56 | elixir/serviceradar_core/lib/serviceradar/inventory/visibility_profile/paper_trail_mixin.ex:5-27 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group/paper_trail_mixin.ex:5-27 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_group_execution/paper_trail_mixin.ex:5-27 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 3+ corresponding lines) · ×1
Edited copies of one member (6 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:511— elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_launch_preflight_attestation.ex:511-513 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/file_callback_response_policy_provider.ex:661-663 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_launch_plan.ex:566-568 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:664-666 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/current_authority.ex:1179-1181 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/lifecycle.ex:1145-1147 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 1+ corresponding lines) · ×1
Edited copies of one member (8 members, 1+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/action_registry.ex:48— elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/action_registry.ex:48-48 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/audit.ex:133-133 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/keyed_verifier.ex:179-179 | elixir/serviceradar_core/lib/serviceradar/automation/callback_grants/runtime_config.ex:172-172 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes.ex:268-268 | elixir/serviceradar_core/lib/serviceradar/automation/launch_envelopes/context.ex:398-398 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_assessment.ex:166-166 | elixir/serviceradar_core/lib/serviceradar/inventory/sync_run_ledger.ex:212-212 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 3+ corresponding lines) · ×1
Edited copies of one member (8 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:239— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:239-241 | elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:741-743 | elixir/serviceradar_core/lib/serviceradar/observability/plugin_result_ingestor.ex:620-622 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/page.ex:313-315 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/providers/alien_vault_otx.ex:328-330 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel/stix_indicator.ex:149-151 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_plugin_ingestor.ex:524-526 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1348-1350 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 3+ corresponding lines) · ×1
Edited copies of one member (5 members, 3+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/camera/analysis_contract.ex:131— elixir/serviceradar_core/lib/serviceradar/camera/analysis_contract.ex:131-133 | elixir/serviceradar_core/lib/serviceradar/edge/agent_release_manager.ex:1286-1288 | elixir/serviceradar_core/lib/serviceradar/inventory/device_discovery_ingestor.ex:747-749 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/bucketing.ex:77-79 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_relay/boombox_branch_manager.ex:330-332 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 2+ corresponding lines) · ×1
Edited copies of one member (8 members, 2+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:798— elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_dispatcher.ex:798-799 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery.ex:365-366 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2781-2782 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_launch_orchestrator.ex:448-449 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/hardened_run_launcher.ex:106-107 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_dispatcher.ex:621-622 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery.ex:186-187 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1777-1778 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 4+ corresponding lines) · ×1
Edited copies of one member (7 members, 4+ corresponding lines) elixir/serviceradar_core/lib/serviceradar/application.ex:569— elixir/serviceradar_core/lib/serviceradar/application.ex:569-572 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/analytics_signals.ex:2695-2698 | elixir/serviceradar_core/lib/serviceradar/event_writer/processors/anomaly_episode_registry.ex:1070-1073 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_inventory_payload.ex:70-73 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_graph/utils.ex:253-256 | elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:216-219 | elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex:200-203 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 1+ corresponding lines) · ×1
Edited copies of one member (7 members, 1+ corresponding lines) elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/automation_history_components.ex:518— elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/automation_history_components.ex:518-518 | elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/catalog_index.ex:299-299 | elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/operations_index.ex:250-250 | elixir/web-ng/lib/serviceradar_web_ng_web/live/ansible_live/operations_show.ex:99-99 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/ansible_panel_components.ex:496-496 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/endpoint_inventory_components.ex:2304-2304 | elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr_compare.ex:1321-1321 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Duplicated block (46–55 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/exposure_readiness.ex:66— elixir/serviceradar_core/lib/serviceradar/inventory/exposure_readiness.ex:66-120 | elixir/serviceradar_core/lib/serviceradar/inventory/exposure_readiness.ex:134-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (38–54 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-368 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (43 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:592— elixir/serviceradar_core/lib/serviceradar/inventory/remediation/armis_unmerge.ex:592-634 | elixir/serviceradar_core/lib/serviceradar/inventory/remediation/proxmox_unfuse.ex:407-449 — 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 17 separate duplicated blocks between them, totalling at least 269 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 (37–40 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9699— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:9699-9738 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:10166-10202 — both copies are in the same file, so extract the 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–38 lines × 3) elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1516— elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1516-1547 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1551-1588 | elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1623-1656 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1515` calls `site_known_keys` and `elixir/serviceradar_core/lib/serviceradar/wifi_map/batch_ingestor.ex:1622` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27–36 lines × 4) REDACTED:30— REDACTED:30-56 | REDACTED:84-112 | REDACTED:209-244 | REDACTED: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 (37 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data.ex:147— elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/chart_data.ex:147-183 | elixir/web-ng/lib/serviceradar_web_ng_web/netflow_visualize/query.ex:194-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 (32–33 lines × 2) elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1807— elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1807-1839 | elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1911-1942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1804` calls `normalize_cert_attrs`, `put_new`, `put` and `elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:1910` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (32 lines × 2) elixir/serviceradar_core/lib/serviceradar/registry/agent_registry.ex:143— elixir/serviceradar_core/lib/serviceradar/registry/agent_registry.ex:143-174 | elixir/serviceradar_core/lib/serviceradar/registry/gateway_registry.ex:135-166 — 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 (28–29 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:265— elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:265-292 | elixir/web-ng/lib/serviceradar_web_ng_web/plugs/control_plane_archive_authorities.ex:98-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/archive_storage_router.ex:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (28 lines × 7) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:148— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:148-175 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:405-432 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:441-468 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:548-575 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:584-611 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:620-647 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:684-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:148` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26 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-204 | elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:191-216 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:233-258 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:240-265 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:188-213 — 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 4 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:133` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex:382` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–26 lines × 2) elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:571— elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:571-596 | elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:610-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/agent_commands/persistence_worker.ex:571` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/notifications/provider_seeder.ex:556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16–24 lines × 2) elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2664— elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2664-2687 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:1188-1203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex:2664` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–24 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-105 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:99-122 — 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 151 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–23 lines × 6) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:164— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:164-185 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:221-242 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:264-285 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:336-357 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:636-658 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:700-721 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (20–23 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/components/plugin_results.ex:185— elixir/web-ng/lib/serviceradar_web_ng_web/components/plugin_results.ex:185-207 | elixir/web-ng/lib/serviceradar_web_ng_web/live/service_live/index/card_grid.ex:123-142 — 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 × 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:418` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 3) elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:105— elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:105-126 | elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex:115-136 | elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex:411-432 — 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 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. 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–22 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_ioc_exposure.ex:535— elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_ioc_exposure.ex:535-556 | elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_ioc_exposure.ex:581-599 — both copies are in the same file, so extract the 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 (35–39 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:211— elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:211-249 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:621-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/device_controller.ex:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 10) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:126— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:126-146 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:383-403 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:426-446 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:462-482 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:498-518 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:533-553 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:569-589 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:605-625 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:669-689 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:741-761 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 9) elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:147— elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:147-165 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:404-422 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:440-458 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:505-524 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:547-565 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:583-601 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:619-637 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:683-701 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:748-767 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:147` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–20 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:303— elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:303-317 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:452-471 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:556-570 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:90-104 — 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:452` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–20 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:67— elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:67-81 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:517-536 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/flow_data.ex:540-553 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/events_data.ex:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 11) 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:502-520 | 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 | elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:745-763 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–19 lines × 2) elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:222— elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:222-240 | elixir/serviceradar_core/lib/serviceradar/event_writer/telemetry.ex:243-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 (12–19 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-145 | elixir/web-ng/lib/serviceradar_web_ng/plugins/blob_retention.ex:90-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–19 lines × 2) elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:33— elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/read_router.ex:33-47 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_storage/router.ex:110-128 — 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–19 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:112— elixir/web-ng/lib/serviceradar_web_ng_web/live/agent_live/show.ex:112-130 | 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 38 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/snmp_profiles/builtin_templates.ex:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–18 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-58 | elixir/serviceradar_core/lib/serviceradar/plugins/netprobe_addon_package_seeder.ex:47-64 | elixir/serviceradar_core/lib/serviceradar/plugins/otel_collector_addon_package_seeder.ex:48-65 | elixir/serviceradar_core/lib/serviceradar/plugins/workload_identity_addon_package_seeder.ex:41-54 — 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 9 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/endpoint_inventory_addon_package_seeder.ex:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26–27 lines × 3) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:493— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:493-518 | elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:477-502 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex:376-402 — `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 125 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 (15–18 lines × 2) elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:616— elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:616-630 | elixir/serviceradar_core/lib/serviceradar/plugins/proxmox_host_authority.ex:634-651 — both copies are in the same file, so extract the 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–17 lines × 3) elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:519— elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:519-528 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:696-707 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex:866-882 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–24 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:100— elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:100-118 | elixir/web-ng/lib/serviceradar_web_ng_web/live/log_live/index.ex:274-297 — both copies are in the same file, so extract the 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:371-386 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/srql/page.ex:368` calls `extract_param`, `normalize_param_to_string` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/event_handlers/builder.ex:69` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–16 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:569— elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:569-584 | elixir/web-ng/lib/serviceradar_web_ng_web/live/observability_health_live/index.ex:593-605 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/alert_live/show.ex:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–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 (10–14 lines × 4) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1687— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1687-1696 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:24-36 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:29-42 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1021-1034 — before extracting anything, compare `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.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–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:225-238 | elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/remote_access_session_controller.ex:317-330 — 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 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/controllers/api/proxmox_console_session_controller.ex:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:639` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (1–13 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1706— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1706-1712 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.ex:60-72 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/snmp_profiles_live/index/builder.ex:52-64 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1046-1058 | 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/mtr_profiles_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1706` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–13 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-226 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/sysmon_profiles_live/index.ex:1216-1228 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/scope_builder.ex:171-178 — 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 13 separate duplicated blocks between them, totalling at least 143 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–13 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-194 | elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex:173-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_agent_worker.ex:184` calls `resolve_agent_id` and `elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex:169` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–12 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-765 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:1146-1157 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_result_coordinator.ex:1127-1133 — 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 163 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–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 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_result_coordinator.ex:2126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 3) elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_facts.ex:154— elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_facts.ex:154-165 | elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_metadata.ex:76-87 | elixir/serviceradar_core/lib/serviceradar/inventory/changes/remove_device_facts.ex:120-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_facts.ex:154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/inventory/changes/merge_device_facts.ex:168` calls `is_boolean`, `is_number`, `is_binary` and `elixir/serviceradar_core/lib/serviceradar/inventory/changes/remove_device_facts.ex:132` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–12 lines × 2) elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:522— elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:522-528 | elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:545-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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/integrations/armis_northbound_runner.ex:522` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–10 lines × 2) elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1338— elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1338-1347 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1410-1415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1417` calls `compact_strings` and `elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_matcher.ex:1350` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 2) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:60— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:60-67 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:218-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:67` calls `for_update`, `count_target_devices`, `parse_target_query_to_builder` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index/actions.ex:227` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 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-295 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:309-316 | elixir/web-ng/lib/serviceradar_web_ng_web/live/netflow_live/visualize/events.ex:330-337 — 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–9 lines × 2) elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:724— elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:724-730 | elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:914-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/jobs/refresh_trace_summaries_worker.ex:914` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 19) 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:181-188 | elixir/serviceradar_core/lib/serviceradar/inventory/device_identifier_gc_worker.ex:218-225 | elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_assessment_worker.ex:47-54 | elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_match_worker.ex:49-56 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:105-112 | elixir/serviceradar_core/lib/serviceradar/jobs/schedule_health_worker.ex:124-131 | elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:257-264 | 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:55-62 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:59-66 | 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:59-66 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_feed_refresh_worker.ex:52-59 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_data_cleanup_worker.ex:100-107 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/inventory/device_risk_assessment_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/inventory/endpoint_vulnerability_match_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/serviceradar_core/lib/serviceradar/network_discovery/topology_state_cleanup_worker.ex:253` calls `maybe_put_reason`, `put`, `inspect` and `elixir/serviceradar_core/lib/serviceradar/inventory/agent_link_repair_worker.ex:425` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 9) elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:101— elixir/serviceradar_core/lib/serviceradar/credentials/plugin_credential_rule_reconcile_worker.ex:101-108 | 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/plugins/addon_profile_reconcile_worker.ex:42-49 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_rollout_worker.ex:56-63 | 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 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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–8 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:196— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:196-203 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:215-222 | elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex:189-195 — before extracting anything, compare `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex` and `elixir/serviceradar_core_elx/lib/serviceradar_core_elx/camera_media_session_tracker.ex` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/camera_media_session_tracker.ex:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 15) elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:141— elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:141-147 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/plugin_action_sync.ex:176-182 | elixir/serviceradar_core/lib/serviceradar/automation/northbound/target_resolver.ex:42-48 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:590-596 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:2048-2054 | elixir/serviceradar_core/lib/serviceradar/notifications/renderer.ex:419-425 | elixir/serviceradar_core/lib/serviceradar/notifications/suppression.ex:660-666 | elixir/serviceradar_core/lib/serviceradar/object_store/native_addon_artifact_retention.ex:258-264 | elixir/serviceradar_core/lib/serviceradar/observability/srql_runner.ex:194-200 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_pose_samples.ex:39-45 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_rf_observations.ex:154-160 | elixir/serviceradar_core/lib/serviceradar/spatial/actions/bulk_insert_spectrum_observations.ex:111-117 | elixir/web-ng/lib/serviceradar_web_ng/dashboards/system_reports.ex:162-168 | elixir/web-ng/lib/serviceradar_web_ng/srql.ex:580-586 | elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/notifications_live/predicate.ex:165-171 — 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 10 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/northbound/ansible_action_sync.ex:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 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-449 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries.ex:608-614 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/focus.ex:207-213 | elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/timeseries/spec.ex:301-307 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:173-179 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/common.ex:35-41 | elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/visibility_components.ex:1504-1510 | elixir/web-ng/lib/serviceradar_web_ng_web/srql/viz.ex:167-173 — 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 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `elixir/web-ng/lib/serviceradar_web_ng_web/dashboard/plugins/table.ex:441` calls `trim` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/process_metrics_components.ex:172` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–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 11 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_current_authority.ex:456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 19) elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:160— elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:160-165 | elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:823-828 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/awx_membership_reconciler.ex:712-717 | 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:41-46 | elixir/serviceradar_core/lib/serviceradar/credentials/credential_parameter_template.ex:220-225 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_provisioner.ex:589-594 | elixir/serviceradar_core/lib/serviceradar/edge/agent_config_generator.ex:2047-2052 | 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:193-198 | 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/srql.ex:579-584 | 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 10 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/mapper_compiler.ex:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 9) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:353— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:353-358 | 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/edge/sweep_projection.ex:108-113 | elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/parsers/ubuntu.ex:1257-1262 | elixir/serviceradar_core/lib/serviceradar/inventory/device_source_observation_ingestor.ex:212-217 | elixir/serviceradar_core/lib/serviceradar/inventory/sync/batch_executor.ex:33-38 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine/inbox.ex:330-335 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/edge_record_trust.ex:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–6 lines × 3) elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/component_identity_resolver.ex:440— elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/component_identity_resolver.ex:440-445 | elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/component_identity_resolver.ex:461-466 | elixir/serviceradar_core/lib/serviceradar/spiffe.ex:480-482 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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:201-205 | elixir/serviceradar_core/lib/serviceradar/plugins/integration_descriptor.ex:1218-1222 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1135-1139 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1152-1156 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1233-1237 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:1445-1449 | elixir/serviceradar_core/lib/serviceradar/plugins/manifest.ex:2117-2121 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/lib/serviceradar/plugins/display_contract.ex:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 5) elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1702— elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1702-1705 | 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/mtr_profiles_live/index.ex` and `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/target_builder.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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex:1702` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 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-22 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/lifecycle_seed_worker.ex:17-25 | elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery_worker.ex:14-22 | elixir/serviceradar_core/lib/serviceradar/credentials/plugin_integration_reconcile_worker.ex:23-31 | elixir/serviceradar_core/lib/serviceradar/plugins/addon_profile_reconcile_worker.ex:28-36 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_policy_assignment_recovery_dispatch_worker.ex:28-36 | elixir/serviceradar_core/lib/serviceradar/plugins/plugin_target_policy_reconcile_worker.ex:24-32 — before extracting anything, compare `elixir/serviceradar_core/lib/serviceradar/automation/ansible/callback_command_recovery_worker.ex` and `elixir/serviceradar_core/lib/serviceradar/automation/ansible/secure_execution_command_recovery_worker.ex` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 × 13) elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:71— elixir/serviceradar_core/lib/serviceradar/edge/agent_command_cleanup_worker.ex:71-79 | elixir/serviceradar_core/lib/serviceradar/infrastructure/agent_cert_expiry_monitor.ex:43-51 | elixir/serviceradar_core/lib/serviceradar/inventory/interface_threshold_worker.ex:93-101 | elixir/serviceradar_core/lib/serviceradar/observability/ip_enrichment_cleanup_worker.ex:35-43 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_exporter_cache_refresh_worker.ex:43-51 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_interface_cache_refresh_worker.ex:47-55 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_oui_dataset_refresh_worker.ex:36-44 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_provider_dataset_refresh_worker.ex:38-46 | elixir/serviceradar_core/lib/serviceradar/observability/netflow_security_refresh_worker.ex:44-52 | elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex:47-55 | elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_feed_refresh_worker.ex:40-48 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_data_cleanup_worker.ex:88-96 | elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_monitor_worker.ex:65-73 — 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 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 (40 lines × 2) REDACTED:126— REDACTED:126-165 | REDACTED:112-194 — 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 (75 lines × 2) go/pkg/datasvc/nats_account_service.go:298— go/pkg/datasvc/nats_account_service.go:298-372 | go/pkg/datasvc/nats_account_service.go:476-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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/datasvc/nats_account_service.go:298` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (52 lines × 2) go/pkg/mtr/hop.go:176— go/pkg/mtr/hop.go:176-227 | go/pkg/mtr/hop.go:235-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. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mtr/hop.go:176` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (47–49 lines × 2) go/pkg/scan/icmp_scanner_unix.go:261— go/pkg/scan/icmp_scanner_unix.go:261-309 | go/pkg/scan/icmp_scanner_windows.go:168-214 — before extracting anything, compare `go/pkg/scan/icmp_scanner_unix.go` and `go/pkg/scan/icmp_scanner_windows.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/scan/icmp_scanner_unix.go:261` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (36–37 lines × 2) go/pkg/mtr/socket_darwin.go:208— go/pkg/mtr/socket_darwin.go:208-243 | go/pkg/mtr/socket_linux.go:270-306 — before extracting anything, compare `go/pkg/mtr/socket_darwin.go` and `go/pkg/mtr/socket_linux.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mtr/socket_darwin.go:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28–32 lines × 2) go/pkg/k8sinventory/publisher.go:198— go/pkg/k8sinventory/publisher.go:198-225 | go/pkg/trivysidecar/publisher.go:95-126 — `go/pkg/k8sinventory/publisher.go` and `go/pkg/trivysidecar/publisher.go` 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 8 separate duplicated blocks between them, totalling at least 105 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18–29 lines × 3) go/pkg/agent/plugin_runtime_wazero.go:49— go/pkg/agent/plugin_runtime_wazero.go:49-77 | go/pkg/agent/plugin_runtime_wazero.go:208-225 | go/pkg/agent/proxmox_console_plugin.go:257-274 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14–18 lines × 2) go/pkg/agent/metric_envelope.go:238— go/pkg/agent/metric_envelope.go:238-255 | go/pkg/agent/metric_envelope.go:329-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/agent/metric_envelope.go:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 3) REDACTED:787— REDACTED:787-801 | go/pkg/hashutil/hash.go:26-42 | tools/go/derive_agent_release_public_key/main.go:70-84 — 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 (13–14 lines × 4) REDACTED:84— REDACTED:84-97 | REDACTED:399-412 | REDACTED:97-109 | REDACTED:34-46 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–13 lines × 2) go/pkg/mapper/ubnt_topology.go:186— go/pkg/mapper/ubnt_topology.go:186-196 | go/pkg/mapper/ubnt_topology.go:278-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `go/pkg/mapper/ubnt_topology.go:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–11 lines × 2) go/pkg/edge/edgerecord/plan.go:103— go/pkg/edge/edgerecord/plan.go:103-113 | go/pkg/edge/edgerecord/plan.go:132-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 (10 lines × 7) go/pkg/agent/addon/artifacts.go:292— go/pkg/agent/addon/artifacts.go:292-301 | go/pkg/agent/credential_broker_resolver.go:100-111 | go/pkg/agent/plugin_runtime_artifact.go:526-536 | go/pkg/agent/plugin_runtime_host_authority.go:827-836 | go/pkg/agent/remoteaccess/enhanced_recording.go:312-321 | go/pkg/k8sinventory/convert.go:143-152 | go/pkg/remoteaccess/sshca/sshca.go:335-344 — 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 (10 lines × 6) go/cmd/wasm-plugins/proxmox/details_json.go:36— go/cmd/wasm-plugins/proxmox/details_json.go:36-45 | go/cmd/wasm-plugins/proxmox/details_json.go:111-120 | go/cmd/wasm-plugins/proxmox/details_json.go:228-237 | go/cmd/wasm-plugins/proxmox/result.go:145-154 | go/cmd/wasm-plugins/proxmox/result.go:195-204 | go/cmd/wasm-plugins/proxmox/result.go:225-234 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (31 lines × 2) swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1032— swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1032-1062 | swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1137-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Views/ContentView.swift:1032` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–29 lines × 2) swift/FieldSurvey/FieldSurvey/Network/ArrowStreamer.swift:75— swift/FieldSurvey/FieldSurvey/Network/ArrowStreamer.swift:75-95 | swift/FieldSurvey/FieldSurvey/Network/PoseArrowEncoder.swift:72-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Network/ArrowStreamer.swift:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–19 lines × 3) swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:120— swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:120-133 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:152-166 | swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowReader.swift:178-196 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 4) swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:760— swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:760-777 | swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:806-823 | swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:847-864 | swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:889-906 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `swift/FieldSurvey/FieldSurvey/Network/SidekickClient.swift:760` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (30–35 lines × 2) rust/srql/src/query/mtr_hops.rs:421— rust/srql/src/query/mtr_hops.rs:421-450 | rust/srql/src/query/mtr_traces.rs:310-344 — before extracting anything, compare `rust/srql/src/query/mtr_hops.rs` and `rust/srql/src/query/mtr_traces.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 238 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (33 lines × 2) rust/srql/src/query/devices/filters.rs:376— rust/srql/src/query/devices/filters.rs:376-408 | rust/srql/src/query/endpoint_packages.rs:584-616 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices/filters.rs:376` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) rust/rdp-adapter/src/backend_ironrdp/active_stage.rs:273— rust/rdp-adapter/src/backend_ironrdp/active_stage.rs:273-302 | rust/rdp-connector-probe/src/probe/model.rs:464-493 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (29 lines × 3) rust/srql/src/query/device_sweep_overlap.rs:180— rust/srql/src/query/device_sweep_overlap.rs:180-208 | rust/srql/src/query/field_survey.rs:560-588 | rust/srql/src/query/wifi_map.rs:560-588 — before extracting anything, compare `rust/srql/src/query/device_sweep_overlap.rs` and `rust/srql/src/query/field_survey.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/device_sweep_overlap.rs:180` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26–29 lines × 2) rust/srql/src/query/starrocks.rs:1933— rust/srql/src/query/starrocks.rs:1933-1958 | REDACTED:2149-2177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/starrocks.rs:1933` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–27 lines × 2) REDACTED:1496— REDACTED:1496-1522 | REDACTED:2168-2187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1496` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–23 lines × 4) REDACTED:132— REDACTED:132-152 | REDACTED:111-133 | REDACTED:90-112 | REDACTED:90-112 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–23 lines × 2) rust/srql/src/query/interfaces/sql.rs:68— rust/srql/src/query/interfaces/sql.rs:68-88 | REDACTED:12-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–22 lines × 3) rust/srql/src/query/starrocks.rs:1948— rust/srql/src/query/starrocks.rs:1948-1959 | REDACTED:1492-1513 | REDACTED:2164-2178 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/starrocks.rs:1948` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–21 lines × 2) rust/flow-collector/src/publisher.rs:1405— rust/flow-collector/src/publisher.rs:1405-1425 | rust/flow-collector/src/publisher.rs:2219-2238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/flow-collector/src/publisher.rs:1405` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–20 lines × 2) rust/srql/src/query/endpoint_package_catalog.rs:132— rust/srql/src/query/endpoint_package_catalog.rs:132-149 | rust/srql/src/query/endpoint_packages.rs:487-506 — before extracting anything, compare `rust/srql/src/query/endpoint_package_catalog.rs` and `rust/srql/src/query/endpoint_packages.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_packages.rs:487` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–19 lines × 4) rust/srql/src/query/camera_sources.rs:34— rust/srql/src/query/camera_sources.rs:34-45 | rust/srql/src/query/device_sweep_overlap.rs:34-50 | rust/srql/src/query/public_endpoints.rs:26-44 | rust/srql/src/query/wifi_map.rs:24-42 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–19 lines × 3) REDACTED:183— REDACTED:183-201 | REDACTED:160-176 | REDACTED:160-176 — `REDACTED` and `REDACTED` 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 9 separate duplicated blocks between them, totalling at least 164 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:181` calls `iter`, `any`, `needs_unnest` and `REDACTED:158` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–18 lines × 7) rust/srql/src/query/events/filters.rs:226— rust/srql/src/query/events/filters.rs:226-242 | rust/srql/src/query/events/filters.rs:287-304 | rust/srql/src/query/events/filters.rs:342-359 | rust/srql/src/query/events/filters.rs:475-491 | rust/srql/src/query/events/filters.rs:531-547 | rust/srql/src/query/events/filters.rs:621-638 | rust/srql/src/query/events/filters.rs:766-782 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/events/filters.rs:226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 7) rust/srql/src/query/identity/decisions.rs:41— rust/srql/src/query/identity/decisions.rs:41-56 | rust/srql/src/query/identity/deduplication_tasks.rs:39-54 | rust/srql/src/query/identity/device_identifiers.rs:89-104 | rust/srql/src/query/identity/device_revival_audit.rs:41-56 | rust/srql/src/query/identity/evidence_edges.rs:48-63 | rust/srql/src/query/identity/merge_audit.rs:40-55 | rust/srql/src/query/identity/reconciliation_runs.rs:45-60 — before extracting anything, compare `rust/srql/src/query/identity/decisions.rs` and `rust/srql/src/query/identity/deduplication_tasks.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15–16 lines × 3) rust/flow-collector/src/publisher.rs:1407— rust/flow-collector/src/publisher.rs:1407-1421 | rust/flow-collector/src/publisher.rs:2221-2236 | rust/flow-collector/src/publisher.rs:2393-2408 — 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) rust/srql/src/query/capacity_forecasts.rs:219— rust/srql/src/query/capacity_forecasts.rs:219-234 | rust/srql/src/query/mtr_hops.rs:400-415 | rust/srql/src/query/mtr_traces.rs:258-273 — before extracting anything, compare `rust/srql/src/query/capacity_forecasts.rs` and `rust/srql/src/query/mtr_hops.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/capacity_forecasts.rs:219` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–16 lines × 2) rust/anomaly-addon/src/verdict.rs:121— rust/anomaly-addon/src/verdict.rs:121-136 | rust/anomaly-addon/src/verdict.rs:294-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/anomaly-addon/src/verdict.rs:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 24) rust/srql/src/query/addon_statuses.rs:57— rust/srql/src/query/addon_statuses.rs:57-71 | rust/srql/src/query/agents.rs:70-84 | REDACTED:89-103 | rust/srql/src/query/bmp_events.rs:63-77 | rust/srql/src/query/capacity_forecasts.rs:90-104 | rust/srql/src/query/composite_results.rs:129-143 | rust/srql/src/query/devices.rs:165-179 | rust/srql/src/query/endpoint_inventory_scans.rs:74-88 | rust/srql/src/query/endpoint_package_catalog.rs:76-90 | rust/srql/src/query/endpoint_packages.rs:100-114 | rust/srql/src/query/events.rs:102-116 | rust/srql/src/query/gateways.rs:152-166 | rust/srql/src/query/mtr_hops.rs:203-217 | rust/srql/src/query/mtr_traces.rs:120-134 | rust/srql/src/query/otel_metric_points.rs:93-107 | rust/srql/src/query/otel_metrics.rs:86-100 | rust/srql/src/query/services.rs:160-174 | rust/srql/src/query/sweep_coverage.rs:92-106 | rust/srql/src/query/sweep_executions.rs:63-77 | rust/srql/src/query/sweep_groups.rs:57-71 | rust/srql/src/query/sweep_profiles.rs:104-118 | rust/srql/src/query/sweep_results.rs:86-100 | REDACTED:211-225 | rust/srql/src/query/traces.rs:93-107 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 5) rust/srql/src/query/downsample/filters.rs:24— rust/srql/src/query/downsample/filters.rs:24-38 | rust/srql/src/query/logs/rollup.rs:83-97 | rust/srql/src/query/logs/stats_clauses.rs:12-26 | REDACTED:2334-2348 | rust/srql/src/query/traces.rs:344-358 — before extracting anything, compare `rust/srql/src/query/downsample/filters.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/downsample/filters.rs:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 4) rust/srql/src/query/sweep_coverage.rs:225— rust/srql/src/query/sweep_coverage.rs:225-239 | rust/srql/src/query/sweep_executions.rs:185-199 | rust/srql/src/query/sweep_profiles.rs:239-253 | rust/srql/src/query/sweep_results.rs:232-246 — before extracting anything, compare `rust/srql/src/query/sweep_coverage.rs` and `rust/srql/src/query/sweep_executions.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/sweep_coverage.rs:225` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–13 lines × 3) rust/srql/src/query/devices/stats/spec.rs:32— rust/srql/src/query/devices/stats/spec.rs:32-44 | REDACTED:449-457 | rust/srql/src/query/services.rs:225-237 — before extracting anything, compare `rust/srql/src/query/devices/stats/spec.rs` and `rust/srql/src/query/services.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices/stats/spec.rs:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 3) rust/srql/src/query/logs/stats_expr.rs:68— rust/srql/src/query/logs/stats_expr.rs:68-80 | rust/srql/src/query/trace_summaries.rs:649-660 | rust/srql/src/query/trace_summaries.rs:746-757 — before extracting anything, compare `rust/srql/src/query/logs/stats_expr.rs` and `rust/srql/src/query/trace_summaries.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/stats_expr.rs:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–13 lines × 2) REDACTED:314— REDACTED:314-326 | REDACTED:1157-1166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 21) rust/srql/src/query/addon_statuses.rs:135— rust/srql/src/query/addon_statuses.rs:135-146 | rust/srql/src/query/agents.rs:374-385 | REDACTED:206-217 | rust/srql/src/query/bmp_events.rs:235-246 | rust/srql/src/query/endpoint_inventory_scans.rs:225-236 | rust/srql/src/query/endpoint_package_catalog.rs:203-214 | rust/srql/src/query/endpoint_packages.rs:679-690 | rust/srql/src/query/events/filters.rs:843-854 | rust/srql/src/query/gateways.rs:242-253 | rust/srql/src/query/logs/filters.rs:292-303 | rust/srql/src/query/otel_metric_points.rs:142-153 | rust/srql/src/query/otel_metrics.rs:165-176 | rust/srql/src/query/services.rs:459-470 | rust/srql/src/query/source_fact_disagreements.rs:151-162 | rust/srql/src/query/sweep_coverage.rs:190-201 | rust/srql/src/query/sweep_executions.rs:150-161 | rust/srql/src/query/sweep_groups.rs:174-185 | rust/srql/src/query/sweep_profiles.rs:199-210 | rust/srql/src/query/sweep_results.rs:195-206 | REDACTED:914-925 | rust/srql/src/query/traces.rs:484-495 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 8) REDACTED:44— REDACTED:44-53 | rust/srql/src/query/identity/decisions.rs:42-53 | rust/srql/src/query/identity/deduplication_tasks.rs:40-51 | rust/srql/src/query/identity/device_identifiers.rs:90-101 | rust/srql/src/query/identity/device_revival_audit.rs:42-53 | rust/srql/src/query/identity/evidence_edges.rs:49-60 | rust/srql/src/query/identity/merge_audit.rs:41-52 | rust/srql/src/query/identity/reconciliation_runs.rs:46-57 — before extracting anything, compare `rust/srql/src/query/identity/decisions.rs` and `rust/srql/src/query/identity/deduplication_tasks.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 7) rust/srql/src/query/addon_statuses.rs:163— rust/srql/src/query/addon_statuses.rs:163-173 | rust/srql/src/query/agents.rs:455-465 | rust/srql/src/query/endpoint_inventory_scans.rs:260-271 | rust/srql/src/query/endpoint_package_catalog.rs:245-256 | rust/srql/src/query/endpoint_packages.rs:747-758 | rust/srql/src/query/gateways.rs:275-285 | rust/srql/src/query/sweep_groups.rs:234-244 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 5) rust/srql/src/query/camera_sources.rs:122— rust/srql/src/query/camera_sources.rs:122-133 | rust/srql/src/query/identity/decisions.rs:79-90 | rust/srql/src/query/identity/deduplication_tasks.rs:77-88 | rust/srql/src/query/identity/device_revival_audit.rs:79-90 | rust/srql/src/query/identity/reconciliation_runs.rs:83-94 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/identity/decisions.rs` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/camera_sources.rs:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/identity/decisions.rs:93` calls `order_by` and `rust/srql/src/query/camera_sources.rs:135` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 22) rust/srql/src/query/addon_statuses.rs:130— rust/srql/src/query/addon_statuses.rs:130-140 | rust/srql/src/query/agents.rs:369-379 | rust/srql/src/query/bmp_events.rs:230-240 | rust/srql/src/query/devices/filters/params.rs:69-79 | rust/srql/src/query/devices/filters/params.rs:223-233 | rust/srql/src/query/devices/filters/params.rs:259-269 | rust/srql/src/query/endpoint_inventory_scans.rs:220-230 | rust/srql/src/query/endpoint_package_catalog.rs:198-208 | rust/srql/src/query/endpoint_packages.rs:674-684 | rust/srql/src/query/gateways.rs:237-247 | rust/srql/src/query/logs/filters.rs:287-297 | rust/srql/src/query/otel_metric_points.rs:137-147 | rust/srql/src/query/otel_metrics.rs:160-170 | rust/srql/src/query/services.rs:454-464 | rust/srql/src/query/source_fact_disagreements.rs:146-156 | rust/srql/src/query/sweep_coverage.rs:185-195 | rust/srql/src/query/sweep_executions.rs:145-155 | rust/srql/src/query/sweep_groups.rs:169-179 | rust/srql/src/query/sweep_profiles.rs:194-204 | rust/srql/src/query/sweep_results.rs:190-200 | REDACTED:909-919 | rust/srql/src/query/traces.rs:479-489 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (3–11 lines × 7) rust/srql/src/query/field_survey.rs:711— rust/srql/src/query/field_survey.rs:711-721 | rust/srql/src/query/gateways.rs:63-73 | rust/srql/src/query/interfaces/bind.rs:20-30 | rust/srql/src/query/sql.rs:174-184 | REDACTED:608-610 | rust/srql/src/query/virtualization.rs:681-683 | rust/srql/src/query/wifi_map.rs:767-777 — before extracting anything, compare `rust/srql/src/query/field_survey.rs` and `rust/srql/src/query/wifi_map.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:608` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/field_survey.rs:710` calls `Float`, `Ok`, `Timestamptz` and `rust/srql/src/query/virtualization.rs:681` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–11 lines × 4) rust/srql/src/query/otel_metric_points.rs:448— rust/srql/src/query/otel_metric_points.rs:448-455 | rust/srql/src/query/otel_metrics.rs:422-429 | rust/srql/src/query/trace_summaries.rs:198-205 | rust/srql/src/query/trace_summaries.rs:226-236 — before extracting anything, compare `rust/srql/src/query/otel_metric_points.rs` and `rust/srql/src/query/otel_metrics.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/trace_summaries.rs:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 4) rust/srql/src/query/viz/metrics.rs:37— rust/srql/src/query/viz/metrics.rs:37-46 | rust/srql/src/query/viz/metrics.rs:73-83 | rust/srql/src/query/viz/metrics.rs:140-149 | rust/srql/src/query/viz/metrics.rs:177-186 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/viz/metrics.rs:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/viz/metrics.rs:46` calls `col`, `Some` and `rust/srql/src/query/viz/metrics.rs:83` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–11 lines × 3) rust/srql/src/query/logs/mod.rs:169— rust/srql/src/query/logs/mod.rs:169-176 | rust/srql/src/query/logs/mod.rs:220-230 | rust/srql/src/query/logs/stats.rs:104-111 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/mod.rs:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 25) rust/srql/src/query/addon_statuses.rs:59— rust/srql/src/query/addon_statuses.rs:59-68 | rust/srql/src/query/agents.rs:72-81 | REDACTED:91-100 | rust/srql/src/query/bmp_events.rs:65-74 | rust/srql/src/query/capacity_forecasts.rs:92-101 | rust/srql/src/query/composite_results.rs:131-140 | rust/srql/src/query/devices.rs:167-176 | rust/srql/src/query/endpoint_inventory_scans.rs:76-85 | rust/srql/src/query/endpoint_package_catalog.rs:78-87 | rust/srql/src/query/endpoint_packages.rs:102-111 | rust/srql/src/query/events.rs:83-92 | rust/srql/src/query/events.rs:104-113 | rust/srql/src/query/gateways.rs:154-163 | rust/srql/src/query/mtr_hops.rs:205-214 | rust/srql/src/query/mtr_traces.rs:122-131 | rust/srql/src/query/otel_metric_points.rs:95-104 | rust/srql/src/query/otel_metrics.rs:88-97 | rust/srql/src/query/services.rs:162-171 | rust/srql/src/query/sweep_coverage.rs:94-103 | rust/srql/src/query/sweep_executions.rs:65-74 | rust/srql/src/query/sweep_groups.rs:59-68 | rust/srql/src/query/sweep_profiles.rs:106-115 | rust/srql/src/query/sweep_results.rs:88-97 | REDACTED:213-222 | rust/srql/src/query/traces.rs:95-104 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/events.rs:102` calls `reconcile_limit_offset_binds` and `rust/srql/src/query/events.rs:81` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 7) REDACTED:48— REDACTED:48-56 | rust/srql/src/query/camera_sources.rs:39-48 | rust/srql/src/query/device_sweep_overlap.rs:44-53 | rust/srql/src/query/field_survey.rs:37-46 | rust/srql/src/query/public_endpoints.rs:38-47 | rust/srql/src/query/threat_intel_matches.rs:51-59 | rust/srql/src/query/wifi_map.rs:36-45 — before extracting anything, compare `REDACTED` and `rust/srql/src/query/threat_intel_matches.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/field_survey.rs:25` calls `reject_stats` and `rust/srql/src/query/camera_sources.rs:34` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 22) rust/srql/src/query/addon_statuses.rs:49— rust/srql/src/query/addon_statuses.rs:49-57 | REDACTED:81-89 | rust/srql/src/query/bmp_events.rs:55-63 | rust/srql/src/query/capacity_forecasts.rs:82-90 | rust/srql/src/query/composite_results.rs:121-129 | rust/srql/src/query/devices.rs:157-165 | rust/srql/src/query/endpoint_inventory_scans.rs:66-74 | rust/srql/src/query/endpoint_package_catalog.rs:68-76 | rust/srql/src/query/endpoint_packages.rs:92-100 | rust/srql/src/query/gateways.rs:144-152 | rust/srql/src/query/mtr_hops.rs:197-203 | rust/srql/src/query/mtr_traces.rs:112-120 | rust/srql/src/query/otel_metric_points.rs:85-93 | rust/srql/src/query/otel_metrics.rs:78-86 | rust/srql/src/query/services.rs:152-160 | rust/srql/src/query/source_fact_disagreements.rs:51-59 | rust/srql/src/query/sweep_executions.rs:55-63 | rust/srql/src/query/sweep_groups.rs:49-57 | rust/srql/src/query/sweep_profiles.rs:96-104 | rust/srql/src/query/sweep_results.rs:78-86 | REDACTED:203-211 | rust/srql/src/query/traces.rs:85-93 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `REDACTED` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 5) elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:461— elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:461-468 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:485-492 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:545-553 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:568-575 | elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:589-596 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `elixir/serviceradar_core/native/dgraph_nif/src/lib.rs:461` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 4) rust/srql/src/query/endpoint_packages.rs:81— rust/srql/src/query/endpoint_packages.rs:81-89 | rust/srql/src/query/otel_metric_points.rs:76-83 | rust/srql/src/query/otel_metrics.rs:69-76 | rust/srql/src/query/traces.rs:76-83 — before extracting anything, compare `rust/srql/src/query/endpoint_packages.rs` and `rust/srql/src/query/otel_metric_points.rs` as WHOLE FILES: this scan already matched 10 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/endpoint_packages.rs:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 3) rust/srql/src/query/events/query.rs:36— rust/srql/src/query/events/query.rs:36-44 | rust/srql/src/query/mtr_hops.rs:235-241 | rust/srql/src/query/mtr_traces.rs:148-154 — before extracting anything, compare `rust/srql/src/query/mtr_hops.rs` and `rust/srql/src/query/mtr_traces.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 238 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–8 lines × 25) rust/srql/src/query/addon_statuses.rs:46— rust/srql/src/query/addon_statuses.rs:46-53 | rust/srql/src/query/agents.rs:59-66 | REDACTED:79-85 | REDACTED:465-472 | rust/srql/src/query/bmp_events.rs:53-59 | rust/srql/src/query/capacity_forecasts.rs:80-86 | rust/srql/src/query/composite_results.rs:119-125 | rust/srql/src/query/devices.rs:126-133 | rust/srql/src/query/devices.rs:154-161 | rust/srql/src/query/endpoint_inventory_scans.rs:63-70 | rust/srql/src/query/endpoint_package_catalog.rs:65-72 | rust/srql/src/query/endpoint_packages.rs:89-96 | rust/srql/src/query/gateways.rs:141-148 | rust/srql/src/query/mtr_hops.rs:195-200 | rust/srql/src/query/mtr_traces.rs:110-116 | rust/srql/src/query/otel_metric_points.rs:83-89 | rust/srql/src/query/otel_metrics.rs:76-82 | rust/srql/src/query/services.rs:123-129 | rust/srql/src/query/services.rs:150-156 | rust/srql/src/query/source_fact_disagreements.rs:48-55 | rust/srql/src/query/sweep_executions.rs:52-59 | rust/srql/src/query/sweep_groups.rs:46-53 | rust/srql/src/query/sweep_profiles.rs:93-100 | rust/srql/src/query/sweep_results.rs:75-82 | rust/srql/src/query/traces.rs:83-89 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/srql/src/query/bmp_events.rs:49` calls `reject_stats` and `rust/srql/src/query/addon_statuses.rs:42` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 25) rust/srql/src/query/addon_statuses.rs:48— rust/srql/src/query/addon_statuses.rs:48-55 | REDACTED:80-87 | REDACTED:467-474 | rust/srql/src/query/bmp_events.rs:54-61 | rust/srql/src/query/capacity_forecasts.rs:81-88 | rust/srql/src/query/composite_results.rs:120-127 | rust/srql/src/query/devices.rs:128-135 | rust/srql/src/query/devices.rs:156-163 | rust/srql/src/query/endpoint_inventory_scans.rs:65-72 | rust/srql/src/query/endpoint_package_catalog.rs:67-74 | rust/srql/src/query/endpoint_packages.rs:91-98 | rust/srql/src/query/gateways.rs:143-150 | rust/srql/src/query/mtr_hops.rs:196-202 | rust/srql/src/query/mtr_traces.rs:111-118 | rust/srql/src/query/otel_metric_points.rs:84-91 | rust/srql/src/query/otel_metrics.rs:77-84 | rust/srql/src/query/services.rs:124-131 | rust/srql/src/query/services.rs:151-158 | rust/srql/src/query/source_fact_disagreements.rs:50-57 | rust/srql/src/query/sweep_executions.rs:54-61 | rust/srql/src/query/sweep_groups.rs:48-55 | rust/srql/src/query/sweep_profiles.rs:95-102 | rust/srql/src/query/sweep_results.rs:77-84 | REDACTED:202-209 | rust/srql/src/query/traces.rs:84-91 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `REDACTED` as WHOLE FILES: this scan already matched 7 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/srql/src/query/addon_statuses.rs:57` calls `reconcile_limit_offset_binds` and `rust/srql/src/query/devices.rs:138` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 24) rust/srql/src/query/addon_statuses.rs:134— rust/srql/src/query/addon_statuses.rs:134-140 | rust/srql/src/query/agents.rs:373-379 | REDACTED:205-211 | rust/srql/src/query/bmp_events.rs:234-240 | rust/srql/src/query/devices/filters/params.rs:73-80 | rust/srql/src/query/devices/filters/params.rs:227-234 | rust/srql/src/query/devices/filters/params.rs:263-269 | rust/srql/src/query/endpoint_inventory_scans.rs:224-230 | rust/srql/src/query/endpoint_package_catalog.rs:202-208 | rust/srql/src/query/endpoint_packages.rs:678-684 | rust/srql/src/query/events/filters.rs:842-848 | rust/srql/src/query/gateways.rs:241-247 | rust/srql/src/query/logs/filters.rs:291-297 | rust/srql/src/query/otel_metric_points.rs:141-147 | rust/srql/src/query/otel_metrics.rs:164-170 | rust/srql/src/query/services.rs:458-464 | rust/srql/src/query/source_fact_disagreements.rs:150-156 | rust/srql/src/query/sweep_coverage.rs:189-195 | rust/srql/src/query/sweep_executions.rs:149-155 | rust/srql/src/query/sweep_groups.rs:173-179 | rust/srql/src/query/sweep_profiles.rs:198-204 | rust/srql/src/query/sweep_results.rs:194-200 | REDACTED:913-919 | rust/srql/src/query/traces.rs:483-489 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/devices/filters/params.rs:73` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 4) rust/srql/src/query/logs/mod.rs:170— rust/srql/src/query/logs/mod.rs:170-177 | rust/srql/src/query/logs/mod.rs:224-231 | rust/srql/src/query/logs/stats.rs:105-112 | rust/srql/src/query/starrocks.rs:1113-1119 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/logs/mod.rs:170` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 26) rust/srql/src/query/addon_statuses.rs:128— rust/srql/src/query/addon_statuses.rs:128-133 | rust/srql/src/query/agents.rs:367-372 | rust/srql/src/query/bmp_events.rs:228-233 | rust/srql/src/query/capacity_forecasts.rs:217-222 | rust/srql/src/query/composite_results.rs:217-222 | rust/srql/src/query/devices/filters/params.rs:221-226 | rust/srql/src/query/devices/filters/params.rs:257-262 | rust/srql/src/query/endpoint_inventory_scans.rs:218-223 | rust/srql/src/query/endpoint_package_catalog.rs:196-201 | rust/srql/src/query/endpoint_packages.rs:672-677 | rust/srql/src/query/gateways.rs:235-240 | rust/srql/src/query/logs/filters.rs:285-290 | rust/srql/src/query/logs/filters.rs:309-314 | rust/srql/src/query/mtr_hops.rs:398-403 | rust/srql/src/query/mtr_traces.rs:256-261 | rust/srql/src/query/otel_metric_points.rs:135-140 | rust/srql/src/query/otel_metrics.rs:158-163 | rust/srql/src/query/services.rs:452-457 | rust/srql/src/query/source_fact_disagreements.rs:144-149 | rust/srql/src/query/sweep_coverage.rs:183-188 | rust/srql/src/query/sweep_executions.rs:143-148 | rust/srql/src/query/sweep_groups.rs:167-172 | rust/srql/src/query/sweep_profiles.rs:192-197 | rust/srql/src/query/sweep_results.rs:188-193 | REDACTED:907-912 | rust/srql/src/query/traces.rs:477-482 — before extracting anything, compare `rust/srql/src/query/addon_statuses.rs` and `rust/srql/src/query/agents.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/addon_statuses.rs:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) rust/srql/src/query/field_survey.rs:400— rust/srql/src/query/field_survey.rs:400-404 | rust/srql/src/query/field_survey.rs:421-425 | rust/srql/src/query/field_survey.rs:440-443 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/field_survey.rs:400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (134 lines × 4) rust/srql/src/query/viz/events.rs:6— rust/srql/src/query/viz/events.rs:6-139 | rust/srql/src/query/viz/network.rs:6-255 | rust/srql/src/query/viz/sbom.rs:6-239 | rust/srql/src/query/viz/services.rs:6-237 — 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.
Duplicated block (5 lines × 11) rust/srql/src/query/camera_sources.rs:61— rust/srql/src/query/camera_sources.rs:61-65 | rust/srql/src/query/device_sweep_overlap.rs:66-70 | rust/srql/src/query/identity/decisions.rs:58-62 | rust/srql/src/query/identity/deduplication_tasks.rs:56-60 | rust/srql/src/query/identity/device_identifiers.rs:106-110 | rust/srql/src/query/identity/device_revival_audit.rs:58-62 | rust/srql/src/query/identity/evidence_edges.rs:65-69 | rust/srql/src/query/identity/merge_audit.rs:57-61 | rust/srql/src/query/identity/reconciliation_runs.rs:62-66 | rust/srql/src/query/public_endpoints.rs:60-64 | rust/srql/src/query/wifi_map.rs:58-62 — before extracting anything, compare `rust/srql/src/query/camera_sources.rs` and `rust/srql/src/query/device_sweep_overlap.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 95 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 (28–39 lines × 2) rust/srql/src/query/traces.rs:251— rust/srql/src/query/traces.rs:251-278 | rust/srql/src/query/traces.rs:296-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/srql/src/query/traces.rs:251` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication· Edited copies of one member (3 members, 39+ corresponding lines) · ×1
Edited copies of one member (3 members, 39+ corresponding lines) integration_tests/srql_parity/src/fixture/logs.rs:127— integration_tests/srql_parity/src/fixture/logs.rs:127-165 | integration_tests/srql_parity/src/fixture/mtr.rs:150-188 | integration_tests/srql_parity/src/fixture/mtr.rs:190-231 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (8–12 lines × 2) tools/anomaly-proof/gen.py:156— tools/anomaly-proof/gen.py:156-167 | tools/anomaly-proof/gen.py:195-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplication concentrated across 6 sibling directories (11 clone groups) REDACTED:820— 11 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 — 8 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 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 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 11 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.
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 (38 lines × 2 locations) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:91— elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:91 · 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:395 — 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.
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.
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.
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.
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:98— elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.js:98 · elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:606 — 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) elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1701— elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1701 · 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.
R10 · Code Duplication· Duplicated block with local edits (14 matched lines × 2 locations) · ×1
Duplicated block with local edits (14 matched lines × 2 locations) elixir/web-ng/assets/js/lib/god_view/lifecycle_managed_camera_recovery.js:139— elixir/web-ng/assets/js/lib/god_view/lifecycle_managed_camera_recovery.js:139 · elixir/web-ng/assets/js/lib/god_view/lifecycle_managed_camera_recovery.js:160 — the two spans are one implementation copied and then locally edited — 57 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 (13 lines × 2 locations) elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:362— elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:362 · elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:412 — 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 (13 lines × 3 locations) REDACTED:820— REDACTED:820 · elixir/web-ng/assets/js/dashboards/service_availability_noc.js:369 · elixir/web-ng/assets/js/utils/dashboard_user_time.js:17 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function 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:370— 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:70— 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 buildVisibleGraphData (cyclomatic 46, cognitive 49) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:172— buildVisibleGraphData has cyclomatic complexity 46 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 (anonymous) (cyclomatic 46, cognitive 48) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:498— (anonymous) has cyclomatic complexity 46 and cognitive complexity 48; 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 46, cognitive 34) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:328— (anonymous) has cyclomatic complexity 46 and cognitive complexity 34; 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 _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 buildPacketFlowEdges (cyclomatic 43, cognitive 57) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_particle_methods.js:12— buildPacketFlowEdges has cyclomatic complexity 43 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 (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 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 admitNodeLabelsForViewport (cyclomatic 36, cognitive 38) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:446— admitNodeLabelsForViewport 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 aggregateVisibleEdges (cyclomatic 35, cognitive 49) elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:607— aggregateVisibleEdges has cyclomatic complexity 35 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.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 35, cognitive 39) · ×1
Complex function main (cyclomatic 35, cognitive 39) REDACTED:10— main has cyclomatic complexity 35 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 handleSnapshot (cyclomatic 34, cognitive 35) elixir/web-ng/assets/js/lib/god_view/lifecycle_stream_snapshot_methods.js:76— 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 selectNodeLabels (cyclomatic 33, cognitive 42) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:289— selectNodeLabels has cyclomatic complexity 33 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 renderCondition (cyclomatic 32, cognitive 35) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:212— renderCondition has cyclomatic complexity 32 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 decodeWorldTile (cyclomatic 32, cognitive 31) elixir/web-ng/assets/js/lib/god_view/world_tile_decode.js:39— decodeWorldTile has cyclomatic complexity 32 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 _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.
Complex function MiniVisual (cyclomatic 30, cognitive 33) elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:227— MiniVisual has cyclomatic complexity 30 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 expression (cyclomatic 29, cognitive 33) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:346— expression has cyclomatic complexity 29 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 openSession (cyclomatic 28, cognitive 29) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:922— openSession has cyclomatic complexity 28 and cognitive complexity 29; 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 handlePick (cyclomatic 27, cognitive 33) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:353— handlePick has cyclomatic complexity 27 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 expandableEndpointClusterId (cyclomatic 27, cognitive 18) elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:240— expandableEndpointClusterId has cyclomatic complexity 27 and cognitive complexity 18; 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 buildNodeAndLabelLayers (cyclomatic 26, cognitive 27) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:566— buildNodeAndLabelLayers has cyclomatic complexity 26 and cognitive complexity 27; 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 edgeEnabledByTopologyLayer (cyclomatic 26, cognitive 20) elixir/web-ng/assets/js/lib/god_view/rendering_style_edge_topology_methods.js:143— edgeEnabledByTopologyLayer has cyclomatic complexity 26 and cognitive complexity 20; 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 26, cognitive 18) elixir/web-ng/assets/js/lib/god_view/layout_cluster_methods.js:172— (anonymous) has cyclomatic complexity 26 and cognitive complexity 18; 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 gridPanelAtPointer (cyclomatic 26, cognitive 15) elixir/web-ng/assets/js/hooks/charts/NetflowGridChart.js:70— gridPanelAtPointer has cyclomatic complexity 26 and cognitive complexity 15; 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 handleDetailsPanelClick (cyclomatic 24, cognitive 33) elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:207— handleDetailsPanelClick has cyclomatic complexity 24 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 receive (cyclomatic 24, cognitive 31) elixir/web-ng/assets/js/lib/god_view/world_membership.js:44— receive has cyclomatic complexity 24 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 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 update (cyclomatic 23, cognitive 23) elixir/web-ng/assets/js/lib/god_view/world_filter_panel.js:122— update has cyclomatic complexity 23 and cognitive complexity 23; 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 buildTransportAndEffectLayers (cyclomatic 23, cognitive 21) elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_transport_methods.js:62— buildTransportAndEffectLayers has cyclomatic complexity 23 and cognitive complexity 21; 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 decodeWorldOverlay (cyclomatic 23, cognitive 15) elixir/web-ng/assets/js/lib/god_view/world_overlay_frame.js:20— decodeWorldOverlay has cyclomatic complexity 23 and cognitive complexity 15; 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 assertScene (cyclomatic 22, cognitive 35) elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:175— assertScene has cyclomatic complexity 22 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 renderLayers (cyclomatic 22, cognitive 34) elixir/web-ng/assets/js/lib/god_view/world_tile_layer.js:230— renderLayers has cyclomatic complexity 22 and cognitive complexity 34; 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 draw (cyclomatic 22, cognitive 29) elixir/web-ng/assets/js/hooks/charts/FlowRateChart.js:140— draw has cyclomatic complexity 22 and cognitive complexity 29; 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 22, cognitive 27) elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:742— (anonymous) has cyclomatic complexity 22 and cognitive complexity 27; 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.
R3 · Large Files· elixir/web-ng/assets/js/hooks/DashboardWasmHost.js · ×1
elixir/web-ng/assets/js/hooks/DashboardWasmHost.js: 1706 lines of code elixir/web-ng/assets/js/hooks/DashboardWasmHost.js:1— elixir/web-ng/assets/js/hooks/DashboardWasmHost.js has 1706 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js · ×1
elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js: 1699 lines of code elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js:1— elixir/web-ng/assets/js/hooks/OperationsTrafficMap.js has 1699 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx · ×1
elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx: 1347 lines of code elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx:1— elixir/web-ng/assets/component/src/RemoteAccessSSHConsole.jsx has 1347 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js · ×1
elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js: 1187 lines of code elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js:1— elixir/web-ng/assets/js/lib/god_view/rendering_graph_view_methods.js has 1187 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js · ×1
elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js: 1164 lines of code elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js:1— elixir/web-ng/assets/js/lib/god_view/layout_elk_scene.js has 1164 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx · ×1
elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx: 911 lines of code elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx:1— elixir/web-ng/assets/component/src/RemoteAccessDesktopSession.jsx has 911 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js · ×1
elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js: 860 lines of code elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js:1— elixir/web-ng/assets/js/lib/god_view/WorldMapRenderer.js has 860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/god_view_world_gpu.playwright.js · ×1
elixir/web-ng/assets/god_view_world_gpu.playwright.js: 796 lines of code elixir/web-ng/assets/god_view_world_gpu.playwright.js:1— elixir/web-ng/assets/god_view_world_gpu.playwright.js has 796 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js · ×1
elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js: 776 lines of code elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js:1— elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.js has 776 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js · ×1
elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js: 759 lines of code elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js:1— elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.js has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js · ×1
elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js: 757 lines of code elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js:1— elixir/web-ng/assets/js/lib/god_view/rendering_graph_layer_node_methods.js has 757 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/component/src/DashboardPanelChart.jsx · ×1
elixir/web-ng/assets/component/src/DashboardPanelChart.jsx: 751 lines of code elixir/web-ng/assets/component/src/DashboardPanelChart.jsx:1— elixir/web-ng/assets/component/src/DashboardPanelChart.jsx has 751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 747 lines of code REDACTED:1— REDACTED has 747 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js · ×1
elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js: 711 lines of code elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js:1— elixir/web-ng/assets/js/lib/god_view/rendering_graph_data_methods.js has 711 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/camera_relay/viewer.js · ×1
elixir/web-ng/assets/js/lib/camera_relay/viewer.js: 681 lines of code elixir/web-ng/assets/js/lib/camera_relay/viewer.js:1— elixir/web-ng/assets/js/lib/camera_relay/viewer.js has 681 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js · ×1
elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js: 601 lines of code elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js:1— elixir/web-ng/assets/js/lib/god_view/topology_overview_projection.js has 601 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/hooks/SRQLInput.js · ×1
elixir/web-ng/assets/js/hooks/SRQLInput.js: 593 lines of code elixir/web-ng/assets/js/hooks/SRQLInput.js:1— elixir/web-ng/assets/js/hooks/SRQLInput.js has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· 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: 567 lines of code 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 has 567 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js · ×1
elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js: 563 lines of code elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js:1— elixir/web-ng/assets/js/hooks/charts/NetflowStackedAreaChart.js has 563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx · ×1
elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx: 530 lines of code elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx:1— elixir/web-ng/assets/component/src/DashboardBuilderCanvas.jsx has 530 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js · ×1
elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js: 527 lines of code elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js:1— elixir/web-ng/assets/god_view_elk_scene_acceptance.playwright.js has 527 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js · ×1
elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js: 464 lines of code elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js:1— elixir/web-ng/assets/js/lib/remote_desktop/renderer_state.js has 464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js · ×1
elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js: 461 lines of code elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js:1— elixir/web-ng/assets/js/lib/god_view/rendering_scene_view.js has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js · ×1
elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js: 453 lines of code elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js:1— elixir/web-ng/assets/js/lib/god_view/rendering_label_collision.js has 453 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js · ×1
elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js: 448 lines of code elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js:1— elixir/web-ng/assets/js/lib/god_view/layout_elk_radial_overview.js has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/srql/monaco_srql.js · ×1
elixir/web-ng/assets/js/lib/srql/monaco_srql.js: 443 lines of code elixir/web-ng/assets/js/lib/srql/monaco_srql.js:1— elixir/web-ng/assets/js/lib/srql/monaco_srql.js has 443 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js · ×1
elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js: 422 lines of code elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js:1— elixir/web-ng/assets/js/lib/god_view/rendering_selection_methods.js has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· elixir/web-ng/assets/js/lib/camera_relay/player.js · ×1
elixir/web-ng/assets/js/lib/camera_relay/player.js: 405 lines of code elixir/web-ng/assets/js/lib/camera_relay/player.js:1— elixir/web-ng/assets/js/lib/camera_relay/player.js has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Unused dependency '@deck.gl/aggregation-layers' — Declared in REDACTED 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 REDACTED 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 '@luma.gl/webgl' — Declared in REDACTED 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 'events' — Declared in REDACTED 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.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/delayed_seeder.ex:31— `Application.get_env(:serviceradar_core, :repo_enabled, true) != false && is_pid(Process.whereis(ServiceRadar.Repo))` appears character-identically in 5 files — elixir/serviceradar_core/lib/serviceradar/delayed_seeder.ex, elixir/serviceradar_core/lib/serviceradar/inventory/advisory_feeds/config.ex, elixir/serviceradar_core/lib/serviceradar/observability/zen/normalizer.ex, elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_sync.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex:1621— `Application.get_env(:serviceradar_core, :repo_enabled, true) != false and is_pid(Process.whereis(Repo))` appears character-identically in 4 files — elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex, elixir/serviceradar_core/lib/serviceradar/edge/remote_access_file_transfers.ex, elixir/serviceradar_core/lib/serviceradar/inventory/device_lifecycle.ex, elixir/serviceradar_core/lib/serviceradar/nats/durable_publish.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_config_defaults.ex:55— `Ash.Changeset.get_attribute(changeset, :addon_package_id) || Map.get(changeset.data, :addon_package_id)` appears character-identically in 5 files — elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_config_defaults.ex, elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_addon_update_policy_defaults.ex, elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_addon_id.ex, elixir/serviceradar_core/lib/serviceradar/plugins/validations/addon_assignment_params.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/inventory/changes/prepare_deduplication_task.ex:15— `Ash.Changeset.get_attribute(changeset, :device_uids) || []` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/inventory/changes/prepare_deduplication_task.ex, elixir/serviceradar_core/lib/serviceradar/inventory/changes/prepare_identity_decision.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_plugin_update_policy.ex:102— `Ash.Changeset.get_attribute(changeset, :plugin_package_id) || Map.get(changeset.data, :plugin_package_id)` appears character-identically in 4 files — elixir/serviceradar_core/lib/serviceradar/plugins/changes/apply_plugin_update_policy.ex, elixir/serviceradar_core/lib/serviceradar/plugins/changes/set_assignment_plugin_id.ex, elixir/serviceradar_core/lib/serviceradar/plugins/validations/assignment_params.ex, elixir/serviceradar_core/lib/serviceradar/plugins/validations/package_approved.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/automation/ansible/changes/approve_awx_host_membership.ex:21— `AshContext.actor(changeset) || AshContext.actor(context)` appears character-identically in 4 files — elixir/serviceradar_core/lib/serviceradar/automation/ansible/changes/approve_awx_host_membership.ex, elixir/serviceradar_core/lib/serviceradar/automation/ansible/changes/release_awx_host_membership_quarantine.ex, elixir/serviceradar_core/lib/serviceradar/automation/ansible/changes/stamp_target_hold_clearance.ex, elixir/serviceradar_core/lib/serviceradar/plugins/changes/prepare_policy_assignment_recovery_request.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/http/egress_client.ex:840— `Code.ensure_loaded?(CAStore) and function_exported?(CAStore, :file_path, 0)` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/http/egress_client.ex, elixir/serviceradar_core/lib/serviceradar/http/egress_proxy.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/edge/semantic_validate.ex:631— `Code.ensure_loaded?(mod) and function_exported?(mod, :__message_props__, 0)` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/edge/semantic_validate.ex, elixir/serviceradar_core/lib/serviceradar/edge/wire_validate.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex:68— `Keyword.get(config(), :jetstream_max_bucket_size) || @default_max_bucket_bytes` appears character-identically in 3 files — elixir/serviceradar_core/lib/serviceradar/observability/threat_intel_raw_payload_store.ex, elixir/web-ng/lib/serviceradar_web_ng/field_survey_artifact_store.ex, elixir/web-ng/lib/serviceradar_web_ng/plugins/storage.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex:145— `Keyword.get(opts, :actor) || scope_actor(scope)` appears character-identically in 3 files — elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_assignments.ex, elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_profiles.ex, elixir/web-ng/lib/serviceradar_web_ng/plugins/addon_rollouts.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/composite_checks/validation/coverage.ex:28— `Keyword.get(opts, :actor) || system_actor()` appears character-identically in 3 files — elixir/serviceradar_core/lib/serviceradar/composite_checks/validation/coverage.ex, elixir/serviceradar_core/lib/serviceradar/composite_checks/validation/orchestrator.ex, elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_events.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex:144— `Keyword.get(opts, :audit_actor) || Keyword.get(opts, :actor)` appears character-identically in 3 files — elixir/serviceradar_core/lib/serviceradar/edge/remote_access_broker.ex, elixir/serviceradar_core/lib/serviceradar/edge/remote_access_recordings.ex, elixir/web-ng/lib/serviceradar_web_ng/edge/gateway_certificate_issuer.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/sections.ex:211— `Keyword.get(opts, :bucket) || Query.bucket_for_time_range(time_range)` appears character-identically in 2 files — elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/sysmon_metrics/sections.ex, elixir/web-ng/lib/serviceradar_web_ng_web/live/interface_live/metrics_query.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:98— `Keyword.get(opts, :dir) || Keyword.get(config, :dir, System.get_env("GEOLITE_MMDB_DIR") || @default_dir)` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex, elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/inventory/device_hostname_rdns.ex:44— `Keyword.get(opts, :now) || DateTime.utc_now()` appears character-identically in 4 files — elixir/serviceradar_core/lib/serviceradar/inventory/device_hostname_rdns.ex, elixir/serviceradar_core/lib/serviceradar/notifications/callbacks/pager_duty.ex, elixir/serviceradar_core/lib/serviceradar/notifications/callbacks/slack.ex, elixir/serviceradar_core/lib/serviceradar/plugins/native_addon_importer.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex:842— `Keyword.get(opts, :observed_at) || observed_at(payload, status)` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/inventory/hypervisor_enrichment_ingestor.ex, elixir/serviceradar_core/lib/serviceradar/inventory/proxmox_enrichment_ingestor.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/camera/event_ingestor.ex:45— `Keyword.get(opts, :observed_at) || resolve_observed_at(payload, status)` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/camera/event_ingestor.ex, elixir/serviceradar_core/lib/serviceradar/camera/inventory_ingestor.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex:102— `Keyword.get(opts, :timeout_ms) || Keyword.get(config, :timeout_ms, @default_timeout_ms)` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/observability/geolite_mmdb_download_worker.ex, elixir/serviceradar_core/lib/serviceradar/observability/ipinfo_mmdb_download_worker.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex:2094— `List.first(errors) || :bulk_update_failed` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex, elixir/web-ng/lib/serviceradar_web_ng_web/live/device_live/device_resource_data.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/grpc_safe_logger_interceptor.ex:25— `Logger.metadata()[:request_id] || stream.request_id` appears character-identically in 2 files — elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/grpc_safe_logger_interceptor.ex, elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/safe_grpc_logger.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/inventory/changes/set_resolved_by.ex:19— `Map.get(actor, :email) || Map.get(actor, :id) || "unknown"` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/inventory/changes/set_resolved_by.ex, elixir/serviceradar_core/lib/serviceradar/observability/changes/stamp_retention_change.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex:134— `Map.get(actor, key) || Map.get(actor, Atom.to_string(key))` appears character-identically in 8 files — elixir/serviceradar_core/lib/serviceradar/credentials/plugin_assignment_materializer.ex, elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_audit_lookup.ex, elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_audit_writer.ex, elixir/serviceradar_core/lib/serviceradar/plugins/checks/recovery_request_dispatcher.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex:114— `Map.get(agent, :agent_id) || Map.get(agent, "agent_id")` appears character-identically in 3 files — elixir/serviceradar_core/lib/serviceradar/agent_runtime_metadata.ex, elixir/web-ng/lib/serviceradar_web_ng_web/live/scan_live.ex, elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/cluster_live/index.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/view/helpers.ex:12— `Map.get(agent, :partition_id) || Map.get(agent, "partition_id")` appears character-identically in 2 files — elixir/web-ng/lib/serviceradar_web_ng_web/live/diagnostics_live/mtr/view/helpers.ex, elixir/web-ng/lib/serviceradar_web_ng_web/live/settings/mtr_profiles_live/index.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate elixir/serviceradar_core/lib/serviceradar/edge/onboarding_packages.ex:574— `Map.get(attrs, :partition_id) || Map.get(attrs, "partition_id") || Map.get(attrs, :site) || Map.get(attrs, "site")` appears character-identically in 2 files — elixir/serviceradar_core/lib/serviceradar/edge/onboarding_packages.ex, elixir/web-ng/lib/serviceradar_web_ng/edge/onboarding_packages.ex. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Mock-dominated test: ignores stale data channel messages after the viewer session is closed elixir/web-ng/assets/js/lib/remote_desktop/webrtc_client.test.js:626— This test sets up 6 test doubles (for example `vi
.fn`) against 5 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: update delegates to context.updated when present elixir/web-ng/assets/js/lib/god_view/GodViewRenderer.test.js:61— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: mount and destroy delegate to lifecycle controller elixir/web-ng/assets/js/lib/god_view/GodViewRenderer.test.js:70— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: registerLifecycleEvents wires filter/zoom/layer/reset registration elixir/web-ng/assets/js/lib/god_view/lifecycle_bootstrap_event_methods.test.js:24— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: an animation tick rebuilds layers a render had to build without deck's viewport elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_interaction_methods.test.js:103— This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: observeTopologyContainer watches the production sibling safe-area controls elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:58— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: observeTopologyContainer reconciles safe-area chrome inserted and removed after setup elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:88— This test sets up 8 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: falls back to the Deck view manager when the canvas-size refresh is unavailable elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:372— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: handleDetailsPanelClick closes the details card elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:1634— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: handleDetailsPanelClick navigates device links elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:1657— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: handleDetailsPanelClick routes cluster expansion actions elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:1702— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: handleDetailsPanelClick pushes topology camera relay open events elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:1737— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: handleDetailsPanelClick pushes topology camera tile-set open events elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:1782— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: handleTooltipPanelClick navigates tooltip links elixir/web-ng/assets/js/lib/god_view/lifecycle_dom_setup_methods.test.js:1857— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: passes the clock and camera scales to the shader as uniforms elixir/web-ng/assets/js/lib/god_view/packet_flow_layer.test.js:114— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: submits queued GPU work before replacing the visible tile layers elixir/web-ng/assets/js/lib/god_view/world_tile_layer.test.js:137— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: submits queued GPU work before applying a camera zoom elixir/web-ng/assets/js/lib/god_view/world_tile_layer.test.js:159— This test sets up 5 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: closes a created session that misses the ready deadline elixir/web-ng/assets/component/test/RemoteAccessDesktopSession.test.jsx:351— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: deterministically closes the API session when the ready control socket fails elixir/web-ng/assets/component/test/RemoteAccessDesktopSession.test.jsx:397— This test sets up 5 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
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 new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
Subsumed condition operand rust/srql/src/query/tests/device_queries.rs:738— `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 go/pkg/agent/addon_systemd.go:857— `strings.Contains(slice, ".slice")` can never decide this `&&` — every value satisfying `strings.HasSuffix(slice, ".slice")` also satisfies `strings.Contains(slice, ".slice")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand go/pkg/agent/metric_envelope.go:624— `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 elixir/web-ng/lib/serviceradar_web_ng_web/live/event_live/show.ex:1500— `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.
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.
Hand-rolled JSON/XML parsing via regex elixir/web-ng/priv/react/server.js:240009— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex elixir/web-ng/priv/react/server.js:322363— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex elixir/web-ng/priv/react/server.js:329723— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex elixir/web-ng/priv/react/server.js:330944— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex elixir/web-ng/priv/react/server.js:343508— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 6 of 136 project(s) overshoot their size bounds, lowering Project Cohesion to 9.1/10. The most over is `elixir/web-ng` (706899 LoC, 976 module-visible types across 153 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
README/code drift helm/serviceradar/README.md:89— helm/serviceradar/README.md links to `../docs/docs/edge-agents.md`, but `helm/docs/docs/edge-agents.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P10 · Library API & versioning· Implementation type on the public API · ×1
Implementation type on the public API swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArray.swift:31— 1 public type in `swift~FieldSurvey~LocalPackages~arrow-swift~Arrow` is marked as implementation by its own namespace, folder or name: `ArrowArrayHolderImpl` (swift/FieldSurvey/LocalPackages/arrow-swift/Sources/Arrow/ArrowArray.swift:31, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
Logging is not universal — Only 33/49 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `elixir/serviceradar_core/native/dgraph_nif`, `elixir/serviceradar_core/native/topology_atlas_nif`, `elixir/serviceradar_nvr`, `elixir/web-ng/assets` and 11 more.
P3 · Security & performance tooling· Dependabot does not watch bun/gitsubmodule · ×1
Dependabot does not watch bun/gitsubmodule REDACTED:3— `REDACTED` schedules updates, but no `package-ecosystem` entry covers `bun`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
R8 · Dependency Hygiene· Test-only dependency '@luma.gl/core' in production deps · ×1
Test-only dependency '@luma.gl/core' in production deps REDACTED:29— Only test files import it (first: elixir/web-ng/assets/js/lib/god_view/world_tile_layer.test.js:5) — move it to devDependencies.
R8 · Dependency Hygiene· Test-only dependency 'smol-toml' in production deps · ×1
Test-only dependency 'smol-toml' in production deps js/cli/package.json:48— Only test files import it (first: js/cli/tests/managed-host.test.mjs:7) — move it to devDependencies.
No security response headers detected docker/compose/Caddyfile:11— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — 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.)
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 0/4 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Outdated: ash — `:ash` is locked at 3.37.2 but 3.37.4 is the current stable release on hex.pm, and it already satisfies the `"~> 3.37.2"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash` and commit the updated REDACTED.
Outdated: ash_admin — `:ash_admin` is locked at 1.3.2 but 1.4.0 is the current stable release on hex.pm, and it already satisfies the `"~> 1.3 and >= 1.3.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_admin` and commit the updated REDACTED.
Outdated: ash_ai — `:ash_ai` is locked at 1.1.1 but 1.5.4 is the current stable release on hex.pm, and it already satisfies the `"~> 1.0 and >= 1.0.3"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_ai` and commit the updated REDACTED.
Outdated: ash_cloak — `:ash_cloak` is locked at 0.4.0 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 ash_cloak` and commit the updated REDACTED.
Outdated: ash_credo — `:ash_credo` is locked at 0.19.0 but 0.19.2 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.19.0 but 0.19.2 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.19.0 but 0.19.2 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_credo — `:ash_credo` is locked at 0.19.0 but 0.19.2 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_json_api — `:ash_json_api` is locked at 1.7.1 but 1.8.0 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 ash_json_api` and commit the updated REDACTED.
Outdated: ash_phoenix — `:ash_phoenix` is locked at 2.3.25 but 2.3.26 is the current stable release on hex.pm, and it already satisfies the `"~> 2.3 and >= 2.3.25"` 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_state_machine — `:ash_state_machine` is locked at 0.2.13 but 0.3.1 is the current stable release on hex.pm, and it already satisfies the `"~> 0.2"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update ash_state_machine` and commit the updated REDACTED.
Outdated: broadway — `:broadway` is locked at 1.3.0 but 1.3.1 is the current stable release on hex.pm, and it already satisfies the `"~> 1.1"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update broadway` and commit the updated REDACTED.
Outdated: castore — `:castore` is locked at 1.0.21 but 1.0.22 is the current stable release on hex.pm, and it already satisfies the `"~> 1.0"` requirement declared in elixir/web-ng/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update castore` and commit the updated REDACTED.
Outdated: castore — `:castore` is locked at 1.0.21 but 1.0.22 is the current stable release on hex.pm, and it already satisfies the `"~> 1.0"` requirement declared in elixir/serviceradar_core/mix.exs — so the lockfile is behind this repository's own declared range. Run `mix deps.update castore` and commit the updated REDACTED.
Outdated: dialyxir — `:dialyxir` is locked at 1.4.8 but 1.4.9 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_recording_control/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.8 but 1.4.9 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.8 but 1.4.9 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: dialyxir — `:dialyxir` is locked at 1.4.8 but 1.4.9 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_nvr/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.8 but 1.4.9 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_recording_metadata/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.8 but 1.4.9 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.8 but 1.4.9 is the current stable release on hex.pm, and it already satisfies the `"~> 1.4"` requirement declared in elixir/serviceradar_recording/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.9 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.8 but 1.4.9 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.8 but 1.4.9 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.9 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.
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
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/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/RemoteAccessTerminal.test.jsx:51— 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 01a1d4be-4851-7487-a508-ab7cc8edf1f4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 248 · Warnings: 7336 · Recommendations: 199 · Info: 80 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 13-11-2026 @ 11:50 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.