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

volcano-sh/volcano

Measured 16 November 2026, 18:58 UTC, at code version 205f889

First survey, so nothing to compare with yet
CAI score 61.7out of 100 At risk

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

A large codebase: 107,158 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.9 person-years · Weakest lens: Security and Compliance, 56.6

Findings by how serious they are

83 critical 1372 serious 357 minor

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

This survey was produced by

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

59of 59 dimensions measured by tools.
1774of 1812 findings point to an exact file and line, so you can open each one in the code. The other 38 concern the repository as a whole, such as missing documentation.
59dimensions across 6 lenses, read from 107,158 lines of product code in 2 projects.
Chapters

Executive summary

volcano-sh/volcano is rated At risk because critical security findings are open. Its score is held back because it has unsafe settings in infrastructure or container files and places where personal data leaves where it belongs. It scores 61.7 out of 100, which the At risk rating leaves unchanged.

Security and Compliance, at 56.6, is the weakest lens and counts most in the score. The best first step is fixing the 33 places where personal data leaves where it belongs, worth about 2.5 points. Checking whether the largest projects should be split comes next, worth about 1.7 points. Raising Security and Compliance to 70 would lift the score to about 65.0.

Thirty-five settings leave the servers or containers unsafe. Three pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline. Correcting the unsafe settings and passing outside input through environment variables would close both risks. Keeping the personal data out of the places it leaks to is also needed. The two passwords or keys in the code's history and the password or key in the code need replacing, with the old ones switched off. The set of files in separate parts that keep changing together needs that dependency made explicit.

The product code is 107,158 lines, about €270,000 to rebuild.

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

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

If Security and Compliance rose from 56.6 to 70, the lowest score rated Strong, the score would rise from 61.7 to about 65.0.

Code composition: what the lines of code are
Product code 44%Tests 56%
Rebuild cost: about €270,000 · Estimate
Cost to rebuild€90,000 to €450,000, for 1,502 to 4,766 hours of work, about 1.9 person-years for 1 to 4 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 62. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 107,158 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 33 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED (16), REDACTED (14), REDACTED.
Raises the score by about 2.5 points · Medium effort · Data Compliance (PII/GDPR)
2
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED.
Raises the score by about 1.7 points · Low effort · Project Cohesion
3
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
Raises the score by about 3.0 points · Medium effort · Cancellation propagation

Diagnosis: what the measurements show together

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

Files that change often carry extra risk · Combined risk
2 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (11 files) · Code Coverage (104 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: cache.go and server.go
What to do: Add tests to these files and have a second person review every change to them, starting with cache.go and server.go.
Where the investment is most exposed · Value at risk
This code would cost about €270,000 to build again, about 1.9 person-years of work. Its weakest lens is Security and Compliance, at 56.6 (Adequate). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 33 REDACTED finding(s) in Data Compliance (PII/GDPR). Of all the actions in this report, it raises the score most for the work it takes: about 2.5 points for medium effort, because it clears the 33 Data Compliance (PII/GDPR) findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 58,820 lines over the last 90 days, which is about 238,548 lines a year. At that pace, the extra work comes to an estimated 32 to 192 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch volcano.sh/apis apis volcano.sh/volcano volcano volcano.sh/volcano->volcano.sh/apis

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.

240 modules, with 366 dependencies between them. One loop runs through 4 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 sh/volcano/pkg/agent/apis2 sh/volcano/pkg/agent/config/api3 sh/volcano/pkg/agent/utils/cgroup4 sh/volcano/pkg/config5 sh/volcano/pkg/controllers/apis6 sh/volcano/pkg/controllers/framework7 sh/volcano/pkg/controllers/hypernode/api8 sh/volcano/pkg/controllers/job/plugins/interface9 sh/volcano/pkg/scheduler/api/devices10 sh/volcano/pkg/scheduler/conf11 sh/volcano/pkg/webhooks/router12 sh/volcano/pkg/agent/config13 sh/volcano/pkg/agent/events/framework14 sh/volcano/pkg/agent/utils/pod15 sh/volcano/pkg/metriccollect16 sh/volcano/pkg/scheduler/api17 sh/volcano/pkg/agent/events18 sh/volcano/pkg/agent/events/handlers/cpuburst19 sh/volcano/pkg/agent/events/handlers/cpuqos20 sh/volcano/pkg/agent/events/handlers/cputhrottle21 sh/volcano/pkg/agent/events/handlers/memoryqos22 sh/volcano/pkg/agent/events/handlers/networkqos23 sh/volcano/pkg/agent/utils/node24 sh/volcano/pkg/scheduler/util25 sh/volcano/pkg/agent/events/handlers/oversubscription26 sh/volcano/pkg/agent/oversubscription/policy27 sh/volcano/pkg/scheduler/framework28 sh/volcano/pkg/agent/events/handlers/eviction29 sh/volcano/pkg/agent/events/probes/nodemonitor30 sh/volcano/pkg/agent/events/probes/noderesources31 sh/volcano/pkg/agent/oversubscription/policy/extend32 sh/volcano/pkg/scheduler/actions/utils33 sh/volcano/pkg/scheduler/unschedulable34 sh/volcano/pkg/scheduler/cache35 sh/volcano/pkg/agentscheduler/api36 sh/volcano/pkg/scheduler37 sh/volcano/pkg/agentscheduler/cache38 sh/volcano/pkg/agentscheduler/framework39 sh/volcano/pkg/agentscheduler40 sh/volcano/pkg/agentscheduler/plugins/predicates
1 sh/volcano/pkg/agent/apis
2 sh/volcano/pkg/agent/config/api
3 sh/volcano/pkg/agent/utils/cgroup
4 sh/volcano/pkg/config
5 sh/volcano/pkg/controllers/apis
6 sh/volcano/pkg/controllers/framework
7 sh/volcano/pkg/controllers/hypernode/api
8 sh/volcano/pkg/controllers/job/plugins/interface
9 sh/volcano/pkg/scheduler/api/devices
10 sh/volcano/pkg/scheduler/conf
11 sh/volcano/pkg/webhooks/router
12 sh/volcano/pkg/agent/config11
13 sh/volcano/pkg/agent/events/framework3
14 sh/volcano/pkg/agent/utils/pod1
15 sh/volcano/pkg/metriccollect22
16 sh/volcano/pkg/scheduler/api1
17 sh/volcano/pkg/agent/events12112
18 sh/volcano/pkg/agent/events/handlers/cpuburst2121
19 sh/volcano/pkg/agent/events/handlers/cpuqos2121
20 sh/volcano/pkg/agent/events/handlers/cputhrottle12121
21 sh/volcano/pkg/agent/events/handlers/memoryqos2121
22 sh/volcano/pkg/agent/events/handlers/networkqos12121
23 sh/volcano/pkg/agent/utils/node111
24 sh/volcano/pkg/scheduler/util211
25 sh/volcano/pkg/agent/events/handlers/oversubscription11112211
26 sh/volcano/pkg/agent/oversubscription/policy211
27 sh/volcano/pkg/scheduler/framework4751124
28 sh/volcano/pkg/agent/events/handlers/eviction11221111
29 sh/volcano/pkg/agent/events/probes/nodemonitor21141111
30 sh/volcano/pkg/agent/events/probes/noderesources1114111
31 sh/volcano/pkg/agent/oversubscription/policy/extend121123
32 sh/volcano/pkg/scheduler/actions/utils1422
33 sh/volcano/pkg/scheduler/unschedulable131
34 sh/volcano/pkg/scheduler/cache422
35 sh/volcano/pkg/agentscheduler/api21
36 sh/volcano/pkg/scheduler2212
37 sh/volcano/pkg/agentscheduler/cache259
38 sh/volcano/pkg/agentscheduler/framework5822
39 sh/volcano/pkg/agentscheduler2123
40 sh/volcano/pkg/agentscheduler/plugins/predicates221213
Uses a module listed above itPart of a loopThe module itself
1 sh/volcano/pkg/agent/apis2 sh/volcano/pkg/agent/config/api3 sh/volcano/pkg/agent/utils/cgroup4 sh/volcano/pkg/config5 sh/volcano/pkg/controllers/apis6 sh/volcano/pkg/controllers/framework7 sh/volcano/pkg/controllers/hypernode/api8 sh/volcano/pkg/controllers/job/plugins/interface9 sh/volcano/pkg/scheduler/api/devices10 sh/volcano/pkg/scheduler/conf11 sh/volcano/pkg/webhooks/router12 sh/volcano/pkg/agent/config13 sh/volcano/pkg/agent/events/framework14 sh/volcano/pkg/agent/utils/pod15 sh/volcano/pkg/metriccollect16 sh/volcano/pkg/scheduler/api17 sh/volcano/pkg/agent/events18 sh/volcano/pkg/agent/events/handlers/cpuburst19 sh/volcano/pkg/agent/events/handlers/cpuqos20 sh/volcano/pkg/agent/events/handlers/cputhrottle21 sh/volcano/pkg/agent/events/handlers/memoryqos22 sh/volcano/pkg/agent/events/handlers/networkqos23 sh/volcano/pkg/agent/utils/node24 sh/volcano/pkg/scheduler/util25 sh/volcano/pkg/agent/events/handlers/oversubscription26 sh/volcano/pkg/agent/oversubscription/policy27 sh/volcano/pkg/scheduler/framework28 sh/volcano/pkg/agent/events/handlers/eviction29 sh/volcano/pkg/agent/events/probes/nodemonitor30 sh/volcano/pkg/agent/events/probes/noderesources31 sh/volcano/pkg/agent/oversubscription/policy/extend32 sh/volcano/pkg/scheduler/actions/utils33 sh/volcano/pkg/scheduler/unschedulable34 sh/volcano/pkg/scheduler/cache35 sh/volcano/pkg/agentscheduler/api36 sh/volcano/pkg/scheduler37 sh/volcano/pkg/agentscheduler/cache38 sh/volcano/pkg/agentscheduler/framework39 sh/volcano/pkg/agentscheduler40 sh/volcano/pkg/agentscheduler/plugins/predicatessh/volcano/pkg/agent/apis1sh/volcano/pkg/agent/config/api2sh/volcano/pkg/agent/utils/cgroup3sh/volcano/pkg/config4sh/volcano/pkg/controllers/apis5sh/volcano/pkg/controllers/framework6sh/volcano/pkg/controllers/hypernode/api7sh/volcano/pkg/controllers/job/plugins/interface8sh/volcano/pkg/scheduler/api/devices9sh/volcano/pkg/scheduler/conf10sh/volcano/pkg/webhooks/router11sh/volcano/pkg/agent/config12sh/volcano/pkg/agent/events/framework13sh/volcano/pkg/agent/utils/pod14sh/volcano/pkg/metriccollect15sh/volcano/pkg/scheduler/api16sh/volcano/pkg/agent/events17sh/volcano/pkg/agent/events/handlers/cpuburst18sh/volcano/pkg/agent/events/handlers/cpuqos19sh/volcano/pkg/agent/events/handlers/cputhrottle20sh/volcano/pkg/agent/events/handlers/memoryqos21sh/volcano/pkg/agent/events/handlers/networkqos22sh/volcano/pkg/agent/utils/node23sh/volcano/pkg/scheduler/util24sh/volcano/pkg/agent/events/handlers/oversubscription25sh/volcano/pkg/agent/oversubscription/policy26sh/volcano/pkg/scheduler/framework27sh/volcano/pkg/agent/events/handlers/eviction28sh/volcano/pkg/agent/events/probes/nodemonitor29sh/volcano/pkg/agent/events/probes/noderesources30sh/volcano/pkg/agent/oversubscription/policy/extend31sh/volcano/pkg/scheduler/actions/utils32sh/volcano/pkg/scheduler/unschedulable33sh/volcano/pkg/scheduler/cache34sh/volcano/pkg/agentscheduler/api35sh/volcano/pkg/scheduler36sh/volcano/pkg/agentscheduler/cache37sh/volcano/pkg/agentscheduler/framework38sh/volcano/pkg/agentscheduler39sh/volcano/pkg/agentscheduler/plugins/predicates40113122112112212121211212121211212111121111112211211475112411221111211411111114111121123142213142221221225958222123221213+200 more modules (most-connected shown)

At a glance — Code Health · 58.6 · Adequate · gated by D2 ·

At a glance — Architecture · 65.9 · Adequate · gated by D26, AX2 ·

At a glance — Maturity · 80.2 · Strong ·

At a glance — Readiness · 74.7 · Adequate · gated by D11 ·

At a glance — Security · 56.6 · Adequate · gated by D29, D31, D32 ·

At a glance — Performance · 95.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A02:2025 — Security Misconfiguration338High / Critical
A05:2025 — Injection60High / Critical
A01:2025 — Broken Access Control33High / Critical
A03:2025 — Software Supply Chain Failures20High / Critical
A07:2025 — Authentication Failures4High / Critical

Roadmap

Top priorities: Thread a context.Context through functions that make requests, so the work stops when its caller gives up; Resolve the 33 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED (16), REDACTED (14), REDACTED; Resolve the 226 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (70), REDACTED (62), REDACTED (32).

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

Do thisHelpsEffortDimension
Resolve the 33 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED (16), REDACTED (14), REDACTED.+2.5 ptsMediumData Compliance (PII/GDPR)
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED.+1.7 ptsLowProject Cohesion
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.+3.0 ptsMediumCancellation propagation
Resolve the 1 No network policy finding(s) in Network Egress Confinement.+1.3 ptsLowNetwork Egress Confinement
Resolve the 4 Flaky test finding(s) in Test Reliability.+1.2 ptsLowTest Reliability
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+1.2 ptsLowREDACTED Scanning
Go: guard the state handlers share with a sync.Mutex held for the whole update (`mu.Lock(); defer mu.Unlock()`), make counters sync/atomic types (atomic.Int64) and caches a sync.Map, or keep per-request data in locals and the request context. `go test -race` over a handler test confirms the race and then its fix.+1.8 ptsMediumStateful singletons
Swallowed exception (caught, then discarded)+1.7 ptsMediumException handling

File quality

Per-file score 0–10 — a quality signature. Of 360 files carrying findings, judged against the Production bar: 6% slop · 55% mixed · 39% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopData Compliance (PII/GDPR): High: REDACTED
REDACTED0.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.0SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED0.0SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED0.0SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED0.8SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED1.1SlopData Compliance (PII/GDPR): High: REDACTED
REDACTED1.3SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.4SlopData Compliance (PII/GDPR): High: REDACTED
REDACTED1.6SlopData Compliance (PII/GDPR): High: REDACTED
REDACTED1.6SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.6SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.2SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.2SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.4SlopIaC & Container Security: High IaC: REDACTED

How the grades work

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

Critical — 83

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

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

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

Could not be resolved — 21

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

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 59 dimensions across the health lenses
D1D2D3D4D5D6D7D8D11D12D13D14D15D16D17D19D20D21D22D26D27D28D29D30D31D32D34D35D36D37D40D41D42D43D44AX10AX2AX3AX4AX6M1M2M3M4P1P10P2P3P4P5P6P7PF1X2X26X27X28X3X30

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1e5ba-08a8-736a-b771-6ca2e1f29056.

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

Run transparency — what happened this run

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

  • 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.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D32 Data Compliance (PII/GDPR) — 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. `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/cronjob.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake/fake_cronjob.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake/fake_job.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/job.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1/command.go`, … (+40 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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. Installer/helm/chart/volcano/templates/admission-init.yaml:66, REDACTED:97, installer/helm/chart/volcano/templates/agent.yaml:9, installer/helm/chart/volcano/templates/agent_scheduler.yaml:141, REDACTED:135, REDACTED:72, installer/helm/chart/volcano/templates/hypernode_controller.yaml:107, installer/helm/chart/volcano/templates/kubestatemetrics.yaml:146, REDACTED:202, REDACTED:174 and 1 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.
  • 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 ToolchainServer (.). `go` is not on PATH — this repository boots from its toolchain's own run entry point (package main in third_party/kube-apiserver-audit-exporter/cmd/kube-apiserver-audit-exporter starts an HTTP listener), so the tier cannot start it without that toolchain No runtime accessibility evidence was produced for this scan. This is a statement about THIS RUN's environment, not about the application: nothing here says the app is inaccessible, only that it was never rendered.
  • 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.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, 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.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust and Java source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust or Java was found in this repository, 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, 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.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, 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.
  • X18 Disposal-pattern 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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP or Rust was found in this repository, 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.
  • X22 Contradicted release 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 reads C# and Visual Basic syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin, PHP, F# and Visual Basic source only, and no C# was loaded, and this repository's Go 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.
  • X23 Unguarded diagnostic materialisation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin, PHP or Rust was found in this repository, 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart, Ruby and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart, Ruby or Rust was found in this repository, 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.
  • 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 reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 44 further occurrence(s) are not listed individually; the score already reflects all 84.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 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.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
  • 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.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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.

Dimensions

D1 · Cyclomatic Complexity5.6 / 10Adequate✓ Tool-verified

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

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

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

88 function(s) exceeded the cyclomatic complexity threshold of 15; the worst was capacityPlugin.OnSessionOpen at 139.

Action.selectDomainBundles (cyclomatic 20) · ×2pkg/scheduler/actions/gangpreempt/gangpreempt.go:189
Action.Execute (cyclomatic 16) · ×2REDACTED:60
capacityPlugin.OnSessionOpen (cyclomatic 139)pkg/scheduler/plugins/capacity/capacity.go:442
proportionPlugin.OnSessionOpen (cyclomatic 66)pkg/scheduler/plugins/proportion/proportion.go:91
deviceSharePlugin.wrapGPUDevicesForExclusivity (cyclomatic 54)pkg/scheduler/plugins/deviceshare/gpuexclusive.go:431

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

What to do

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

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

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

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

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

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

239 function(s) exceeded the cognitive complexity threshold of 15; the worst was capacityPlugin.OnSessionOpen at 195.

Action.selectDomainBundles (cognitive 29) · ×2pkg/scheduler/actions/gangpreempt/gangpreempt.go:189
SchedulerCache.Bind (cognitive 17) · ×2pkg/agentscheduler/cache/cache.go:621
capacityPlugin.OnSessionOpen (cognitive 195)pkg/scheduler/plugins/capacity/capacity.go:442
deviceSharePlugin.wrapGPUDevicesForExclusivity (cognitive 176)pkg/scheduler/plugins/deviceshare/gpuexclusive.go:431
Action.Execute (cognitive 113)REDACTED:101

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

What to do

  1. Bring the 16 bodies over 60 down to 60 or less in Cognitive Complexity — start with capacityPlugin.OnSessionOpen (cognitive 195), deviceSharePlugin.wrapGPUDevicesForExclusivity (cognitive 176), Action.Execute (cognitive 113). — 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 16 together lifts Cognitive Complexity from 2.0 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

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

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

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

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

MethodTooLong: capacityPlugin.OnSessionOpen · ×17pkg/scheduler/plugins/capacity/capacity.go:442
FileTooLong: cache/cache.go · ×17pkg/scheduler/cache/cache.go
TooManyMethods: SchedulerCache · ×10pkg/scheduler/cache/cache.go:117
ClassTooLong: SchedulerCache · ×9pkg/scheduler/cache/cache.go:117
TooManyFields: Session · ×7REDACTED:69

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

What to do

  1. Resolve the 17 MethodTooLong finding(s) in God Classes — start with capacity.go (2), job_controller_actions.go (2), cache.go (2). — One of this dimension's main actionable groups (17 warning-level).
  2. Resolve the 17 FileTooLong finding(s) in God Classes — start with cache.go (2), capacity.go, event_handlers.go. — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 10 TooManyMethods finding(s) in God Classes — start with cache.go (2), REDACTED, job_info.go. — One of this dimension's main actionable groups (10 warning-level).

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

D4 · Code Duplication5.9 / 10Adequate✓ Tool-verified

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

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

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

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

Duplicated block (9 lines × 2) · ×20pkg/agentscheduler/cache/cache.go:626
Duplicated block (10 lines × 2) · ×18pkg/agent/utils/cgroup/cgroup.go:463
Duplicated block (8 lines × 2) · ×17pkg/agent/events/handlers/cpuburst/cpu_burst_linux.go:117
Duplicated block (11 lines × 2) · ×16cmd/agent-scheduler/app/options/options.go:100
Duplicated block (13 lines × 2) · ×15pkg/agentscheduler/framework/plugins.go:209

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

What to do

  1. Resolve the 20 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with job_info.go (3), cache.go (2), REDACTED (2). — One of this dimension's main actionable groups (20 warning-level).
  2. Resolve the 18 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with event_handlers.go (2), annotation.go (2), cgroup.go. — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 17 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with event_handlers.go (4), cpu_burst_linux.go, job_info.go. — One of this dimension's main actionable groups (17 warning-level).

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

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

2 production modules (Go), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

1 of 178 classes have LCOM4 above 3.

Low cohesion: Snapshot (LCOM4 5)pkg/scheduler/plugins/util/k8s/snapshot.go:46

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with snapshot.go. — One of this dimension's main actionable groups (1 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

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.

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

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.

D8 · Code Coverage9.4 / 10Stronggated by 142 serious findings✓ Tool-verified

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

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

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

Line coverage 63.6% — 142 file(s) below 50%. Measured from the Go suite (volcano.sh/volcano: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it. 46 line(s) in 10 file(s) were executed in some runs and not in others, so they are not counted.

Low coverage: benchmark/testcases/util/constant.go · ×142benchmark/testcases/util/constant.go:1
Tests reach code only in some runs: pkg/controllers/hypernode/discovery/manager.go · ×10pkg/controllers/hypernode/discovery/manager.go:425

What to do

  1. Resolve the 142 Low coverage finding(s) in Code Coverage — start with main.go (14), REDACTED (8), server.go (6). — One of this dimension's main actionable groups (142 warning-level).
  2. Resolve the 10 Tests reach code only in some runs finding(s) in Code Coverage — start with manager.go, REDACTED, REDACTED. — One of this dimension's main actionable groups (10 recommendation-level).

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

D11 · Test Reliability2.0 / 10Critical✓ Tool-verified

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

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

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

4 flaky across 1 measured tier(s). Go (volcano.sh/volcano): measured (4 flaky).

Flaky test: .::volcano.sh/volcano/pkg/scheduler/actions/allocate.TestAllocateWithDRA · ×4

What to do

  1. Resolve the 4 Flaky test finding(s) in Test Reliability. — One of this dimension's main actionable groups (4 issue-level).

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

D12 · Dependency Hygiene8.7 7.9 / 10Strong✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 7.9 / 10 · rule-coverage 91% · ceiling Verified

21 outdated, 0 author-deprecated direct Go module(s), 1 pinning or checksum defect(s). 43 of 43 direct requirement(s) were graded against proxy.golang.org (0 not served there, 4 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Dependency pinned to a stale untagged commit: github.com/google/shlex
Outdated: github.com/agiledragon/gomonkey/v2 · ×21

What to do

  1. Resolve the 1 Dependency pinned to a stale untagged commit 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.

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

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

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

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 of 203 required Go module(s) use a banned license. Licences were read per module version from the licence files pkg.go.dev detects (via api.deps.dev), over every module this repository's REDACTED requires, direct and indirect, at the version the build uses. Go records no test-only scope at module level, so modules only this repository's own tests import are included.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.3 / 10Stronggated by 12 serious findings✓ Tool-verified

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

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

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

Top hotspots: pkg/scheduler/plugins/capacity/capacity.go (10×139=1390); REDACTED (8×41=328); pkg/scheduler/plugins/predicates/predicates.go (7×39=273)

Hotspot: pkg/scheduler/plugins/capacity/capacity.go · ×12pkg/scheduler/plugins/capacity/capacity.go:442

What to do

  1. Resolve the 12 Hotspot finding(s) in Churn × Complexity Hotspots — start with cache.go (2), capacity.go, REDACTED. — One of this dimension's main actionable groups (12 warning-level).

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

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

22 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pkg/controllers/hypernode/discovery/manager.go. Counted over 340 of the 764 production source files in this repository: 423 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.9 / 10Stronggated by 80 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×80test/e2e/util/job.go:403

What to do

  1. Resolve the 80 TodoComment finding(s) in Explicit Debt — start with event_handlers.go (8), cache.go (5), REDACTED (4). — One of this dimension's main actionable groups (80 warning-level).

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

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

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality9.2 / 10Exemplary✓ Tool-verified

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

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

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

2 of 15 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.

ADR has no Decision sectiondocs/design/evictablefn-evolution-for-gang-eviction.md:1detected by adr-integrity
ADR considers only one optiondocs/design/resource-strategy-fit-scheduling.md:257detected by adr-integrity

✓ On the Gold path — maintain.

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

D21 · Naming Consistency7.0 / 10Adequate✓ Tool-verified

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

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

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

4 naming inconsistencies among 133 declarations measured against a convention their peers follow.

`CgroupCpuSubsystem` spells `Cpu` where 93 names in the project spell it `CPU`pkg/agent/utils/cgroup/cgroup.go:47
`JobUid` spells `Uid` where 24 names in the project spell it `UID`pkg/controllers/apis/request.go:32
`getCpuNumPerChip` spells `Cpu` where 93 names in the project spell it `CPU`pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:599
`GetChipKindFromNpuNode` spells `Npu` where 17 names in the project spell it `NPU`pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:732

What to do

  1. Resolve the 1 `CgroupCpuSubsystem` spells `Cpu` where 93 names in the project spell it… finding(s) in Naming Consistency — start with cgroup.go. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `JobUid` spells `Uid` where 24 names in the project spell it `UID` finding(s) in Naming Consistency — start with request.go. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `getCpuNumPerChip` spells `Cpu` where 93 names in the project spell it… finding(s) in Naming Consistency — start with init_policy.go. — One of this dimension's main actionable groups (1 recommendation-level).

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

D22 · Internal API Consistency8.8 / 10Strong✓ Tool-verified

What it measures: Whether the internal API surface is consistent and coherent.

Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.

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

6 API inconsistencies among 517 exposed members measured against a convention their peers follow.

`jobflow.PrintJobFlowDetail` takes no context.Context; its 5 sibling operations take onepkg/cli/jobflow/describe.go:105
`jobtemplate.PrintJobTemplateDetail` takes no context.Context; its 5 sibling operations take onepkg/cli/jobtemplate/describe.go:105
`framework.OpenSession` takes functional options (`opts ...Option`) where its 3 sibling constructors take a config structpkg/scheduler/framework/framework.go:59
`Framework.ListPlugins` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`)pkg/scheduler/plugins/util/k8s/framework.go:116
`util.CalculateNumOfFeasibleNodesToFind` signals absence with a bare `T` (the zero value when absent) where its 4 sibling single-key reads use a nil `*T`REDACTED:56

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

What to do

  1. Resolve the 1 `jobflow.PrintJobFlowDetail` takes no context.Context; its 5 sibling… finding(s) in Internal API Consistency — start with describe.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 `jobtemplate.PrintJobTemplateDetail` takes no context.Context; its 5… finding(s) in Internal API Consistency — start with describe.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 `framework.OpenSession` takes functional options (`opts ...Option`)… finding(s) in Internal API Consistency — start with framework.go. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

1 of 2 build units (Go) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionREDACTED:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability7.1 / 10Strong✓ Tool-verified

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

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

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

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

68 % of calls cross a namespace and 15 % go through an interface, but 38 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

Scattered collaborators

What to do

  1. Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).

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

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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.

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

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

70 finding(s): 0 critical, 6 high, 42 medium, 22 low. semgrep hit a parse error in 78 file(s) — `benchmark/scripts/install-volcano.sh` (line 25), `benchmark/testcases/gang/cases/vcjob-template.yaml`, `benchmark/testcases/pod/cases/pod-template.yaml`, `hack/update-vendor-licenses.sh` (line 266), `installer/helm/chart/volcano/charts/jobflow/templates/flow_v1alpha1_jobflows.yaml`, … (+73 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 16 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

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

What to do

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

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

D30 · Dependency Vulnerabilities6.6 / 10Adequate✓ Tool-verified

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

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

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

17 finding(s): 0 critical, 1 high, 16 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security0.0 / 10Critical✓ Tool-verified

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

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

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

338 finding(s): 5 critical, 30 high, 226 medium, 77 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 226 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (70), REDACTED (62), REDACTED (32). — One of this dimension's main actionable groups (226 warning-level).
  2. Resolve the 30 High IaC finding(s) in IaC & Container Security — start with REDACTED (9), REDACTED (5), REDACTED (4). — One of this dimension's main actionable groups (30 issue-level).
  3. Resolve the 5 Critical IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).

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

D32 · Data Compliance (PII/GDPR)0.0 / 10Critical✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using our own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.

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

33 finding(s): 0 critical, 33 high, 0 medium, 0 low. semgrep could not parse 45 file(s) — `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/cronjob.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake/fake_cronjob.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake/fake_job.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/job.go`, `staging/src/volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1/command.go`, … (+40 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.

REDACTED

What to do

  1. Resolve the 33 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED (16), REDACTED (14), REDACTED. — One of this dimension's main actionable groups (33 issue-level).

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

D34 · Knowledge Freshness4.8 / 10Weak✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

174 of 341 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go. Counted over 341 of the 764 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×171pkg/scheduler/plugins/drf/drf.go:1
Most significant orphaned file · ×3pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:1
Concentrated knowledge decay

What to do

  1. Resolve the 171 Orphaned file finding(s) in Knowledge Freshness — start with types.go (6), REDACTED (6), get.go (5). — One of this dimension's main actionable groups (171 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with init_policy.go, sharding_controller.go, device_manage.go. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.9 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

Strongest change-coupling: session_plugins.go↔defaults.go 72%; REDACTED↔defaults.go 61%; main.go↔schema.go 55%

Boundary-crossing change coupling: main.go ↔ schema.gocmd/webhook-manager/main.go:1
Change coupling: session_plugins.go ↔ defaults.go · ×4pkg/scheduler/framework/session_plugins.go:1

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with main.go. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 4 Change coupling finding(s) in Change Coupling — start with session_plugins.go, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D40 · Network Egress Confinement6.0 / 10Adequate✓ Tool-verified

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.

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

0/2 network-egress controls present (network policy, egress restriction).

No network policy

What to do

  1. Resolve the 1 No network policy finding(s) in Network Egress Confinement. — One of this dimension's main actionable groups (1 recommendation-level).

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

D41 · Kernel & Syscall Confinement9.3 / 10Exemplary✓ Tool-verified

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.

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

14/17 workload(s) run every container under a seccomp profile; 14/17 declare an AppArmor/SELinux profile.

No seccomp profile · ×3REDACTED:213

✓ On the Gold path — maintain.

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

D42 · Runtime Threat Enforcement8.0 / 10Strong✓ Tool-verified

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.

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

1/2 runtime-enforcement controls present (threat detection, admission control).

No runtime threat detection

What to do

  1. Resolve the 1 No runtime threat detection finding(s) in Runtime Threat Enforcement. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 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.

Frontend & cross-cutting dimensions

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

AX10 · Code composition7.0 / 10Strong✓ Tool-verified

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

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

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

AX2 · Stateful singletons3.5 / 10Weak✓ Tool-verified

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.

  • Package `main` serves requests (net/http handlers run on a goroutine per request, and every one sees the same package variables and captured values) but writes that shared state outside any lock (snapshot; e.g. `snapshot` in `onSessionOpen` at line 46). Unsynchronised concurrent writes are a data race in Go: an update is lost or a value tears, and a concurrent map write aborts the process. — REDACTED:46

What to do

  • Go: guard the state handlers share with a sync.Mutex held for the whole update (`mu.Lock(); defer mu.Unlock()`), make counters sync/atomic types (atomic.Int64) and caches a sync.Map, or keep per-request data in locals and the request context. `go test -race` over a handler test confirms the race and then its fix.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation9.9 / 10Exemplary✓ Tool-verified

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

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

  • `Cache` declares 24 methods: `Run`, `Snapshot`, `WaitForCacheSync`, `AddBindTask`, `RecordCandidateNodesInBinder`, `RemoveCandidateNodesFromBinder`, `Client`, `VCClient`, `ClientConfig`, `UpdateSchedulerNumaInfo`, `SharedInformerFactory`, `VCSharedInformerFactory`, `SetMetricsConf`, `EventRecorder`, `RegisterBinder`, `SharedDRAManager`, `UpdateSnapshot`, `TaskUnschedulable`, `EnqueueScheduleResult`, `SchedulingQueue`, `GetTaskInfo`, `UpdateNodeShardStatus`, `OnWorkerStartSchedulingCycle`, `OnWorkerEndSchedulingCycle`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — pkg/agentscheduler/cache/interface.go:45
  • `Cache` declares 23 methods: `Run`, `Snapshot`, `WaitForCacheSync`, `AddBindTask`, `BindPodGroup`, `Evict`, `RecordJobStatusEvent`, `UpdateJobStatus`, `UpdateQueueStatus`, `Client`, `VCClient`, `ClientConfig`, `AddUnassignedNumaPods`, `SharedInformerFactory`, `SetMetricsConf`, `GetMetricsConf`, `EventRecorder`, `RegisterBinder`, `SharedDRAManager`, `IsJobTerminated`, `UpdateNodeShardStatus`, `OnSessionOpen`, `OnSessionClose`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — pkg/scheduler/cache/interface.go:41

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
M1 · Documentation (README)9.3 / 10Exemplary✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation7.0 / 10Strong✓ Tool-verified

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

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

  • 15 ADR-shaped document(s) detected by content — `docs/design/agent-cgroup-v2-adaptation.md`, `docs/design/capacity-dra-support.md`, `docs/design/distributed-framework-plugins.md`, `docs/design/evictablefn-evolution-for-gang-eviction.md`, `docs/design/extender.md`, `docs/design/gang-aware-eviction-design.md`, `docs/design/group-topology-affinity.md`, `docs/design/hyperNode-auto-discovery.md`, `docs/design/hypernode-controller-standalone.md`, `docs/design/namespace-queue.md`, `docs/design/numa-aware.md`, `docs/design/queue-scoped-overcommit.md`, `docs/design/resource-strategy-fit-scheduling.md`, `docs/design/scheduling-gates-queue-admission.md`, `docs/design/unschedulable-job-cache.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy8.0 / 10Strong✓ Tool-verified

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.

  • benchmark/README.md names Go 1.24 or later, but REDACTED:3 requires `go 1.26.0` (the lowest of 2 declarations): the code does not build on Go 1.24. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, 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. — benchmark/README.md:13

What to do

  • Reconcile the README with reality: benchmark/README.md names Go 1.24 or later, but REDACTED:3 requires `go 1.26.0` (the lowest of 2 declarations): the code does not build on Go 1.24.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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.

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

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

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

P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

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

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

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

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

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

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

What to do

  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P5 · DR & Backup7.0 / 10Strong✓ 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.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

P7 · Outbound HTTP resilience10.0 / 10Exemplary○ Nothing flagged

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.

PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

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.

X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 0/2 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `send` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/scheduler/plugins/extender/extender.go:354
  • `fetchUFMData` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:228

What to do

  • Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

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

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

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

Other · Code Health — Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.

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

X28 · Index access outside its own emptiness guard6.6 / 10Adequate✓ Tool-verified

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.

  • `index` is the result of a search that answers -1 when nothing is found, and `mySchedulerPodName[0:index]` uses it as a bound with no test of `index` in between. When the search misses, the bound is -1 and the access panics with `slice bounds out of range`. Test `index < 0` (or use `strings.Cut`) before using it. — pkg/scheduler/cache/util.go:148
  • `%len(potentialNodes)` divides by the length of `potentialNodes`, and nothing before it checks that `potentialNodes` is non-empty. An empty `potentialNodes` makes this an integer division by zero, which panics. Test `len(potentialNodes) == 0` first and return early. — REDACTED:658

What to do

  • Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
X3 · Exception handling6.6 / 10Adequate✓ Tool-verified

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

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

  • `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×8) — staging/src/volcano.sh/apis/pkg/apis/utils/utils.go:27, pkg/webhooks/router/indexer.go:207, pkg/webhooks/router/queue_reference.go:51, …
  • `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. (×10) — pkg/webhooks/admission/queues/validate/validate_queue.go:48, pkg/webhooks/admission/queues/mutate/mutate_queue.go:36, pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:35, …
  • `patchBytes, _ = createPatch(job)` writes the call's error to `_` and then uses `patchBytes` as if the call succeeded. When `createPatch` fails, `patchBytes` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `patchBytes` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/webhooks/admission/jobs/mutate/mutate_job.go:96
  • `if _, err := cron.ParseStandard(spec.Schedule); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:179
  • `if _, err := time.LoadLocation(*spec.TimeZone); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:198
  • `if err = serveOnListener(listener, mux); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/util/socket.go:228
  • `reserved, _ = takeByTopology(cputopo, cputopo.CPUDetails.CPUs(), numReservedCPUs)` writes the call's error to `_` and then uses `reserved` as if the call succeeded. When `takeByTopology` fails, `reserved` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `reserved` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — REDACTED:145, REDACTED:178
  • `fweight, _ := strconv.ParseFloat(weights[i], 64)` writes the call's error to `_` and then uses `fweight` as if the call succeeded. When `strconv.ParseFloat` fails, `fweight` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `fweight` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/scheduler/plugins/drf/drf.go:468
  • `cpuUsage, _ := strconv.ParseFloat(value[0], 64)` writes the call's error to `_` and then uses `cpuUsage` as if the call succeeded. When `strconv.ParseFloat` fails, `cpuUsage` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `cpuUsage` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:107
  • `memUsage, _ := strconv.ParseFloat(value[0], 64)` writes the call's error to `_` and then uses `memUsage` as if the call succeeded. When `strconv.ParseFloat` fails, `memUsage` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `memUsage` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:110
  • `ssn.cache.AddUnassignedNumaPods(allocatedSets)` returns an error, and the statement drops it: when `ssn.cache.AddUnassignedNumaPods` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ssn.cache.AddUnassignedNumaPods(allocatedSets); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:966
  • `cpuID, _ := strconv.Atoi(key)` writes the call's error to `_` and then uses `cpuID` as if the call succeeded. When `strconv.Atoi` fails, `cpuID` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `cpuID` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/scheduler/cache/event_handlers.go:1552
  • `sc.addNumaInfo(ss)` returns an error, and the statement drops it: when `sc.addNumaInfo` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := sc.addNumaInfo(ss); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. (×2) — pkg/scheduler/cache/event_handlers.go:1610, pkg/scheduler/cache/event_handlers.go:1623
  • `sc.UpdateNodeShardStatus(nodeShardName)` returns an error, and the statement drops it: when `sc.UpdateNodeShardStatus` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := sc.UpdateNodeShardStatus(nodeShardName); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. (×2) — pkg/scheduler/cache/shard_coordinator.go:85, pkg/scheduler/cache/shard_coordinator.go:91
  • `devmem, _ := strconv.ParseInt(tmpstr[2], 10, 32)` writes the call's error to `_` and then uses `devmem` as if the call succeeded. When `strconv.ParseInt` fails, `devmem` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `devmem` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/scheduler/api/devices/device_info.go:142
  • `devcores, _ := strconv.ParseInt(tmpstr[3], 10, 32)` writes the call's error to `_` and then uses `devcores` as if the call succeeded. When `strconv.ParseInt` fails, `devcores` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `devcores` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/scheduler/api/devices/device_info.go:144
  • `nodelock.UseClient(kubeClient)` returns an error, and the statement drops it: when `nodelock.UseClient` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := nodelock.UseClient(kubeClient); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. (×2) — pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:332, pkg/scheduler/api/devices/nvidia/gpushare/device_info.go:217
  • `count, _ := strconv.Atoi(items[1])` writes the call's error to `_` and then uses `count` as if the call succeeded. When `strconv.Atoi` fails, `count` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `count` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:70
  • `devmem, _ := strconv.Atoi(items[2])` writes the call's error to `_` and then uses `devmem` as if the call succeeded. When `strconv.Atoi` fails, `devmem` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `devmem` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:71
  • `health, _ := strconv.ParseBool(items[4])` writes the call's error to `_` and then uses `health` as if the call succeeded. When `strconv.ParseBool` fails, `health` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `health` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:72

What to do

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health58.6Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture65.9Adequate — gated by D26, AX2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity80.2StrongSolid.
Readiness74.7Adequate — gated by D11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security56.6Adequate — gated by D29, D31, D32Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance95.0ExemplaryStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 29 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 2 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 — 54 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's 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.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — `go` is not on PATH — this repository boots from its toolchain's own run entry point (package main in third_party/kube-apiserver-audit-exporter/cmd/kube-apiserver-audit-exporter starts an HTTP listener), so the tier cannot start it without that toolchain No runtime accessibility evidence was produced for this scan. This is a statement about THIS RUN's environment, not about the application: nothing here says the app is inaccessible, only that it was never rendered. 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.
  • D10 Test Quality — ~138063 lines of test source are present (.go) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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. Aggregate roots were found in only one source directory (pkg), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .go, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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.
  • DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 10 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 4 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 4 domain event(s); 13 event-sourced shape(s) (event folds / event-recording aggregates)
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 aggregate(s) with Apply/When folds; 12 Go aggregate(s) recording domain events (own events-slice append / raise-record)
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 489 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.
  • PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — 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
  • X13 Undrained process stream — 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
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — not 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
  • X17 Uncapped recursion over a caller-supplied document — 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
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Go's `++`, `--` and assignments are STATEMENTS, not expressions, so none of them can appear in a `case` expression or anywhere else in a condition, and a type switch's cases are types. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — 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
  • X23 Unguarded diagnostic materialisation — 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
  • X24 Document value interpolated into markup unescaped — 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
  • X25 Inert configuration knob — 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
  • X29 Per-element action decided by a fixed element — 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
  • 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 — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Go was read, and it logs through none: the standard library's `log` takes one finished line, or it makes no log call outside its tests at all, so an assembled message there loses nothing the API could have kept (as with log4net in C#). Calls through log/slog, zap, logrus, zerolog, hclog, go-kit's log or logr would be judged.
  • X5 Nullable reference types — Not applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Go's type system has no nullable and non-nullable types — every pointer, map, slice and interface is nil-able at every position, there is no switch that turns null checking on, and the compiler produces no nullability warning for an operator to silence. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 83 finding(s)
D32 · Data Compliance (PII/GDPR) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 8 more in this group — see findings.md.
D31 · IaC & Container Security · High IaC · ×30
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 5 more in this group — see findings.md.
D31 · IaC & Container Security · Critical IaC · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Flaky test · ×4
  • Flaky test: .::volcano.sh/volcano/pkg/scheduler/actions/allocate.TestAllocateWithDRA — Passed 2×, failed 1× across repeated runs.
  • Flaky test: .::volcano.sh/volcano/pkg/scheduler/actions/allocate.TestAllocateWithDRA/DRA-only_gang_waits_when_only_one_device_is_available — Passed 2×, failed 1× across repeated runs.
  • Flaky test: .::volcano.sh/volcano/pkg/scheduler/actions/preempt.TestPreempt — Passed 2×, failed 1× across repeated runs.
  • Flaky test: .::volcano.sh/volcano/pkg/scheduler/actions/preempt.TestPreempt/preemptor_with_CPU_and_DRA_can_evict_an_ordinary-request_pod_in_the_same_job — Passed 2×, failed 1× across repeated runs.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: main.go ↔ schema.go cmd/webhook-manager/main.go:1 — `cmd/webhook-manager/main.go` (context cmd) and `pkg/webhooks/schema/schema.go` (context pkg) 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 — 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 `c28099cd` feat: add NamespaceQueue admission webhook support; `b82a72ed` add jobflow flow dag validate; `7e044592` feat(webhook): add pg admission — run `git show` on any of them.
Serious — 1372 finding(s)
D31 · IaC & Container Security · Medium IaC · ×226
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 201 more in this group — see findings.md.
D8 · Code Coverage · Low coverage · ×142
  • Low coverage: benchmark/testcases/util/constant.go benchmark/testcases/util/constant.go:1 — 0.0% line coverage (0/2).
  • Low coverage: benchmark/testcases/util/util.go benchmark/testcases/util/util.go:1 — 0.0% line coverage (0/169).
  • Low coverage: cmd/agent-scheduler/app/server.go cmd/agent-scheduler/app/server.go:1 — 0.0% line coverage (0/66).
  • Low coverage: cmd/agent-scheduler/main.go cmd/agent-scheduler/main.go:1 — 0.0% line coverage (0/40).
  • Low coverage: cmd/agent/app/agent.go cmd/agent/app/agent.go:1 — 0.0% line coverage (0/48).
  • Low coverage: cmd/agent/app/app.go cmd/agent/app/app.go:1 — 0.0% line coverage (0/53).
  • Low coverage: cmd/agent/app/options/options.go cmd/agent/app/options/options.go:1 — 11.4% line coverage (4/35).
  • Low coverage: cmd/agent/main.go cmd/agent/main.go:1 — 0.0% line coverage (0/10).
  • Low coverage: cmd/cli/job.go cmd/cli/job.go:1 — 0.0% line coverage (0/34).
  • Low coverage: cmd/cli/jobflow.go cmd/cli/jobflow.go:1 — 0.0% line coverage (0/32).
  • Low coverage: cmd/cli/jobtemplate.go cmd/cli/jobtemplate.go:1 — 0.0% line coverage (0/32).
  • Low coverage: cmd/cli/pod.go cmd/cli/pod.go:1 — 0.0% line coverage (0/24).
  • Low coverage: cmd/cli/queue.go cmd/cli/queue.go:1 — 0.0% line coverage (0/34).
  • Low coverage: cmd/cli/util/util.go cmd/cli/util/util.go:1 — 0.0% line coverage (0/8).
  • Low coverage: cmd/cli/vcancel/main.go cmd/cli/vcancel/main.go:1 — 0.0% line coverage (0/12).
  • Low coverage: cmd/cli/vcctl.go cmd/cli/vcctl.go:1 — 0.0% line coverage (0/24).
  • Low coverage: cmd/cli/vjobs/main.go cmd/cli/vjobs/main.go:1 — 0.0% line coverage (0/12).
  • Low coverage: cmd/cli/vqueues/main.go cmd/cli/vqueues/main.go:1 — 0.0% line coverage (0/12).
  • Low coverage: cmd/cli/vresume/main.go cmd/cli/vresume/main.go:1 — 0.0% line coverage (0/12).
  • Low coverage: cmd/cli/vsub/main.go cmd/cli/vsub/main.go:1 — 0.0% line coverage (0/12).
  • Low coverage: cmd/cli/vsuspend/main.go cmd/cli/vsuspend/main.go:1 — 0.0% line coverage (0/12).
  • Low coverage: cmd/controller-manager/app/server.go cmd/controller-manager/app/server.go:1 — 12.2% line coverage (15/123).
  • Low coverage: cmd/controller-manager/main.go cmd/controller-manager/main.go:1 — 0.0% line coverage (0/53).
  • Low coverage: cmd/hypernode-controller-manager/app/server.go cmd/hypernode-controller-manager/app/server.go:1 — 16.9% line coverage (26/154).
  • Low coverage: cmd/hypernode-controller-manager/main.go cmd/hypernode-controller-manager/main.go:1 — 0.0% line coverage (0/28).
  • + 117 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×80
  • TodoComment test/e2e/util/job.go:403 — // TODO(k82cn): check Job's Condition instead of PodGroup's event. — 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 test/e2e/util/job.go:438 — // TODO(k82cn): check Job's conditions instead of PodGroup's event. — 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 test/e2e/schedulingbase/volume_binding.go:90 — // TODO: This may not be available/writable on all images. — 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 test/e2e/schedulingbase/volume_binding.go:565 — // TODO: hostname may not be the best option — 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 test/e2e/schedulingaction/reclaim.go:371 — // TODO: it is a bug : the job status is pending but podgroup status is running — 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 test/e2e/jobseq/job_error_handling.go:491 — // TODO: skip running -> completing for the github CI pool performance — 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 test/e2e/jobp/job_scale_up_down.go:79 — // TODO: check 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 test/e2e/jobp/job_scale_up_down.go:137 — // TODO: check 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 test/e2e/jobp/job_scale_up_down.go:213 — // TODO: check 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 staging/src/volcano.sh/apis/pkg/client/informers/externalversions/generic.go:60 — // TODO extend this to unknown resources with a client pool — 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 pkg/webhooks/admission/jobs/mutate/mutate_job.go:187 — // TODO: Enable this configuration when dependOn supports coexistence with the gang plugin — 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 pkg/scheduler/util/predicate_helper.go:113 — // TODO (k82cn): Enable eCache for performance improvement. — 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 pkg/scheduler/util/test_utils.go:661 — // TODO: QueueWrapper is inherited from https://github.com/volcano-sh/volcano/pull/4315, but this PR is not yet completed.
  • TodoComment pkg/scheduler/uthelper/helper.go:198 — // todo support other selector 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 pkg/scheduler/plugins/rescheduling/node_utilization_util.go:115 — // TODO: It is just for lowNodeUtilization now, which should be abstracted as a common function. — 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 pkg/scheduler/plugins/proportion/proportion.go:617 — // TODO(k82cn): how to handle fragment issues? — 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 pkg/scheduler/plugins/predicates/predicates.go:298 — // TODO: Need to unify the plugins in nodeorder to predicates. — 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 pkg/scheduler/plugins/predicates/predicates.go:500 — // TODO: Add more predicates, k8s.io/kubernetes/pkg/scheduler/framework/plugins/legacy_registry.go — 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 pkg/scheduler/plugins/overcommit/overcommit.go:122 — //TODO: if allow 1 more job to be inqueue beyond overcommit-factor, large job may be inqueue and create pods — 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 pkg/scheduler/plugins/gang/gang.go:127 — // TODO(k82cn): Support preempt/reclaim batch job. — 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 pkg/scheduler/plugins/gang/gang.go:262 — // TODO: If the Job is gang-unschedulable due to scheduling gates — 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 pkg/scheduler/plugins/deviceshare/deviceshare.go:278 — // TODO: we should use a separate plugin for devices, and separate them from predicates and nodeOrder plugin. — 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 pkg/scheduler/cache/cache.go:1806 — // TODO: should we skip pod unschedulable event if pod group is unschedulable due to gates to avoid printing too many messages? — 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 pkg/scheduler/cache/event_handlers.go:89 — // @Lily922 TODO: support counting shared volumes. Currently, if two different pods use the same attachable volume — 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 pkg/scheduler/cache/event_handlers.go:121 — // @Lily922 TODO: support Inline volumes. — 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.
  • + 55 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×20
  • Duplicated block (9 lines × 2) pkg/agentscheduler/cache/cache.go:626 — pkg/agentscheduler/cache/cache.go:626-634 | pkg/scheduler/cache/cache.go:1113-1121 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 `pkg/agentscheduler/cache/cache.go:626` 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) pkg/agentscheduler/cache/cache.go:946 — pkg/agentscheduler/cache/cache.go:946-954 | pkg/scheduler/cache/cache.go:1616-1624 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 `pkg/agentscheduler/cache/cache.go:946` 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 (9 lines × 2) pkg/controllers/garbagecollector/garbagecollector.go:102 — pkg/controllers/garbagecollector/garbagecollector.go:102-110 | pkg/controllers/queue/queue_controller.go:183-192 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/garbagecollector/garbagecollector.go:102` 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) pkg/controllers/job/plugins/distributed-framework/ray/ray.go:234 — pkg/controllers/job/plugins/distributed-framework/ray/ray.go:234-242 | pkg/controllers/job/plugins/svc/svc.go:222-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/job/plugins/distributed-framework/ray/ray.go:234` 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) pkg/controllers/job/plugins/ssh/ssh.go:266 — pkg/controllers/job/plugins/ssh/ssh.go:266-274 | pkg/controllers/job/plugins/svc/svc.go:316-324 — 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 `pkg/controllers/job/plugins/ssh/ssh.go:266` 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) pkg/scheduler/api/job_info.go:1026 — pkg/scheduler/api/job_info.go:1026-1034 | pkg/scheduler/api/sub_job_info.go:249-257 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/scheduler/api/job_info.go:1037` calls `WaitingTaskNum` and `pkg/scheduler/api/sub_job_info.go:261` 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) pkg/scheduler/cache/event_handlers.go:1088 — pkg/scheduler/cache/event_handlers.go:1088-1096 | pkg/scheduler/cache/event_handlers.go:1130-1138 — both copies are in the same file, so extract the 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, `pkg/scheduler/cache/event_handlers.go:1128` calls `podGroupSchedulingInputsChanged` and `pkg/scheduler/cache/event_handlers.go:1086` 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) pkg/scheduler/plugins/drf/drf.go:406 — pkg/scheduler/plugins/drf/drf.go:406-414 | pkg/scheduler/plugins/drf/drf.go:437-445 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/drf/drf.go:406` 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) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:356 — pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:356-364 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:370-378 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:356` 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 × 2) REDACTED:89 — REDACTED:89-97 | REDACTED:104-112 — both copies are in the same file, so extract the 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 (9 lines × 2) pkg/agentscheduler/cache/dumper.go:64 — pkg/agentscheduler/cache/dumper.go:64-72 | pkg/scheduler/cache/dumper.go:65-73 — before extracting anything, compare `pkg/agentscheduler/cache/dumper.go` and `pkg/scheduler/cache/dumper.go` 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. 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) pkg/agentscheduler/cache/factory.go:55 — pkg/agentscheduler/cache/factory.go:55-63 | pkg/scheduler/cache/factory.go:55-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. 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 × 2) pkg/agentscheduler/util.go:68 — pkg/agentscheduler/util.go:68-76 | pkg/scheduler/util.go:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) pkg/cli/jobflow/describe.go:136 — pkg/cli/jobflow/describe.go:136-144 | pkg/cli/jobtemplate/describe.go:136-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 (9 lines × 2) pkg/scheduler/api/job_info.go:1043 — pkg/scheduler/api/job_info.go:1043-1051 | pkg/scheduler/api/sub_job_info.go:261-269 — 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, `pkg/scheduler/api/sub_job_info.go:272` calls `WaitingTaskNum` and `pkg/scheduler/api/job_info.go:1053` 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) pkg/scheduler/api/job_info.go:1053 — pkg/scheduler/api/job_info.go:1053-1061 | pkg/scheduler/api/sub_job_info.go:276-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 both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:201 — pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:201-210 | pkg/controllers/queue/queue_controller_handler.go:120-128 — 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 `pkg/controllers/namespacequeue/namespacequeue_controller_handler.go: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 (9 lines × 2) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:310 — pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:310-319 | pkg/controllers/queue/queue_controller_handler.go:48-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/namespacequeue/namespacequeue_controller_handler.go: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 (9 lines × 2) REDACTED:51 — REDACTED:51-59 | REDACTED:84-92 — both copies are in the same file, so extract the 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:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:197 — REDACTED:197-205 | REDACTED:149-157 — 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:197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×18
  • Duplicated block (10 lines × 2) pkg/agent/utils/cgroup/cgroup.go:463 — pkg/agent/utils/cgroup/cgroup.go:463-472 | pkg/agent/utils/cgroup/cgroup.go:482-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/agent/utils/cgroup/cgroup.go:492` calls `getPodCgroupNameSuffix` and `pkg/agent/utils/cgroup/cgroup.go:474` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) pkg/agentscheduler/cache/event_handlers.go:354 — pkg/agentscheduler/cache/event_handlers.go:354-363 | pkg/scheduler/cache/event_handlers.go:709-718 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/agentscheduler/cache/event_handlers.go:364` calls `RemoveBindRecord` and `pkg/scheduler/cache/event_handlers.go:720` 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) pkg/agentscheduler/cache/event_handlers.go:406 — pkg/agentscheduler/cache/event_handlers.go:406-415 | pkg/scheduler/cache/event_handlers.go:754-763 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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, `pkg/scheduler/cache/event_handlers.go:764` calls `DeepEqual`, `GetLabels`, `Add` and `pkg/agentscheduler/cache/event_handlers.go:416` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) pkg/scheduler/api/devices/ascend/hami/device_info.go:433 — pkg/scheduler/api/devices/ascend/hami/device_info.go:433-442 | pkg/scheduler/api/devices/ascend/hami/device_info.go:583-592 — both copies are in the same file, so extract the 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 `pkg/scheduler/api/devices/ascend/hami/device_info.go: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 (10 lines × 2) pkg/scheduler/api/devices/nvidia/vgpu/hamicore.go:47 — pkg/scheduler/api/devices/nvidia/vgpu/hamicore.go:47-56 | pkg/scheduler/api/devices/nvidia/vgpu/mig.go:82-91 — 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 `pkg/scheduler/api/devices/nvidia/vgpu/hamicore.go:47` 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 (10 lines × 2) pkg/scheduler/api/devices/util.go:243 — pkg/scheduler/api/devices/util.go:243-252 | pkg/scheduler/api/devices/util.go:260-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/api/devices/util.go:243` 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) REDACTED:697 — REDACTED:697-706 | pkg/scheduler/framework/session_plugins.go:891-900 — 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:697` 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) pkg/scheduler/plugins/capacity/capacity.go:1117 — pkg/scheduler/plugins/capacity/capacity.go:1117-1126 | pkg/scheduler/plugins/proportion/proportion.go:145-154 — 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 `pkg/scheduler/plugins/capacity/capacity.go:1117` 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, `pkg/scheduler/plugins/capacity/capacity.go:1128` calls `addTaskDRAAllocated` and `pkg/scheduler/plugins/proportion/proportion.go:155` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:125 — pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:125-134 | pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:186-195 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) pkg/agentscheduler/cache/dumper.go:45 — pkg/agentscheduler/cache/dumper.go:45-54 | pkg/scheduler/cache/dumper.go:46-55 — before extracting anything, compare `pkg/agentscheduler/cache/dumper.go` and `pkg/scheduler/cache/dumper.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also 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 × 2) pkg/cli/jobflow/describe.go:125 — pkg/cli/jobflow/describe.go:125-134 | pkg/cli/jobtemplate/describe.go:125-134 — 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) pkg/controllers/job/job_controller_util.go:335 — pkg/controllers/job/job_controller_util.go:335-344 | pkg/controllers/jobflow/jobflow_controller_util.go:37-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) pkg/controllers/job/plugins/distributed-framework/hcclrank/hcclrank.go:91 — pkg/controllers/job/plugins/distributed-framework/hcclrank/hcclrank.go:91-100 | pkg/controllers/job/plugins/distributed-framework/pytorch/pytorch.go:128-137 — 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) REDACTED:92 — REDACTED:92-101 | REDACTED:48-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 (10 lines × 2) pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/score_policy.go:91 — pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/score_policy.go:91-100 | pkg/scheduler/plugins/deviceshare/deviceshare.go:188-197 — 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) pkg/agent/utils/node/annotation.go:36 — pkg/agent/utils/node/annotation.go:36-45 | pkg/agent/utils/node/label.go:26-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) pkg/agent/utils/node/annotation.go:47 — pkg/agent/utils/node/annotation.go:47-56 | pkg/agent/utils/node/label.go:46-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) pkg/scheduler/plugins/predicates/predicates.go:346 — pkg/scheduler/plugins/predicates/predicates.go:346-356 | pkg/scheduler/plugins/predicates/predicates.go:373-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/plugins/predicates/predicates.go:346` 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.
D3 · God Classes · MethodTooLong · ×17
  • MethodTooLong: capacityPlugin.OnSessionOpen pkg/scheduler/plugins/capacity/capacity.go:442 — MethodTooLong — OnSessionOpen runs 376 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 276 over it, 3.76× 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: proportionPlugin.OnSessionOpen pkg/scheduler/plugins/proportion/proportion.go:91 — MethodTooLong — OnSessionOpen runs 291 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 191 over it, 2.91× 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: jobcontroller.syncJob pkg/controllers/job/job_controller_actions.go:394 — MethodTooLong — syncJob runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SchedulerCache.addEventHandler pkg/scheduler/cache/cache.go:685 — MethodTooLong — addEventHandler runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: drfPlugin.OnSessionOpen pkg/scheduler/plugins/drf/drf.go:186 — MethodTooLong — OnSessionOpen runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PredicatesPlugin.InitPlugin pkg/scheduler/plugins/predicates/predicates.go:452 — MethodTooLong — InitPlugin runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: fairSharePlugin.OnSessionOpen pkg/scheduler/plugins/fairshare/fairshare.go:236 — MethodTooLong — OnSessionOpen runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× 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: PredicatesPlugin.OnSessionOpen pkg/scheduler/plugins/predicates/predicates.go:206 — MethodTooLong — OnSessionOpen runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.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.
  • MethodTooLong: capacityPlugin.buildHierarchicalQueueAttrs pkg/scheduler/plugins/capacity/capacity.go:1210 — MethodTooLong — buildHierarchicalQueueAttrs 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: jobcontroller.killPods pkg/controllers/job/job_controller_actions.go:110 — MethodTooLong — killPods 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: deviceSharePlugin.wrapGPUDevicesForExclusivity pkg/scheduler/plugins/deviceshare/gpuexclusive.go:431 — MethodTooLong — wrapGPUDevicesForExclusivity runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SchedulerCache.addEventHandler pkg/agentscheduler/cache/cache.go:405 — MethodTooLong — addEventHandler runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Action.Execute REDACTED:101 — MethodTooLong — Execute runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: namespaceQueueController.evaluateParent pkg/controllers/namespacequeue/namespacequeue_controller_action.go:140 — MethodTooLong — evaluateParent runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× 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: Action.allocateResourcesForTasks REDACTED:933 — MethodTooLong — allocateResourcesForTasks runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: extenderPlugin.OnSessionOpen pkg/scheduler/plugins/extender/extender.go:173 — MethodTooLong — OnSessionOpen runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: gangPlugin.OnSessionOpen pkg/scheduler/plugins/gang/gang.go:57 — MethodTooLong — OnSessionOpen runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.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.
D3 · God Classes · FileTooLong · ×17
  • FileTooLong: cache/cache.go pkg/scheduler/cache/cache.go — FileTooLong — 1352 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: SchedulerCache (57 blocks, 117-2185). The bar is 500 significant lines; this is 852 over it, 2.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: capacity/capacity.go pkg/scheduler/plugins/capacity/capacity.go — FileTooLong — 1239 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: capacityPlugin (31 blocks, 62-2009). The bar is 500 significant lines; this is 739 over it, 2.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: cache/event_handlers.go pkg/scheduler/cache/event_handlers.go — FileTooLong — 1122 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: SchedulerCache (81 blocks, 72-1811). The bar is 500 significant lines; this is 622 over it, 2.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: api/job_info.go pkg/scheduler/api/job_info.go — FileTooLong — 977 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: JobInfo (66 blocks, 447-1751). The bar is 500 significant lines; this is 477 over it, 1.95× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: Action (19 blocks, 118-1291). The bar is 500 significant lines; this is 337 over it, 1.67× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: job/job_controller_actions.go pkg/controllers/job/job_controller_actions.go — FileTooLong — 795 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: jobcontroller (24 blocks, 54-1240). The bar is 500 significant lines; this is 295 over it, 1.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: framework/session_plugins.go pkg/scheduler/framework/session_plugins.go — FileTooLong — 791 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: Session (85 blocks, 40-1467). The bar is 500 significant lines; this is 291 over it, 1.58× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: cache/cache.go pkg/agentscheduler/cache/cache.go — FileTooLong — 730 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: SchedulerCache (45 blocks, 100-1226). The bar is 500 significant lines; this is 230 over it, 1.46× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: Session (37 blocks, 69-1108). The bar is 500 significant lines; this is 185 over it, 1.37× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: predicates/predicates.go pkg/scheduler/plugins/predicates/predicates.go — FileTooLong — 628 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: PredicatesPlugin (15 blocks, 103-971). The bar is 500 significant lines; this is 128 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: sharding/sharding_controller.go pkg/controllers/sharding/sharding_controller.go — FileTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: ShardingController (34 blocks, 59-969). The bar is 500 significant lines; this is 68 over it, 1.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: hami/device_info.go pkg/scheduler/api/devices/ascend/hami/device_info.go — FileTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 65 over it, 1.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 59 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: api/hyper_node_info.go pkg/scheduler/api/hyper_node_info.go — FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: HyperNodesInfo (34 blocks, 41-881). The bar is 500 significant lines; this is 58 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: vnpu/init_policy.go pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go — FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 41 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: api/resource_info.go pkg/scheduler/api/resource_info.go — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: Resource (31 blocks, 60-1009). The bar is 500 significant lines; this is 38 over it, 1.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: network-topology-aware/network_topology_aware.go pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go — FileTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: networkTopologyAwarePlugin (19 blocks, 68-843). The bar is 500 significant lines; this is 1 over it, 1.00× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×17
  • Duplicated block (8 lines × 2) pkg/agent/events/handlers/cpuburst/cpu_burst_linux.go:117 — pkg/agent/events/handlers/cpuburst/cpu_burst_linux.go:117-124 | pkg/agent/events/handlers/cpuburst/cpu_burst_linux.go:168-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/controllers/apis/job_info.go:144 — pkg/controllers/apis/job_info.go:144-151 | pkg/controllers/apis/job_info.go:185-192 — both copies are in the same file, so extract the 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 `pkg/controllers/apis/job_info.go:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/controllers/job/job_controller_plugins.go:31 — pkg/controllers/job/job_controller_plugins.go:31-38 | pkg/controllers/job/job_controller_plugins.go:74-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/job/job_controller_plugins.go:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/controllers/job/plugins/svc/svc.go:247 — pkg/controllers/job/plugins/svc/svc.go:247-254 | pkg/controllers/job/plugins/svc/svc.go:296-303 — both copies are in the same file, so extract the 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 `pkg/controllers/job/plugins/svc/svc.go:247` 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 (8 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:190 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:190-197 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:195-202 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 `pkg/scheduler/actions/gangpreempt/gangpreempt.go:190` 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) REDACTED:63 — REDACTED:63-70 | REDACTED:96-103 — both copies are in the same file, so extract the 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:63` 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) pkg/agentscheduler/cache/event_handlers.go:375 — pkg/agentscheduler/cache/event_handlers.go:375-382 | pkg/scheduler/cache/event_handlers.go:725-732 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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, `pkg/agentscheduler/cache/event_handlers.go:385` calls `MoveAllToActiveOrBackoffQueue`, `Background` and `pkg/scheduler/cache/event_handlers.go:733` 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) pkg/agentscheduler/cache/event_handlers.go:477 — pkg/agentscheduler/cache/event_handlers.go:477-484 | pkg/scheduler/cache/event_handlers.go:1767-1774 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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) pkg/agentscheduler/cache/event_handlers.go:487 — pkg/agentscheduler/cache/event_handlers.go:487-494 | pkg/scheduler/cache/event_handlers.go:1777-1784 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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) pkg/agentscheduler/cache/event_handlers.go:497 — pkg/agentscheduler/cache/event_handlers.go:497-504 | pkg/scheduler/cache/event_handlers.go:1787-1794 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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) pkg/scheduler/plugins/numaaware/policy/policy_best_effort.go:34 — pkg/scheduler/plugins/numaaware/policy/policy_best_effort.go:34-41 | pkg/scheduler/plugins/numaaware/policy/policy_restricted.go:34-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) REDACTED:47 — REDACTED:47-54 | pkg/webhooks/admission/jobs/validate/admit_job.go:404-411 — 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) pkg/scheduler/plugins/rescheduling/low_node_utilization.go:62 — pkg/scheduler/plugins/rescheduling/low_node_utilization.go:62-69 | pkg/scheduler/plugins/rescheduling/low_node_utilization.go:75-82 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/rescheduling/low_node_utilization.go: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) REDACTED:747 — REDACTED:747-754 | REDACTED:789-796 — both copies are in the same file, so extract the 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:747` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/scheduler/plugins/drf/drf.go:393 — pkg/scheduler/plugins/drf/drf.go:393-400 | pkg/scheduler/plugins/drf/drf.go:424-431 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/drf/drf.go:393` 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) pkg/scheduler/plugins/capacity/capacity.go:941 — pkg/scheduler/plugins/capacity/capacity.go:941-948 | pkg/scheduler/plugins/proportion/proportion.go:496-503 — 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 `pkg/scheduler/plugins/capacity/capacity.go:941` 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) pkg/controllers/hypernode/configmap_handler.go:71 — pkg/controllers/hypernode/configmap_handler.go:71-78 | pkg/controllers/hypernode/configmap_handler.go:81-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. 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.
X3 · Exception handling · Discarded error (an error-returning call as a bare statement) · ×17
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/queues/validate/validate_queue.go:48 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/queues/mutate/mutate_queue.go:36 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:35 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:36 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:41 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/jobs/validate/admit_job.go:57 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/jobs/mutate/mutate_job.go:50 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/jobflows/validate/validate_jobflow.go:41 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/hypernodes/validate/admit_hypernode.go:60 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:53 — `router.RegisterAdmission(service)` returns an error, and the statement drops it: when `router.RegisterAdmission` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := router.RegisterAdmission(service); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) REDACTED:966 — `ssn.cache.AddUnassignedNumaPods(allocatedSets)` returns an error, and the statement drops it: when `ssn.cache.AddUnassignedNumaPods` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ssn.cache.AddUnassignedNumaPods(allocatedSets); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/scheduler/cache/event_handlers.go:1610 — `sc.addNumaInfo(ss)` returns an error, and the statement drops it: when `sc.addNumaInfo` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := sc.addNumaInfo(ss); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/scheduler/cache/event_handlers.go:1623 — `sc.addNumaInfo(ss)` returns an error, and the statement drops it: when `sc.addNumaInfo` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := sc.addNumaInfo(ss); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/scheduler/cache/shard_coordinator.go:85 — `sc.UpdateNodeShardStatus(nodeShardName)` returns an error, and the statement drops it: when `sc.UpdateNodeShardStatus` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := sc.UpdateNodeShardStatus(nodeShardName); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/scheduler/cache/shard_coordinator.go:91 — `sc.UpdateNodeShardStatus(nodeShardName)` returns an error, and the statement drops it: when `sc.UpdateNodeShardStatus` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := sc.UpdateNodeShardStatus(nodeShardName); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:332 — `nodelock.UseClient(kubeClient)` returns an error, and the statement drops it: when `nodelock.UseClient` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := nodelock.UseClient(kubeClient); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
  • Discarded error (an error-returning call as a bare statement) pkg/scheduler/api/devices/nvidia/gpushare/device_info.go:217 — `nodelock.UseClient(kubeClient)` returns an error, and the statement drops it: when `nodelock.UseClient` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := nodelock.UseClient(kubeClient); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×16
  • Duplicated block (11 lines × 2) cmd/agent-scheduler/app/options/options.go:100 — cmd/agent-scheduler/app/options/options.go:100-110 | cmd/scheduler/app/options/options.go:193-203 — before extracting anything, compare `cmd/agent-scheduler/app/options/options.go` and `cmd/scheduler/app/options/options.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) pkg/agentscheduler/util.go:56 — pkg/agentscheduler/util.go:56-66 | pkg/scheduler/util.go:83-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/agentscheduler/util.go:56` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/controllers/job/job_controller_plugins.go:49 — pkg/controllers/job/job_controller_plugins.go:49-59 | pkg/controllers/job/job_controller_plugins.go:93-103 — both copies are in the same file, so extract the 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 `pkg/controllers/job/job_controller_plugins.go:49` 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 lines × 2) pkg/controllers/jobflow/jobflow_controller.go:136 — pkg/controllers/jobflow/jobflow_controller.go:136-146 | pkg/controllers/jobtemplate/jobtemplate_controller.go:124-134 — `pkg/controllers/jobflow/jobflow_controller.go` and `pkg/controllers/jobtemplate/jobtemplate_controller.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 53 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. 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 (11 lines × 2) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:414 — pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:414-427 | pkg/webhooks/router/indexer.go:77-87 — 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 `pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:414` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/controllers/queue/state/open.go:32 — pkg/controllers/queue/state/open.go:32-42 | pkg/controllers/queue/state/unknown.go:32-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/queue/state/open.go:32` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) pkg/metriccollect/local/local_collector.go:92 — pkg/metriccollect/local/local_collector.go:92-102 | pkg/metriccollect/testing/fake_local_collector.go:62-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/metriccollect/local/local_collector.go: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/scheduler/api/hyper_node_info.go:376 — pkg/scheduler/api/hyper_node_info.go:376-386 | pkg/scheduler/api/hyper_node_info.go:697-707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/scheduler/framework/session_plugins.go:1169 — pkg/scheduler/framework/session_plugins.go:1169-1179 | pkg/scheduler/framework/session_plugins.go:1190-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 `pkg/scheduler/framework/session_plugins.go:1169` 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) pkg/webhooks/admission/queues/validate/validate_queue.go:676 — pkg/webhooks/admission/queues/validate/validate_queue.go:676-686 | pkg/webhooks/admission/queues/validate/validate_queue.go:691-701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/cli/job/list.go:145 — pkg/cli/job/list.go:145-155 | pkg/cli/vjobs/view.go:334-344 — before extracting anything, compare `pkg/cli/job/list.go` and `pkg/cli/vjobs/view.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `pkg/cli/job/list.go:145` 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) pkg/agentscheduler/cache/event_handlers.go:291 — pkg/agentscheduler/cache/event_handlers.go:291-301 | pkg/scheduler/cache/event_handlers.go:669-679 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) pkg/controllers/hypernode/discovery/label/label.go:452 — pkg/controllers/hypernode/discovery/label/label.go:452-462 | pkg/controllers/sharding/node_events.go:116-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.
  • Duplicated block (11 lines × 2) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:44 — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:44-54 | pkg/webhooks/admission/jobs/validate/admit_job.go:48-58 — 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) REDACTED:86 — REDACTED:86-96 | REDACTED:128-138 — both copies are in the same file, so extract the 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:86` 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) pkg/networkqos/cni/config.go:61 — pkg/networkqos/cni/config.go:61-71 | pkg/networkqos/cni/config.go:108-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×15
  • Duplicated block (13 lines × 2) pkg/agentscheduler/framework/plugins.go:209 — pkg/agentscheduler/framework/plugins.go:209-221 | pkg/scheduler/framework/session_plugins.go:1146-1158 — 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 `pkg/agentscheduler/framework/plugins.go:209` 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 (13 lines × 2) pkg/cli/job/resume.go:48 — pkg/cli/job/resume.go:48-60 | pkg/cli/vresume/resume.go:48-60 — `pkg/cli/job/resume.go` and `pkg/cli/vresume/resume.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 1 separate duplicated blocks between them, totalling at least 13 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 lines × 2) pkg/cli/jobflow/get.go:80 — pkg/cli/jobflow/get.go:80-92 | pkg/cli/jobflow/list.go:120-132 — 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) pkg/controllers/cache/cache.go:338 — pkg/controllers/cache/cache.go:338-350 | pkg/controllers/cache/cache.go:373-385 — both copies are in the same file, so extract the 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 `pkg/controllers/cache/cache.go:338` 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) pkg/controllers/queue/state/closing.go:36 — pkg/controllers/queue/state/closing.go:36-48 | pkg/controllers/queue/state/unknown.go:36-48 — 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 `pkg/controllers/queue/state/closing.go: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 (13 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:127 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:127-139 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:129-141 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 `pkg/scheduler/actions/gangpreempt/gangpreempt.go:127` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) pkg/scheduler/api/devices/ascend/hami/device_info.go:186 — pkg/scheduler/api/devices/ascend/hami/device_info.go:186-198 | pkg/scheduler/api/devices/ascend/hami/device_info.go:226-238 — both copies are in the same file, so extract the 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 `pkg/scheduler/api/devices/ascend/hami/device_info.go:186` 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 lines × 2) pkg/scheduler/api/job_info.go:1223 — pkg/scheduler/api/job_info.go:1223-1235 | pkg/scheduler/api/job_info.go:1256-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 `pkg/scheduler/api/job_info.go:1223` 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 (13 lines × 2) pkg/scheduler/api/pod_info.go:256 — pkg/scheduler/api/pod_info.go:256-268 | pkg/scheduler/api/pod_info.go:283-295 — both copies are in the same file, so extract the 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 `pkg/scheduler/api/pod_info.go: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.
  • Duplicated block (13 lines × 2) pkg/scheduler/plugins/binpack/binpack.go:230 — pkg/scheduler/plugins/binpack/binpack.go:230-242 | pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go:384-397 — 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 `pkg/scheduler/plugins/binpack/binpack.go: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 (13 lines × 2) pkg/scheduler/plugins/proportion/proportion.go:461 — pkg/scheduler/plugins/proportion/proportion.go:461-473 | pkg/scheduler/plugins/proportion/proportion.go:480-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:100 — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:100-112 | pkg/webhooks/admission/jobs/validate/admit_job.go:106-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:100` 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 (13 lines × 2) pkg/scheduler/plugins/capacity/capacity.go:1103 — pkg/scheduler/plugins/capacity/capacity.go:1103-1115 | pkg/scheduler/plugins/proportion/proportion.go:100-112 — 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 `pkg/scheduler/plugins/capacity/capacity.go:1103` 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) pkg/controllers/jobflow/jobflow_controller.go:113 — pkg/controllers/jobflow/jobflow_controller.go:113-125 | pkg/controllers/jobtemplate/jobtemplate_controller.go:102-114 — `pkg/controllers/jobflow/jobflow_controller.go` and `pkg/controllers/jobtemplate/jobtemplate_controller.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 53 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 `pkg/controllers/jobflow/jobflow_controller.go:113` 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) REDACTED:757 — REDACTED:757-769 | REDACTED:799-812 — both copies are in the same file, so extract the 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:757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×15
  • Duplicated block (12 lines × 2) pkg/agentscheduler/cache/cache.go:319 — pkg/agentscheduler/cache/cache.go:319-330 | pkg/scheduler/cache/cache.go:579-590 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) pkg/agentscheduler/cache/event_handlers.go:463 — pkg/agentscheduler/cache/event_handlers.go:463-474 | pkg/scheduler/cache/event_handlers.go:861-872 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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 `pkg/scheduler/cache/event_handlers.go:861` 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, `pkg/scheduler/cache/event_handlers.go:858` calls `responsibleForNode` and `pkg/agentscheduler/cache/event_handlers.go:462` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) pkg/cli/job/list.go:182 — pkg/cli/job/list.go:182-193 | pkg/cli/vjobs/view.go:377-388 — before extracting anything, compare `pkg/cli/job/list.go` and `pkg/cli/vjobs/view.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `pkg/cli/job/list.go:182` 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 (12 lines × 2) pkg/cli/util/util.go:100 — pkg/cli/util/util.go:100-111 | pkg/cli/util/util.go:129-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 (12 lines × 2) pkg/controllers/cronjob/cronjob_controller.go:98 — pkg/controllers/cronjob/cronjob_controller.go:98-109 | pkg/controllers/job/job_controller.go:218-229 — 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) REDACTED:198 — REDACTED:198-209 | REDACTED:260-272 — both copies are in the same file, so extract the 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 (12 lines × 2) pkg/scheduler/api/cluster_info.go:53 — pkg/scheduler/api/cluster_info.go:53-64 | pkg/scheduler/cache/cache.go:1757-1768 — 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 `pkg/scheduler/api/cluster_info.go:53` 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) pkg/scheduler/api/pod_info.go:85 — pkg/scheduler/api/pod_info.go:85-96 | pkg/scheduler/api/pod_info.go:134-145 — both copies are in the same file, so extract the 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 `pkg/scheduler/api/pod_info.go: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.
  • Duplicated block (12 lines × 2) pkg/scheduler/plugins/capacity/capacity.go:664 — pkg/scheduler/plugins/capacity/capacity.go:664-675 | pkg/scheduler/plugins/proportion/proportion.go:343-354 — 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 `pkg/scheduler/plugins/capacity/capacity.go:664` 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) pkg/scheduler/plugins/fairshare/fairshare.go:424 — pkg/scheduler/plugins/fairshare/fairshare.go:424-435 | pkg/scheduler/plugins/fairshare/fairshare.go:443-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 (12 lines × 2) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:431 — pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:431-442 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:550-561 — both copies are in the same file, so extract the 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, `pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:563` calls `Get` and `pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:444` 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 (12 lines × 2) pkg/scheduler/plugins/predicates/predicates.go:333 — pkg/scheduler/plugins/predicates/predicates.go:333-344 | pkg/scheduler/plugins/predicates/predicates.go:360-371 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/predicates/predicates.go:333` 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) pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:49 — pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:49-60 | pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:49-60 — 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 `pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go: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.
  • Duplicated block (12 lines × 2) pkg/metriccollect/testing/fake_sub_collector_cpu.go:36 — pkg/metriccollect/testing/fake_sub_collector_cpu.go:36-47 | pkg/metriccollect/testing/fake_sub_collector_memory.go:36-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) pkg/scheduler/plugins/extender/extender.go:251 — pkg/scheduler/plugins/extender/extender.go:251-262 | pkg/scheduler/plugins/extender/extender.go:272-283 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/extender/extender.go:251` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×15
  • Duplicated block (5 lines × 2) pkg/controllers/job/job_controller.go:232 — pkg/controllers/job/job_controller.go:232-237 | pkg/controllers/queue/queue_controller.go:144-148 — 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 `pkg/controllers/job/job_controller.go:232` 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) pkg/controllers/job/job_controller_actions.go:421 — pkg/controllers/job/job_controller_actions.go:421-425 | pkg/controllers/job/job_controller_actions.go:442-446 — both copies are in the same file, so extract the 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 `pkg/controllers/job/job_controller_actions.go:421` 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) pkg/scheduler/plugins/nodeorder/nodeorder.go:274 — pkg/scheduler/plugins/nodeorder/nodeorder.go:274-278 | pkg/scheduler/plugins/nodeorder/nodeorder.go:293-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/plugins/nodeorder/nodeorder.go:274` 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 (5 lines × 2) pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:53 — pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:53-57 | pkg/webhooks/admission/queues/validate/validate_queue.go:60-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:53` 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) pkg/cli/queue/get.go:44 — pkg/cli/queue/get.go:44-48 | pkg/cli/vqueues/get.go:66-70 — 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) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:636 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:636-640 | pkg/scheduler/api/devices/nvidia/gpushare/share.go:184-189 — 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) pkg/scheduler/plugins/drf/drf.go:416 — pkg/scheduler/plugins/drf/drf.go:416-420 | pkg/scheduler/plugins/drf/drf.go:447-451 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/drf/drf.go:416` 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) REDACTED:177 — REDACTED:177-181 | REDACTED:284-288 — both copies are in the same file, so extract the block into 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) pkg/scheduler/plugins/proportion/proportion.go:514 — pkg/scheduler/plugins/proportion/proportion.go:514-518 | pkg/scheduler/plugins/proportion/proportion.go:535-539 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/proportion/proportion.go:514` 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) pkg/controllers/job/plugins/svc/svc.go:222 — pkg/controllers/job/plugins/svc/svc.go:222-226 | pkg/controllers/job/plugins/svc/svc.go:260-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) REDACTED:1252 — REDACTED:1252-1256 | REDACTED:1269-1273 — both copies are in the same file, so extract the 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:1252` 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) pkg/scheduler/cache/cache.go:605 — pkg/scheduler/cache/cache.go:605-609 | pkg/scheduler/cache/cache_mock.go:132-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/cache/cache.go:605` 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) pkg/scheduler/cache/cache.go:619 — pkg/scheduler/cache/cache.go:619-623 | pkg/scheduler/cache/cache_mock.go:146-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/scheduler/cache/cache_mock.go:151` calls `NewShardUpdateCoordinator` and `pkg/scheduler/cache/cache.go:624` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) pkg/scheduler/plugins/usage/usage.go:414 — pkg/scheduler/plugins/usage/usage.go:414-418 | pkg/scheduler/plugins/usage/usage.go:426-430 — both copies are in the same file, so extract the block into 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) pkg/controllers/sharding/test_utils.go:221 — pkg/controllers/sharding/test_utils.go:221-225 | pkg/controllers/sharding/test_utils.go:293-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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D15 · Churn × Complexity Hotspots · Hotspot · ×12
  • Hotspot: pkg/scheduler/plugins/capacity/capacity.go pkg/scheduler/plugins/capacity/capacity.go:442 — pkg/scheduler/plugins/capacity/capacity.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in capacityPlugin.OnSessionOpen at line 442. 3 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/scheduler/plugins/capacity/capacity.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: REDACTED REDACTED:933 — REDACTED changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in Action.allocateResourcesForTasks at line 933. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08: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: pkg/scheduler/plugins/predicates/predicates.go pkg/scheduler/plugins/predicates/predicates.go:206 — pkg/scheduler/plugins/predicates/predicates.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in PredicatesPlugin.OnSessionOpen at line 206. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/scheduler/plugins/predicates/predicates.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: pkg/scheduler/cache/cache.go pkg/scheduler/cache/cache.go:685 — pkg/scheduler/cache/cache.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in SchedulerCache.addEventHandler at line 685. 1 of those changes was a fix/bug commit, 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/scheduler/cache/cache.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: REDACTED REDACTED:184 — REDACTED changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in framework.openSession at line 184. 3 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08: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: REDACTED REDACTED:137 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in Action.pickUpPendingTasks at line 137. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08: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: pkg/controllers/job/job_controller_actions.go pkg/controllers/job/job_controller_actions.go:394 — pkg/controllers/job/job_controller_actions.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in jobcontroller.syncJob at line 394. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/controllers/job/job_controller_actions.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: pkg/scheduler/actions/utils/simulate.go pkg/scheduler/actions/utils/simulate.go:40 — pkg/scheduler/actions/utils/simulate.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in utils.BuildNominationPlanInDomain at line 40. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/scheduler/actions/utils/simulate.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: pkg/scheduler/unschedulable/cache.go pkg/scheduler/unschedulable/cache.go:130 — pkg/scheduler/unschedulable/cache.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in JobCache.Record at line 130. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/scheduler/unschedulable/cache.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: pkg/scheduler/util/predicate_helper.go pkg/scheduler/util/predicate_helper.go:45 — pkg/scheduler/util/predicate_helper.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in predicateHelper.PredicateNodes at line 45. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/scheduler/util/predicate_helper.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: cmd/webhook-manager/app/server.go cmd/webhook-manager/app/server.go:47 — cmd/webhook-manager/app/server.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in app.Run at line 47. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- cmd/webhook-manager/app/server.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: pkg/controllers/job/job_controller.go pkg/controllers/job/job_controller.go:502 — pkg/controllers/job/job_controller.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in jobcontroller.AddDelayActionForJob at line 502. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:33:44 +08:00' --until='2026-11-16 19:33:44 +08:00' --full-history --no-merges -- pkg/controllers/job/job_controller.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.
D29 · Static Analysis (SAST) · REDACTED · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X3 · Exception handling · Discarded error (assigned to `_`, then its result used) · ×12
  • Discarded error (assigned to `_`, then its result used) pkg/webhooks/admission/jobs/mutate/mutate_job.go:96 — `patchBytes, _ = createPatch(job)` writes the call's error to `_` and then uses `patchBytes` as if the call succeeded. When `createPatch` fails, `patchBytes` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `patchBytes` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:145 — `reserved, _ = takeByTopology(cputopo, cputopo.CPUDetails.CPUs(), numReservedCPUs)` writes the call's error to `_` and then uses `reserved` as if the call succeeded. When `takeByTopology` fails, `reserved` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `reserved` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:178 — `reserved, _ = takeByTopology(cputopo, cputopo.CPUDetails.CPUs(), numReservedCPUs)` writes the call's error to `_` and then uses `reserved` as if the call succeeded. When `takeByTopology` fails, `reserved` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `reserved` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) pkg/scheduler/plugins/drf/drf.go:468 — `fweight, _ := strconv.ParseFloat(weights[i], 64)` writes the call's error to `_` and then uses `fweight` as if the call succeeded. When `strconv.ParseFloat` fails, `fweight` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `fweight` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:107 — `cpuUsage, _ := strconv.ParseFloat(value[0], 64)` writes the call's error to `_` and then uses `cpuUsage` as if the call succeeded. When `strconv.ParseFloat` fails, `cpuUsage` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `cpuUsage` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:110 — `memUsage, _ := strconv.ParseFloat(value[0], 64)` writes the call's error to `_` and then uses `memUsage` as if the call succeeded. When `strconv.ParseFloat` fails, `memUsage` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `memUsage` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) pkg/scheduler/cache/event_handlers.go:1552 — `cpuID, _ := strconv.Atoi(key)` writes the call's error to `_` and then uses `cpuID` as if the call succeeded. When `strconv.Atoi` fails, `cpuID` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `cpuID` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) pkg/scheduler/api/devices/device_info.go:142 — `devmem, _ := strconv.ParseInt(tmpstr[2], 10, 32)` writes the call's error to `_` and then uses `devmem` as if the call succeeded. When `strconv.ParseInt` fails, `devmem` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `devmem` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) pkg/scheduler/api/devices/device_info.go:144 — `devcores, _ := strconv.ParseInt(tmpstr[3], 10, 32)` writes the call's error to `_` and then uses `devcores` as if the call succeeded. When `strconv.ParseInt` fails, `devcores` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `devcores` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:70 — `count, _ := strconv.Atoi(items[1])` writes the call's error to `_` and then uses `count` as if the call succeeded. When `strconv.Atoi` fails, `count` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `count` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:71 — `devmem, _ := strconv.Atoi(items[2])` writes the call's error to `_` and then uses `devmem` as if the call succeeded. When `strconv.Atoi` fails, `devmem` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `devmem` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:72 — `health, _ := strconv.ParseBool(items[4])` writes the call's error to `_` and then uses `health` as if the call succeeded. When `strconv.ParseBool` fails, `health` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `health` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×11
  • Duplicated block (7 lines × 2) pkg/agentscheduler/cache/cache.go:463 — pkg/agentscheduler/cache/cache.go:463-469 | pkg/scheduler/cache/cache.go:779-785 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 `pkg/agentscheduler/cache/cache.go:463` 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) pkg/controllers/queue/state/closed.go:29 — pkg/controllers/queue/state/closed.go:29-35 | pkg/controllers/queue/state/closing.go:29-35 — before extracting anything, compare `pkg/controllers/queue/state/closed.go` and `pkg/controllers/queue/state/closing.go` as WHOLE FILES: 87% 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 `pkg/controllers/queue/state/closed.go: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 × 2) REDACTED:121 — REDACTED:121-127 | REDACTED:183-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 (7 lines × 2) pkg/scheduler/api/devices/util.go:136 — pkg/scheduler/api/devices/util.go:136-142 | pkg/scheduler/api/devices/util.go:173-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/api/devices/util.go:136` 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) pkg/cli/vqueues/get.go:102 — pkg/cli/vqueues/get.go:102-108 | pkg/cli/vqueues/get.go:141-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/cli/vqueues/get.go:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pkg/cli/job/view.go:260 — pkg/cli/job/view.go:260-266 | pkg/cli/vjobs/view.go:293-299 — `pkg/cli/job/view.go` and `pkg/cli/vjobs/view.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 5 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.
  • Duplicated block (7 lines × 2) pkg/scheduler/api/job_info.go:1403 — pkg/scheduler/api/job_info.go:1403-1409 | pkg/scheduler/api/sub_job_info.go:91-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) REDACTED:227 — REDACTED:227-233 | REDACTED:351-358 — both copies are in the same file, so extract the 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:227` 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) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:450 — pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:450-456 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:570-576 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:450` 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) REDACTED:391 — REDACTED:391-397 | REDACTED:232-238 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `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 (7 lines × 2) pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:104 — pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:104-110 | pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:123-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 `pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:104` 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, `pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:121` calls `DeleteLabelValues` and `pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:103` 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×11
  • Swallowed exception (caught, then discarded) staging/src/volcano.sh/apis/pkg/apis/utils/utils.go:27 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/webhooks/router/indexer.go:207 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/webhooks/router/queue_reference.go:51 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/webhooks/admission/queues/validate/validate_queue.go:520 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:179 — `if _, err := cron.ParseStandard(spec.Schedule); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:198 — `if _, err := time.LoadLocation(*spec.TimeZone); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/util/socket.go:224 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/util/socket.go:228 — `if err = serveOnListener(listener, mux); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/scheduler/plugins/pdb/pdb.go:97 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/scheduler/plugins/capacity/capacity.go:905 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/scheduler/cache/util.go:144 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: SchedulerCache pkg/scheduler/cache/cache.go:117 — TooManyMethods — 144 methods, declared across 4 files: cache/event_handlers.go (81), cache/cache.go (56), cache/shard_coordinator.go (6), cache/cache_mock.go (1). The bar is 30 methods; this is 114 over it, 4.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: Session REDACTED:69 — TooManyMethods — 128 methods, declared across 4 files: framework/session_plugins.go (85), REDACTED (36), framework/session_rejections.go (5), framework/hyper_node_candidate.go (2). The bar is 30 methods; this is 98 over it, 4.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: SchedulerCache pkg/agentscheduler/cache/cache.go:100 — TooManyMethods — 72 methods, declared across 3 files: cache/cache.go (44), cache/event_handlers.go (27), cache/cache_mock.go (1). The bar is 30 methods; this is 42 over it, 2.40× 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: JobInfo pkg/scheduler/api/job_info.go:447 — TooManyMethods — 71 methods, declared across 2 files: api/job_info.go (65), api/topology_affinity_info.go (6). The bar is 30 methods; this is 41 over it, 2.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: jobcontroller pkg/controllers/job/job_controller.go:118 — TooManyMethods — 59 methods, declared across 5 files: job/job_controller_actions.go (24), job/job_controller.go (17), job/job_controller_handler.go (11), job/job_controller_plugins.go (4), +1 more file(s). The bar is 30 methods; this is 29 over it, 1.97× 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: ShardingController pkg/controllers/sharding/sharding_controller.go:59 — TooManyMethods — 57 methods, declared across 6 files: sharding/sharding_controller.go (33), sharding/node_events.go (10), sharding/node_utilization.go (5), sharding/pod_events.go (5), +2 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: NPUDevices pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_info.go:32 — TooManyMethods — 40 methods, declared across 2 files: vnpu/device_manage.go (28), vnpu/device_info.go (12). The bar is 30 methods; this is 10 over it, 1.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Framework pkg/scheduler/plugins/util/k8s/framework.go:39 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: namespaceQueueController pkg/controllers/namespacequeue/namespacequeue_controller.go:51 — TooManyMethods — 37 methods, declared across 4 files: namespacequeue/namespacequeue_controller_handler.go (16), namespacequeue/namespacequeue_controller.go (8), namespacequeue/namespacequeue_controller_action.go (8), REDACTED (5). The bar is 30 methods; this is 7 over it, 1.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: HyperNodesInfo pkg/scheduler/api/hyper_node_info.go:41 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×10
  • Duplicated block (6 lines × 2) pkg/agentscheduler/cache/cache.go:528 — pkg/agentscheduler/cache/cache.go:528-533 | pkg/scheduler/cache/cache.go:906-911 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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, `pkg/agentscheduler/cache/cache.go:534` calls `Shard`, `V1alpha1`, `NodeShards` and `pkg/scheduler/cache/cache.go:912` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) pkg/agentscheduler/cache/cache.go:564 — pkg/agentscheduler/cache/cache.go:564-569 | pkg/scheduler/cache/cache.go:979-984 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 × 2) pkg/scheduler/framework/util.go:67 — pkg/scheduler/framework/util.go:67-73 | pkg/scheduler/framework/util.go:99-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.
  • Duplicated block (6 lines × 2) pkg/scheduler/plugins/capacity/capacity.go:962 — pkg/scheduler/plugins/capacity/capacity.go:962-967 | pkg/scheduler/plugins/capacity/capacity.go:1000-1005 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/capacity/capacity.go:962` 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) pkg/scheduler/plugins/fairshare/persist.go:114 — pkg/scheduler/plugins/fairshare/persist.go:114-119 | pkg/scheduler/plugins/fairshare/persist.go:165-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 `pkg/scheduler/plugins/fairshare/persist.go:114` 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 (6 lines × 2) pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:46 — pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:46-51 | pkg/webhooks/admission/queues/mutate/mutate_queue.go:46-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 `pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go: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.
  • Duplicated block (6 lines × 2) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/utils.go:157 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/utils.go:157-162 | pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/node.go:56-61 — 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) pkg/agentscheduler/cache/cache.go:1195 — pkg/agentscheduler/cache/cache.go:1195-1201 | pkg/scheduler/cache/shard_coordinator.go:127-132 — 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) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:326 — pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:326-331 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:341-347 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:341` 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. 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 × 2) pkg/scheduler/plugins/tdm/tdm.go:166 — pkg/scheduler/plugins/tdm/tdm.go:166-171 | pkg/scheduler/plugins/usage/usage.go:329-334 — 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 `pkg/scheduler/plugins/tdm/tdm.go:166` 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.
D3 · God Classes · ClassTooLong · ×9
  • ClassTooLong: SchedulerCache pkg/scheduler/cache/cache.go:117 — ClassTooLong — 967 significant lines (blank, comment-only and punctuation-only lines excluded), 144 methods, 57 blocks, lines 117-2185. The bar is 400 significant lines; this is 567 over it, 2.42× 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: capacityPlugin pkg/scheduler/plugins/capacity/capacity.go:62 — ClassTooLong — 893 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods, 31 blocks, lines 62-2009. The bar is 400 significant lines; this is 493 over it, 2.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.
  • ClassTooLong: JobInfo pkg/scheduler/api/job_info.go:447 — ClassTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods, 66 blocks, lines 447-1751. The bar is 400 significant lines; this is 275 over it, 1.69× 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: Action REDACTED:118 — ClassTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 19 blocks, lines 118-1291. The bar is 400 significant lines; this is 252 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SchedulerCache pkg/agentscheduler/cache/cache.go:100 — ClassTooLong — 537 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods, 45 blocks, lines 100-1226. The bar is 400 significant lines; this is 137 over it, 1.34× 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: PredicatesPlugin pkg/scheduler/plugins/predicates/predicates.go:103 — ClassTooLong — 499 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods, 15 blocks, lines 103-971. The bar is 400 significant lines; this is 99 over it, 1.25× 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: ShardingController pkg/controllers/sharding/sharding_controller.go:59 — ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods, 34 blocks, lines 59-969. The bar is 400 significant lines; this is 98 over it, 1.25× 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: Session REDACTED:69 — ClassTooLong — 419 significant lines (blank, comment-only and punctuation-only lines excluded), 128 methods, 37 blocks, lines 69-1108. The bar is 400 significant lines; this is 19 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Resource pkg/scheduler/api/resource_info.go:60 — ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods, 31 blocks, lines 60-1009. The bar is 400 significant lines; this is 9 over it, 1.02× 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 (20 corresponding lines) · ×9
  • Edited copy of a member (20 corresponding lines) pkg/agentscheduler/cache/cache.go:222 — pkg/agentscheduler/cache/cache.go:222-241 | pkg/scheduler/cache/cache.go:245-269 — 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) pkg/scheduler/actions/utils/bundle.go:248 — pkg/scheduler/actions/utils/bundle.go:248-267 | pkg/scheduler/actions/utils/bundle.go:269-292 — 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) pkg/scheduler/plugins/util/nodelock/nodelock.go:90 — pkg/scheduler/plugins/util/nodelock/nodelock.go:90-109 | pkg/scheduler/plugins/util/nodelock/nodelock.go:111-130 — 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) pkg/scheduler/actions/utils/simulate.go:382 — pkg/scheduler/actions/utils/simulate.go:382-401 | pkg/scheduler/actions/utils/simulate.go:403-423 — 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) pkg/cli/jobflow/list.go:90 — pkg/cli/jobflow/list.go:90-111 | pkg/cli/jobtemplate/list.go:77-96 — 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) pkg/scheduler/cache/util.go:73 — pkg/scheduler/cache/util.go:73-95 | pkg/scheduler/cache/util.go:114-133 — 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) pkg/controllers/namespacequeue/namespacequeue_controller.go:219 — pkg/controllers/namespacequeue/namespacequeue_controller.go:219-241 | pkg/controllers/sharding/sharding_controller.go:374-393 — 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) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:309 — pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:309-332 | pkg/controllers/queue/queue_controller_handler.go:47-66 — 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) pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:347 — pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:347-366 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:733-753 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×8
  • Edited copy of a member (9 corresponding lines) pkg/cli/job/list.go:84 — pkg/cli/job/list.go:84-92 | pkg/cli/vjobs/view.go:94-102 — 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) pkg/scheduler/api/devices/device_info.go:105 — pkg/scheduler/api/devices/device_info.go:105-113 | REDACTED:102-110 — 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) pkg/controllers/hypernode/configmap_handler.go:70 — pkg/controllers/hypernode/configmap_handler.go:70-78 | pkg/controllers/hypernode/configmap_handler.go:80-88 — 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) pkg/scheduler/api/job_info.go:1332 — pkg/scheduler/api/job_info.go:1332-1340 | pkg/scheduler/api/job_info.go:1342-1350 — 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) pkg/scheduler/plugins/util/nodescore/score_helper.go:53 — pkg/scheduler/plugins/util/nodescore/score_helper.go:53-64 | REDACTED:289-297 — 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) pkg/agentscheduler/metrics/metrics.go:53 — pkg/agentscheduler/metrics/metrics.go:53-64 | pkg/scheduler/metrics/metrics.go:227-235 — 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) pkg/controllers/garbagecollector/garbagecollector.go:146 — pkg/controllers/garbagecollector/garbagecollector.go:146-154 | pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:49-57 — 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) pkg/scheduler/util/test_utils.go:401 — pkg/scheduler/util/test_utils.go:401-409 | pkg/scheduler/util/test_utils.go:412-420 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×8
  • Duplicated block (16 lines × 2) pkg/agentscheduler/cache/cache.go:289 — pkg/agentscheduler/cache/cache.go:289-304 | pkg/scheduler/cache/cache.go:471-486 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) pkg/agentscheduler/cache/cache.go:471 — pkg/agentscheduler/cache/cache.go:471-486 | pkg/agentscheduler/cache/cache.go:502-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/agentscheduler/cache/cache.go:471` 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) pkg/agentscheduler/cache/event_handlers.go:420 — pkg/agentscheduler/cache/event_handlers.go:420-435 | pkg/scheduler/cache/event_handlers.go:771-786 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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) pkg/cli/job/view.go:71 — pkg/cli/job/view.go:71-86 | pkg/cli/vjobs/view.go:112-127 — `pkg/cli/job/view.go` and `pkg/cli/vjobs/view.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 5 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 `pkg/cli/job/view.go:71` 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 (16 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:232 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:232-247 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:233-248 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 `pkg/scheduler/actions/gangpreempt/gangpreempt.go:232` 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 (16 lines × 2) pkg/scheduler/api/resource_info.go:412 — pkg/scheduler/api/resource_info.go:412-427 | pkg/scheduler/api/resource_info.go:451-466 — both copies are in the same file, so extract the 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 `pkg/scheduler/api/resource_info.go: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. 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) pkg/scheduler/api/resource_info.go:571 — pkg/scheduler/api/resource_info.go:571-586 | pkg/scheduler/api/resource_info.go:607-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 `pkg/scheduler/api/resource_info.go:571` 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) pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:351 — pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:351-366 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:738-753 — 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 `pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:351` 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.
D3 · God Classes · TooManyFields · ×7
  • TooManyFields: Session REDACTED:69 — TooManyFields — 79 stored fields beside 128 methods. The bar is 30 stored fields; this is 49 over it, 2.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: SchedulerCache pkg/scheduler/cache/cache.go:117 — TooManyFields — 63 stored fields beside 144 methods. The bar is 30 stored fields; this is 33 over it, 2.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: ServerOption cmd/scheduler/app/options/options.go:65 — TooManyFields — 41 stored fields beside 5 methods. The bar is 30 stored fields; this is 11 over it, 1.37× 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: SchedulerCache pkg/agentscheduler/cache/cache.go:100 — TooManyFields — 40 stored fields beside 72 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: jobcontroller pkg/controllers/job/job_controller.go:118 — TooManyFields — 39 stored fields beside 59 methods. The bar is 30 stored fields; this is 9 over it, 1.30× 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: TestCommonStruct pkg/scheduler/uthelper/helper.go:60 — TooManyFields — 38 stored fields beside 11 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: JobInfo pkg/scheduler/api/job_info.go:447 — TooManyFields — 32 stored fields beside 71 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 (13 corresponding lines) · ×7
  • Edited copy of a member (13 corresponding lines) pkg/cli/job/run.go:54 — pkg/cli/job/run.go:54-66 | pkg/cli/vsub/run.go:69-88 — 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) pkg/cli/vqueues/get.go:95 — pkg/cli/vqueues/get.go:95-109 | pkg/cli/vqueues/get.go:135-147 — 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) pkg/agent/events/probes/nodemonitor/node_monitor.go:190 — pkg/agent/events/probes/nodemonitor/node_monitor.go:190-203 | pkg/agent/events/probes/nodemonitor/node_monitor.go:205-217 — 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) pkg/metriccollect/local/local_collector.go:90 — pkg/metriccollect/local/local_collector.go:90-102 | pkg/metriccollect/testing/fake_local_collector.go:60-72 — 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) pkg/scheduler/cache/event_handlers.go:1490 — pkg/scheduler/cache/event_handlers.go:1490-1502 | pkg/scheduler/cache/event_handlers.go:1505-1520 — 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) pkg/agentscheduler/cache/event_handlers.go:462 — pkg/agentscheduler/cache/event_handlers.go:462-474 | pkg/scheduler/cache/event_handlers.go:857-872 — 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) pkg/scheduler/framework/session_dra_queue_status.go:65 — pkg/scheduler/framework/session_dra_queue_status.go:65-81 | pkg/scheduler/plugins/capacity/capacity.go:312-324 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×7
  • Edited copy of a member (19 corresponding lines) pkg/agentscheduler/cache/cache.go:917 — pkg/agentscheduler/cache/cache.go:917-936 | pkg/scheduler/cache/cache.go:1588-1606 — 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) pkg/agentscheduler/cache/dumper.go:44 — pkg/agentscheduler/cache/dumper.go:44-62 | pkg/scheduler/cache/dumper.go:45-63 — 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) pkg/scheduler/framework/session_plugins.go:1161 — pkg/scheduler/framework/session_plugins.go:1161-1179 | pkg/scheduler/framework/session_plugins.go:1182-1200 — 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) pkg/cli/job/delete.go:48 — pkg/cli/job/delete.go:48-66 | pkg/cli/vcancel/cancel.go:49-67 — 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) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:110 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:110-128 | pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:131-149 — 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) pkg/scheduler/framework/session_plugins.go:437 — pkg/scheduler/framework/session_plugins.go:437-459 | pkg/scheduler/framework/session_plugins.go:496-514 — 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) pkg/agentscheduler/scheduler.go:51 — pkg/agentscheduler/scheduler.go:51-71 | pkg/scheduler/scheduler.go:52-70 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) pkg/agentscheduler/cache/event_handlers.go:419 — pkg/agentscheduler/cache/event_handlers.go:419-436 | pkg/scheduler/cache/event_handlers.go:770-788 — 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) pkg/agent/utils/cgroup/cgroup.go:462 — pkg/agent/utils/cgroup/cgroup.go:462-479 | pkg/agent/utils/cgroup/cgroup.go:481-500 — 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) pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:123 — pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:123-140 | pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:184-201 — 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) pkg/scheduler/framework/session_plugins.go:949 — pkg/scheduler/framework/session_plugins.go:949-966 | pkg/scheduler/framework/session_plugins.go:969-986 — 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) pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:170 — pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:170-189 | pkg/controllers/job/plugins/distributed-framework/pytorch/pytorch.go:323-340 — 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) pkg/scheduler/api/topology_affinity_info.go:99 — pkg/scheduler/api/topology_affinity_info.go:99-119 | pkg/scheduler/api/topology_affinity_info.go:121-138 — 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) pkg/controllers/cache/cache.go:112 — pkg/controllers/cache/cache.go:112-129 | pkg/controllers/cache/cache.go:131-150 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×6
  • Edited copy of a member (26 corresponding lines) pkg/scheduler/api/job_info.go:628 — pkg/scheduler/api/job_info.go:628-654 | pkg/scheduler/api/pod_info.go:176-202 — 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) pkg/agent/events/handlers/cpuqos/cpuqos_linux.go:56 — pkg/agent/events/handlers/cpuqos/cpuqos_linux.go:56-81 | pkg/agent/events/handlers/memoryqos/memoryqos_linux.go:57-82 — 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) pkg/scheduler/api/pod_info.go:255 — pkg/scheduler/api/pod_info.go:255-280 | pkg/scheduler/api/pod_info.go:282-307 — 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) pkg/agentscheduler/framework/plugins.go:173 — pkg/agentscheduler/framework/plugins.go:173-198 | pkg/scheduler/framework/session_plugins.go:1087-1112 — 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) pkg/scheduler/plugins/proportion/hintprovider/hint_provider.go:107 — pkg/scheduler/plugins/proportion/hintprovider/hint_provider.go:107-132 | pkg/scheduler/plugins/util/hintutil/hintutil.go:164-197 — 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:82 — REDACTED:82-110 | REDACTED:123-148 — 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×6
  • Edited copy of a member (11 corresponding lines) pkg/scheduler/plugins/usage/usage.go:413 — pkg/scheduler/plugins/usage/usage.go:413-423 | pkg/scheduler/plugins/usage/usage.go:425-436 — 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) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:323 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:323-336 | pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:674-684 — 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) pkg/agent/events/handlers/memoryqosv2/memoryqosv2_linux.go:58 — pkg/agent/events/handlers/memoryqosv2/memoryqosv2_linux.go:58-68 | pkg/agent/events/handlers/networkqos/networkqos_linux.go:56-67 — 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) REDACTED:92 — REDACTED:92-102 | pkg/controllers/job/plugins/distributed-framework/pytorch/pytorch.go:293-305 — 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) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:334 — pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:334-351 | pkg/webhooks/router/queue_reference.go:45-55 — 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) REDACTED:1025 — REDACTED:1025-1035 | pkg/scheduler/plugins/drf/drf.go:148-158 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×6
  • Duplicated block (14 lines × 2) cmd/agent-scheduler/main.go:45 — cmd/agent-scheduler/main.go:45-58 | cmd/scheduler/main.go:47-60 — `cmd/agent-scheduler/main.go` and `cmd/scheduler/main.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 2 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (14 lines × 2) pkg/cli/job/run.go:101 — pkg/cli/job/run.go:101-114 | pkg/cli/vsub/run.go:151-164 — 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 `pkg/cli/job/run.go:101` 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 lines × 2) pkg/cli/job/suspend.go:48 — pkg/cli/job/suspend.go:48-61 | pkg/cli/vsuspend/suspend.go:48-61 — `pkg/cli/job/suspend.go` and `pkg/cli/vsuspend/suspend.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 1 separate duplicated blocks between them, totalling at least 14 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 (14 lines × 2) pkg/cli/jobflow/create.go:59 — pkg/cli/jobflow/create.go:59-72 | pkg/cli/jobtemplate/create.go:59-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/cli/jobflow/create.go:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:64 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:64-77 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:64-77 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 (14 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:212 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:212-225 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:215-228 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 `pkg/scheduler/actions/gangpreempt/gangpreempt.go:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×5
  • Edited copy of a member (24 corresponding lines) pkg/agentscheduler/cache/cache.go:891 — pkg/agentscheduler/cache/cache.go:891-914 | pkg/scheduler/cache/cache.go:1560-1585 — 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) pkg/scheduler/api/devices/util.go:124 — pkg/scheduler/api/devices/util.go:124-147 | pkg/scheduler/api/devices/util.go:185-208 — 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) pkg/scheduler/framework/session_plugins.go:707 — pkg/scheduler/framework/session_plugins.go:707-730 | pkg/scheduler/framework/session_plugins.go:793-816 — 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) pkg/scheduler/plugins/capacity/capacity.go:356 — pkg/scheduler/plugins/capacity/capacity.go:356-379 | pkg/scheduler/plugins/capacity/capacity.go:392-415 — 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) pkg/scheduler/api/test_utils.go:48 — pkg/scheduler/api/test_utils.go:48-71 | pkg/scheduler/util/test_utils.go:70-96 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×5
  • Edited copy of a member (14 corresponding lines) pkg/cli/queue/get.go:89 — pkg/cli/queue/get.go:89-102 | pkg/cli/queue/list.go:120-137 — 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) pkg/cli/job/list.go:180 — pkg/cli/job/list.go:180-193 | pkg/cli/vjobs/view.go:375-388 — 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) pkg/scheduler/uthelper/helper.go:340 — pkg/scheduler/uthelper/helper.go:340-354 | pkg/scheduler/uthelper/helper.go:357-370 — 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) pkg/controllers/colocationconfig/colocation_config_controller_handler.go:37 — pkg/controllers/colocationconfig/colocation_config_controller_handler.go:37-50 | pkg/controllers/colocationconfig/colocation_config_controller_handler.go:88-101 — 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) pkg/controllers/sharding/node_events.go:86 — pkg/controllers/sharding/node_events.go:86-99 | pkg/controllers/sharding/pod_events.go:107-122 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×5
  • Edited copy of a member (17 corresponding lines) REDACTED:827 — REDACTED:827-843 | REDACTED:329-345 — 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) pkg/scheduler/api/job_info.go:657 — pkg/scheduler/api/job_info.go:657-675 | pkg/scheduler/api/pod_info.go:205-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) pkg/scheduler/plugins/capacity/capacity.go:1664 — pkg/scheduler/plugins/capacity/capacity.go:1664-1680 | pkg/scheduler/plugins/capacity/capacity.go:1683-1699 — 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) pkg/controllers/cronjob/cronjob_controller_handler.go:85 — pkg/controllers/cronjob/cronjob_controller_handler.go:85-103 | pkg/controllers/hypernode/discovery/label/label.go:414-430 — 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) pkg/scheduler/plugins/usage/usage.go:218 — pkg/scheduler/plugins/usage/usage.go:218-234 | pkg/scheduler/plugins/usage/usage.go:236-252 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×5
  • Duplicated block (18 lines × 2) pkg/cli/job/view.go:240 — pkg/cli/job/view.go:240-257 | pkg/cli/vjobs/view.go:273-290 — `pkg/cli/job/view.go` and `pkg/cli/vjobs/view.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 5 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. 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) pkg/controllers/cache/cache.go:240 — pkg/controllers/cache/cache.go:240-257 | pkg/controllers/cache/cache.go:263-280 — both copies are in the same file, so extract the 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 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 (18 lines × 2) pkg/controllers/job/job_controller_util.go:244 — pkg/controllers/job/job_controller_util.go:244-261 | pkg/controllers/job/job_controller_util.go:274-291 — both copies are in the same file, so extract the 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 `pkg/controllers/job/job_controller_util.go:244` 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) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:155 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:155-172 | pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:184-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:155` 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) pkg/controllers/sharding/policy/arguments.go:66 — pkg/controllers/sharding/policy/arguments.go:66-83 | pkg/scheduler/framework/arguments.go:111-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) pkg/agentscheduler/actions/allocate/allocate.go:278 — pkg/agentscheduler/actions/allocate/allocate.go:278-294 | REDACTED:675-691 — 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) pkg/agentscheduler/cache/cache.go:602 — pkg/agentscheduler/cache/cache.go:602-618 | pkg/scheduler/cache/cache.go:1021-1037 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 (17 lines × 2) pkg/agentscheduler/cache/dumper.go:102 — pkg/agentscheduler/cache/dumper.go:102-118 | pkg/scheduler/cache/dumper.go:130-146 — before extracting anything, compare `pkg/agentscheduler/cache/dumper.go` and `pkg/scheduler/cache/dumper.go` 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. 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 (17 lines × 2) pkg/controllers/job/job_controller_handler.go:250 — pkg/controllers/job/job_controller_handler.go:250-266 | pkg/controllers/job/job_controller_handler.go:361-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/job/job_controller_handler.go:250` 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) REDACTED:131 — REDACTED:131-147 | REDACTED:164-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) pkg/controllers/queue/state/closing.go:36 — pkg/controllers/queue/state/closing.go:36-44 | pkg/controllers/queue/state/open.go:36-44 | pkg/controllers/queue/state/unknown.go:36-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/queue/state/closing.go: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 (9 lines × 3) pkg/scheduler/api/devices/util.go:230 — pkg/scheduler/api/devices/util.go:230-238 | pkg/scheduler/api/devices/util.go:243-251 | pkg/scheduler/api/devices/util.go:260-268 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/scheduler/api/devices/util.go:241` calls `ResourceName` and `pkg/scheduler/api/devices/util.go:228` 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 × 3) pkg/agent/events/handlers/cpuqos/cpuqos_linux.go:46 — pkg/agent/events/handlers/cpuqos/cpuqos_linux.go:46-54 | pkg/agent/events/handlers/cputhrottle/cpu_throttling.go:58-66 | pkg/agent/events/handlers/memoryqos/memoryqos_linux.go:47-55 — 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 `pkg/agent/events/handlers/cputhrottle/cpu_throttling.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 (9 lines × 3) pkg/controllers/garbagecollector/garbagecollector.go:102 — pkg/controllers/garbagecollector/garbagecollector.go:102-110 | pkg/controllers/namespacequeue/namespacequeue_controller.go:190-199 | pkg/controllers/queue/queue_controller.go:183-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/garbagecollector/garbagecollector.go:102` 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, `pkg/controllers/queue/queue_controller.go:194` calls `Until` and `pkg/controllers/namespacequeue/namespacequeue_controller.go:201` 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 lines × 3) pkg/controllers/jobflow/jobflow_controller.go:212 — pkg/controllers/jobflow/jobflow_controller.go:212-220 | pkg/controllers/jobtemplate/jobtemplate_controller.go:195-203 | pkg/controllers/queue/queue_controller.go:254-262 — `pkg/controllers/jobflow/jobflow_controller.go` and `pkg/controllers/jobtemplate/jobtemplate_controller.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 53 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 `pkg/controllers/jobflow/jobflow_controller.go:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×5
  • Duplicated block (7 lines × 3) cmd/agent-scheduler/app/options/options.go:86 — cmd/agent-scheduler/app/options/options.go:86-92 | cmd/controller-manager/app/options/options.go:111-117 | cmd/scheduler/app/options/options.go:175-181 — 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) cmd/agent-scheduler/app/server.go:87 — cmd/agent-scheduler/app/server.go:87-93 | cmd/controller-manager/app/server.go:87-93 | cmd/scheduler/app/server.go:105-111 — before extracting anything, compare `cmd/agent-scheduler/app/server.go` and `cmd/controller-manager/app/server.go` 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 (7 lines × 3) pkg/agentscheduler/cache/dumper.go:91 — pkg/agentscheduler/cache/dumper.go:91-97 | pkg/scheduler/cache/dumper.go:100-106 | pkg/scheduler/cache/dumper.go:108-114 — before extracting anything, compare `pkg/agentscheduler/cache/dumper.go` and `pkg/scheduler/cache/dumper.go` 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. 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) REDACTED:143 — REDACTED:143-149 | REDACTED:113-119 | REDACTED: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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) pkg/webhooks/admission/queues/validate/validate_queue.go:677 — pkg/webhooks/admission/queues/validate/validate_queue.go:677-683 | pkg/webhooks/admission/queues/validate/validate_queue.go:692-698 | pkg/webhooks/admission/queues/validate/validate_queue.go:745-751 — 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 `pkg/webhooks/admission/queues/validate/validate_queue.go:677` 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×4
  • FunctionTooLong: pod.CalculateExtendResourcesV2 pkg/agent/utils/pod/resources.go:156 — FunctionTooLong — CalculateExtendResourcesV2 runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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: framework.openSession REDACTED:184 — FunctionTooLong — openSession runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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: pod.printPod pkg/cli/pod/pod.go:360 — FunctionTooLong — printPod runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: vgpu.checkNodeGPUSharingPredicateAndScore REDACTED:379 — FunctionTooLong — checkNodeGPUSharingPredicateAndScore runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.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.
D35 · Change Coupling · Change coupling · ×4
  • Change coupling: session_plugins.go ↔ defaults.go pkg/scheduler/framework/session_plugins.go:1 — `pkg/scheduler/framework/session_plugins.go` and `pkg/scheduler/plugins/defaults.go` 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 — 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 `a33af068` adapt latest api changes from PodBunch to SubGroup; `816e5d28` allocate action adaptation for podBunch networkTopology scheduling; `ba7df254` Add network-topology-aware plugin and hyperNode score callback — run `git show` on any of them.
  • Change coupling: REDACTED ↔ defaults.go REDACTED:1 — `REDACTED` and `pkg/scheduler/plugins/defaults.go` change together 61% of the time (11 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 11 shared commits counted here, the most recent 3 are `a33af068` adapt latest api changes from PodBunch to SubGroup; `816e5d28` allocate action adaptation for podBunch networkTopology scheduling; `ba7df254` Add network-topology-aware plugin and hyperNode score callback — run `git show` on any of them.
  • Change coupling: REDACTED ↔ factory.go REDACTED:1 — `REDACTED` and `pkg/controllers/job/plugins/factory.go` 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 — 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 `e07ce437` add hcclrank job plugin; `197e284f` Add tensorflow plugins; `5ecbd079` updated with proper decsriptions — run `git show` on any of them.
  • Change coupling: cache_mock.go ↔ event_handlers.go pkg/scheduler/cache/cache_mock.go:1 — `pkg/scheduler/cache/cache_mock.go` and `pkg/scheduler/cache/event_handlers.go` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `36ee3c1d` cache: recover from PVC-informer race in addPod; `a8edb8f0` scheduler: adapt cache and plugins for Kubernetes 1.36; `6275b05c` scheduler: support DRA queue quota accounting — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×4
  • Edited copy of a member (16 corresponding lines) pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:99 — pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:99-114 | pkg/scheduler/api/devices/nvidia/vgpu/metrics.go:116-138 — 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) pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:66 — pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:66-81 | pkg/controllers/job/plugins/distributed-framework/tensorflow/tensorflow.go:59-76 — 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) REDACTED:195 — REDACTED:195-210 | REDACTED:213-228 — 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) pkg/scheduler/plugins/capacity/capacity.go:1877 — pkg/scheduler/plugins/capacity/capacity.go:1877-1893 | pkg/scheduler/plugins/proportion/proportion.go:583-598 — 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.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) pkg/agent/utils/testing/pod.go:64 — pkg/agent/utils/testing/pod.go:64-84 | pkg/agent/utils/testing/pod.go:86-106 — 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) pkg/agentscheduler/cache/cache.go:939 — pkg/agentscheduler/cache/cache.go:939-959 | pkg/scheduler/cache/cache.go:1609-1629 — 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) pkg/agentscheduler/framework/plugins.go:201 — pkg/agentscheduler/framework/plugins.go:201-221 | pkg/scheduler/framework/session_plugins.go:1138-1158 — 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) pkg/cli/jobflow/get.go:52 — pkg/cli/jobflow/get.go:52-72 | pkg/cli/jobtemplate/get.go:52-72 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×4
  • Edited copy of a member (15 corresponding lines) pkg/scheduler/api/job_info.go:1294 — pkg/scheduler/api/job_info.go:1294-1308 | pkg/scheduler/api/job_info.go:1310-1330 — 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) pkg/scheduler/api/shared_device_pool.go:124 — pkg/scheduler/api/shared_device_pool.go:124-139 | pkg/scheduler/api/shared_device_pool.go:155-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) cmd/network-qos/tools/root.go:34 — cmd/network-qos/tools/root.go:34-49 | cmd/network-qos/cni/cni.go:38-52 — 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) pkg/scheduler/framework/session_plugins.go:577 — pkg/scheduler/framework/session_plugins.go:577-592 | pkg/scheduler/framework/session_plugins.go:819-833 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) pkg/cli/queue/create.go:43 — pkg/cli/queue/create.go:43-50 | pkg/cli/queue/operate.go:56-63 — 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) pkg/agentscheduler/cache/event_handlers.go:514 — pkg/agentscheduler/cache/event_handlers.go:514-521 | pkg/scheduler/cache/event_handlers.go:1804-1811 — 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) pkg/controllers/hypernode/configmap_handler.go:108 — pkg/controllers/hypernode/configmap_handler.go:108-115 | pkg/controllers/hypernode/hypernode_handler.go:53-60 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/controllers/sharding/test_utils.go:197 — pkg/controllers/sharding/test_utils.go:197-208 | pkg/controllers/sharding/test_utils.go:210-217 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×4
  • Edited copy of a member (12 corresponding lines) pkg/scheduler/cache/cache.go:1916 — pkg/scheduler/cache/cache.go:1916-1927 | REDACTED:1001-1012 — 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) pkg/agentscheduler/cache/event_handlers.go:213 — pkg/agentscheduler/cache/event_handlers.go:213-224 | pkg/agentscheduler/cache/event_handlers.go:226-242 — 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) pkg/controllers/garbagecollector/garbagecollector.go:161 — pkg/controllers/garbagecollector/garbagecollector.go:161-172 | pkg/controllers/queue/queue_controller.go:209-220 — 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) pkg/scheduler/api/test_utils.go:35 — pkg/scheduler/api/test_utils.go:35-46 | pkg/scheduler/util/test_utils.go:43-55 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) cmd/agent-scheduler/app/options/options.go:150 — cmd/agent-scheduler/app/options/options.go:150-169 | cmd/controller-manager/app/options/options.go:181-200 | cmd/scheduler/app/options/options.go:249-268 | cmd/webhook-manager/app/options/options.go:135-153 — 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) pkg/agentscheduler/cache/cache.go:405 — pkg/agentscheduler/cache/cache.go:405-560 | pkg/agentscheduler/cache/cache_mock.go:126-156 | pkg/scheduler/cache/cache.go:685-944 | pkg/scheduler/cache/cache_mock.go:169-207 — 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) pkg/webhooks/schema/schema.go:53 — pkg/webhooks/schema/schema.go:53-71 | pkg/webhooks/schema/schema.go:73-91 | pkg/webhooks/schema/schema.go:93-111 | pkg/webhooks/schema/schema.go:198-216 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) pkg/agentscheduler/cache/cache.go:621 — pkg/agentscheduler/cache/cache.go:621-655 | pkg/scheduler/cache/cache.go:1108-1140 — 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) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:80 — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:80-112 | pkg/webhooks/admission/jobs/validate/admit_job.go:86-118 — 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) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_info.go:91 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_info.go:91-123 | pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_info.go:126-162 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) REDACTED:736 — REDACTED:736-772 | REDACTED:775-825 — 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) pkg/scheduler/uthelper/helper.go:261 — pkg/scheduler/uthelper/helper.go:261-297 | pkg/scheduler/uthelper/helper.go:300-338 — 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) pkg/scheduler/api/resource_info.go:636 — pkg/scheduler/api/resource_info.go:636-672 | pkg/scheduler/api/resource_info.go:777-813 — 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 (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) pkg/controllers/queue/queue_controller_action.go:115 — pkg/controllers/queue/queue_controller_action.go:115-143 | pkg/controllers/queue/queue_controller_action.go:145-173 — 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) pkg/scheduler/framework/session_plugins.go:461 — pkg/scheduler/framework/session_plugins.go:461-493 | pkg/scheduler/framework/session_plugins.go:518-546 — 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) pkg/controllers/jobflow/jobflow_controller.go:50 — pkg/controllers/jobflow/jobflow_controller.go:50-83 | pkg/controllers/jobtemplate/jobtemplate_controller.go:49-77 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) pkg/scheduler/api/devices/ascend/hami/device_info.go:178 — pkg/scheduler/api/devices/ascend/hami/device_info.go:178-205 | pkg/scheduler/api/devices/ascend/hami/device_info.go:222-249 — 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) pkg/scheduler/api/resource_info.go:681 — pkg/scheduler/api/resource_info.go:681-708 | pkg/scheduler/api/resource_info.go:854-885 — 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) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:355 — pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:355-383 | pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:400-427 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×3
  • Edited copy of a member (23 corresponding lines) pkg/cli/job/view.go:64 — pkg/cli/job/view.go:64-86 | pkg/cli/vjobs/view.go:105-127 — 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) pkg/scheduler/api/job_info.go:1222 — pkg/scheduler/api/job_info.go:1222-1252 | pkg/scheduler/api/job_info.go:1255-1277 — 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) pkg/scheduler/plugins/binpack/binpack.go:59 — pkg/scheduler/plugins/binpack/binpack.go:59-81 | pkg/scheduler/plugins/resource-strategy-fit/sra.go:37-59 — 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 (10 corresponding lines) · ×3
  • Edited copy of a member (10 corresponding lines) REDACTED:212 — REDACTED:212-221 | REDACTED:223-232 — 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) pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:94 — pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:94-108 | pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:110-119 — 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) pkg/agentscheduler/cache/cache.go:307 — pkg/agentscheduler/cache/cache.go:307-316 | pkg/scheduler/cache/cache.go:489-498 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×3
  • Edited copy of a member (7 corresponding lines) pkg/agentscheduler/cache/event_handlers.go:506 — pkg/agentscheduler/cache/event_handlers.go:506-512 | pkg/scheduler/cache/event_handlers.go:1796-1802 — 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) pkg/scheduler/plugins/capacity/capacity.go:132 — pkg/scheduler/plugins/capacity/capacity.go:132-141 | pkg/scheduler/util/test_utils.go:756-762 — 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) pkg/controllers/job/job_controller_util.go:300 — pkg/controllers/job/job_controller_util.go:300-306 | pkg/webhooks/admission/jobs/validate/util.go:125-132 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) pkg/agentscheduler/cache/cache.go:259 — pkg/agentscheduler/cache/cache.go:259-280 | pkg/scheduler/cache/cache.go:338-359 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/scheduler/cache/cache.go:361` calls `podNominatedNodeNameNeedUpdate` and `pkg/agentscheduler/cache/cache.go:283` 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 (22 lines × 2) pkg/scheduler/api/job_info.go:630 — pkg/scheduler/api/job_info.go:630-651 | pkg/scheduler/api/pod_info.go:178-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.
  • Duplicated block (22 lines × 2) pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:81 — pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:81-102 | pkg/webhooks/admission/queues/mutate/mutate_queue.go:79-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) REDACTED:1050 — REDACTED:1050-1062 | REDACTED:86-97 — 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 after the matched lines, `REDACTED:1066` calls `NeedContinueAllocating` and `REDACTED:98` 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) REDACTED:186 — REDACTED:186-197 | REDACTED:293-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 `REDACTED:186` 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–13 lines × 2) pkg/scheduler/plugins/capacity/capacity.go:843 — pkg/scheduler/plugins/capacity/capacity.go:843-855 | pkg/scheduler/plugins/capacity/capacity.go:874-885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) pkg/controllers/job/plugins/distributed-framework/hcclrank/hcclrank.go:60 — pkg/controllers/job/plugins/distributed-framework/hcclrank/hcclrank.go:60-65 | pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:67-72 | pkg/controllers/job/plugins/distributed-framework/pytorch/pytorch.go:89-94 — 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, `pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:73` calls `IntVar` and `pkg/controllers/job/plugins/distributed-framework/hcclrank/hcclrank.go:66` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) pkg/cli/vcancel/cancel.go:41 — pkg/cli/vcancel/cancel.go:41-46 | pkg/cli/vresume/resume.go:39-44 | pkg/cli/vsuspend/suspend.go:39-44 — 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) pkg/controllers/podgroup/pg_controller_handler.go:223 — pkg/controllers/podgroup/pg_controller_handler.go:223-228 | pkg/controllers/podgroup/pg_controller_handler.go:230-235 | pkg/controllers/podgroup/pg_controller_handler.go:237-242 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D1 · Cyclomatic Complexity · Action.selectDomainBundles (cyclomatic 20) · ×2
  • Action.selectDomainBundles (cyclomatic 20) pkg/scheduler/actions/gangpreempt/gangpreempt.go:189 — Action.selectDomainBundles 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.
  • Action.selectDomainBundles (cyclomatic 20) pkg/scheduler/actions/gangreclaim/gangreclaim.go:194 — Action.selectDomainBundles has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.Execute (cyclomatic 16) · ×2
  • Action.Execute (cyclomatic 16) REDACTED:60 — Action.Execute 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.
  • Action.Execute (cyclomatic 16) pkg/scheduler/actions/gangreclaim/gangreclaim.go:79 — Action.Execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · Action.selectDomainBundles (cognitive 29) · ×2
  • Action.selectDomainBundles (cognitive 29) pkg/scheduler/actions/gangpreempt/gangpreempt.go:189 — Action.selectDomainBundles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (6 pts), boolean chains 5 (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.
  • Action.selectDomainBundles (cognitive 29) pkg/scheduler/actions/gangreclaim/gangreclaim.go:194 — Action.selectDomainBundles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchedulerCache.Bind (cognitive 17) · ×2
  • SchedulerCache.Bind (cognitive 17) pkg/agentscheduler/cache/cache.go:621 — SchedulerCache.Bind has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts) (nesting depth added 8). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • SchedulerCache.Bind (cognitive 17) pkg/scheduler/cache/cache.go:1108 — SchedulerCache.Bind has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) cmd/agent-scheduler/app/options/options.go:83 — cmd/agent-scheduler/app/options/options.go:83-125 | cmd/scheduler/app/options/options.go:172-227 — 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) pkg/scheduler/api/pod_info.go:82 — pkg/scheduler/api/pod_info.go:82-129 | pkg/scheduler/api/pod_info.go:131-173 — 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 copy of a member (66 corresponding lines) · ×2
  • Edited copy of a member (66 corresponding lines) REDACTED:151 — REDACTED:151-216 | REDACTED:258-327 — 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.
  • Edited copy of a member (66 corresponding lines) pkg/controllers/job/job_controller_handler.go:151 — pkg/controllers/job/job_controller_handler.go:151-216 | pkg/controllers/job/job_controller_handler.go:337-412 — 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 copy of a member (48 corresponding lines) · ×2
  • Edited copy of a member (48 corresponding lines) cmd/agent-scheduler/main.go:44 — cmd/agent-scheduler/main.go:44-91 | cmd/scheduler/main.go:46-93 — 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) pkg/scheduler/plugins/binpack/binpack.go:94 — pkg/scheduler/plugins/binpack/binpack.go:94-158 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:169-216 — 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 (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) pkg/controllers/job/plugins/svc/svc.go:219 — pkg/controllers/job/plugins/svc/svc.go:219-254 | pkg/controllers/job/plugins/svc/svc.go:257-303 — 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) pkg/controllers/apis/job_info.go:125 — pkg/controllers/apis/job_info.go:125-160 | pkg/controllers/apis/job_info.go:163-201 — 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 (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) pkg/cli/jobflow/create.go:51 — pkg/cli/jobflow/create.go:51-92 | pkg/cli/jobtemplate/create.go:51-93 — 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) pkg/scheduler/api/cluster_info.go:48 — pkg/scheduler/api/cluster_info.go:48-92 | pkg/scheduler/cache/cache.go:1749-1790 — 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, 25+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 25+ corresponding lines) pkg/cli/queue/util.go:34 — pkg/cli/queue/util.go:34-59 | pkg/cli/util/util.go:94-118 | pkg/cli/util/util.go:121-147 — 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.
  • Edited copies of one member (3 members, 25+ corresponding lines) pkg/controllers/jobflow/jobflow_controller.go:179 — pkg/controllers/jobflow/jobflow_controller.go:179-208 | pkg/controllers/jobtemplate/jobtemplate_controller.go:167-191 | pkg/controllers/queue/queue_controller.go:222-250 — 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 copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) pkg/scheduler/framework/util.go:66 — pkg/scheduler/framework/util.go:66-95 | pkg/scheduler/framework/util.go:98-122 — 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) pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:189 — pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:189-214 | pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:247-271 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:152 — pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:152-178 | pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:181-207 — 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) REDACTED:225 — REDACTED:225-255 | REDACTED:348-374 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) pkg/controllers/cache/cache.go:239 — pkg/controllers/cache/cache.go:239-260 | pkg/controllers/cache/cache.go:262-288 — 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) pkg/scheduler/cache/event_handlers.go:1364 — pkg/scheduler/cache/event_handlers.go:1364-1385 | pkg/scheduler/cache/event_handlers.go:1628-1650 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 19+ corresponding lines) pkg/webhooks/schema/schema.go:114 — pkg/webhooks/schema/schema.go:114-132 | pkg/webhooks/schema/schema.go:135-153 | pkg/webhooks/schema/schema.go:156-174 | pkg/webhooks/schema/schema.go:177-195 — 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.
  • Edited copies of one member (4 members, 19+ corresponding lines) pkg/cli/jobflow/list.go:65 — pkg/cli/jobflow/list.go:65-87 | pkg/cli/jobtemplate/list.go:56-74 | pkg/cli/vjobs/view.go:302-323 | pkg/cli/vqueues/get.go:73-92 — 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 (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) REDACTED:89 — REDACTED:89-109 | REDACTED:111-128 | REDACTED:130-147 — 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) pkg/scheduler/framework/session_plugins.go:735 — pkg/scheduler/framework/session_plugins.go:735-752 | pkg/scheduler/framework/session_plugins.go:836-853 | pkg/scheduler/framework/session_plugins.go:1017-1034 — 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 copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) pkg/cli/jobflow/delete.go:50 — pkg/cli/jobflow/delete.go:50-55 | pkg/cli/jobflow/describe.go:49-54 — 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) pkg/cli/jobtemplate/delete.go:50 — pkg/cli/jobtemplate/delete.go:50-55 | pkg/cli/jobtemplate/describe.go:49-54 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) pkg/agentscheduler/scheduler.go:282 — pkg/agentscheduler/scheduler.go:282-307 | pkg/scheduler/scheduler.go:229-254 — 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 (26 lines × 2) pkg/cli/job/view.go:211 — pkg/cli/job/view.go:211-236 | pkg/cli/vjobs/view.go:244-269 — `pkg/cli/job/view.go` and `pkg/cli/vjobs/view.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 5 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) pkg/agentscheduler/cache/cache.go:865 — pkg/agentscheduler/cache/cache.go:865-888 | pkg/scheduler/cache/cache.go:1534-1557 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 (24 lines × 2) pkg/cli/job/run.go:139 — pkg/cli/job/run.go:139-162 | pkg/cli/vsub/run.go:176-199 — 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 `pkg/cli/job/run.go: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) cmd/agent-scheduler/app/server.go:71 — cmd/agent-scheduler/app/server.go:71-93 | cmd/scheduler/app/server.go:89-111 — before extracting anything, compare `cmd/agent-scheduler/app/server.go` and `cmd/scheduler/app/server.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/agent-scheduler/app/server.go: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 (23 lines × 2) pkg/agentscheduler/cache/event_handlers.go:264 — pkg/agentscheduler/cache/event_handlers.go:264-286 | pkg/scheduler/cache/event_handlers.go:642-664 — before extracting anything, compare `pkg/agentscheduler/cache/event_handlers.go` and `pkg/scheduler/cache/event_handlers.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 114 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.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) pkg/agentscheduler/cache/cache.go:803 — pkg/agentscheduler/cache/cache.go:803-822 | pkg/scheduler/cache/cache.go:1443-1462 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 (20 lines × 2) pkg/controllers/jobflow/jobflow_controller.go:158 — pkg/controllers/jobflow/jobflow_controller.go:158-177 | pkg/controllers/jobtemplate/jobtemplate_controller.go:146-165 — `pkg/controllers/jobflow/jobflow_controller.go` and `pkg/controllers/jobtemplate/jobtemplate_controller.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 53 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. 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) pkg/cli/jobflow/get.go:94 — pkg/cli/jobflow/get.go:94-106 | pkg/cli/jobflow/list.go:93-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.
  • Duplicated block (11–13 lines × 2) pkg/scheduler/plugins/predicates/predicates.go:233 — pkg/scheduler/plugins/predicates/predicates.go:233-245 | pkg/scheduler/plugins/predicates/predicates.go:827-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) pkg/cli/job/list.go:181 — pkg/cli/job/list.go:181-190 | pkg/cli/jobtemplate/list.go:100-110 | pkg/cli/vjobs/view.go:376-385 — before extracting anything, compare `pkg/cli/job/list.go` and `pkg/cli/vjobs/view.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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–11 lines × 3) pkg/controllers/apis/job_info.go:126 — pkg/controllers/apis/job_info.go:126-136 | pkg/controllers/apis/job_info.go:164-173 | pkg/controllers/apis/job_info.go:205-214 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) pkg/webhooks/schema/schema.go:58 — pkg/webhooks/schema/schema.go:58-66 | pkg/webhooks/schema/schema.go:78-86 | pkg/webhooks/schema/schema.go:98-106 | pkg/webhooks/schema/schema.go:203-211 — 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. 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) pkg/scheduler/plugins/capacity/capacity.go:949 — pkg/scheduler/plugins/capacity/capacity.go:949-957 | pkg/scheduler/plugins/capacity/capacity.go:987-995 | pkg/scheduler/plugins/proportion/proportion.go:504-512 | pkg/scheduler/plugins/proportion/proportion.go:525-533 — 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 `pkg/scheduler/plugins/capacity/capacity.go:949` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) pkg/agentscheduler/cache/cache.go:229 — pkg/agentscheduler/cache/cache.go:229-237 | pkg/scheduler/cache/cache.go:254-261 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 `pkg/agentscheduler/cache/cache.go:229` 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 (8–9 lines × 2) pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:100 — pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:100-108 | pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:112-119 — both copies are in the same file, so extract the 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 `pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) pkg/controllers/cronjob/cronjob_controller.go:132 — pkg/controllers/cronjob/cronjob_controller.go:132-139 | pkg/controllers/garbagecollector/garbagecollector.go:102-110 | pkg/controllers/queue/queue_controller.go:183-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/cronjob/cronjob_controller.go:132` 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, `pkg/controllers/garbagecollector/garbagecollector.go:97` calls `ShutDown`, `Infof` and `pkg/controllers/cronjob/cronjob_controller.go:131` 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) pkg/scheduler/plugins/capacity/capacity.go:1197 — pkg/scheduler/plugins/capacity/capacity.go:1197-1204 | pkg/scheduler/plugins/capacity/capacity.go:1369-1376 | pkg/scheduler/plugins/proportion/proportion.go:273-280 — 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 `pkg/scheduler/plugins/capacity/capacity.go:1197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:191 — pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:191-197 | pkg/controllers/job/plugins/distributed-framework/pytorch/pytorch.go:367-373 | pkg/controllers/job/plugins/distributed-framework/tensorflow/tensorflow.go:132-140 | pkg/controllers/job/plugins/env/env.go:61-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 (7 lines × 4) pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:199 — pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:199-205 | pkg/controllers/job/plugins/distributed-framework/pytorch/pytorch.go:375-381 | pkg/controllers/job/plugins/distributed-framework/tensorflow/tensorflow.go:142-148 | pkg/controllers/job/plugins/env/env.go:71-77 — 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.
X2 · Cancellation propagation · Function without context.Context · ×2
  • Function without context.Context: send pkg/scheduler/plugins/extender/extender.go:354 — `send` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: fetchUFMData REDACTED:228 — `fetchUFMData` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
X28 · Index access outside its own emptiness guard · Index access outside its own emptiness guard · ×2
  • Index access outside its own emptiness guard pkg/scheduler/cache/util.go:148 — `index` is the result of a search that answers -1 when nothing is found, and `mySchedulerPodName[0:index]` uses it as a bound with no test of `index` in between. When the search misses, the bound is -1 and the access panics with `slice bounds out of range`. Test `index < 0` (or use `strings.Cut`) before using it.
  • Index access outside its own emptiness guard REDACTED:658 — `%len(potentialNodes)` divides by the length of `potentialNodes`, and nothing before it checks that `potentialNodes` is non-empty. An empty `potentialNodes` makes this an integer division by zero, which panics. Test `len(potentialNodes) == 0` first and return early.
AX2 · Stateful singletons · Stateful package · ×1
  • Stateful package: main REDACTED:46 — Package `main` serves requests (net/http handlers run on a goroutine per request, and every one sees the same package variables and captured values) but writes that shared state outside any lock (snapshot; e.g. `snapshot` in `onSessionOpen` at line 46). Unsynchronised concurrent writes are a data race in Go: an update is lost or a value tears, and a concurrent map write aborts the process.
D1 · Cyclomatic Complexity · capacityPlugin.OnSessionOpen (cyclomatic 139) · ×1
  • capacityPlugin.OnSessionOpen (cyclomatic 139) pkg/scheduler/plugins/capacity/capacity.go:442 — capacityPlugin.OnSessionOpen has cyclomatic complexity 139 (threshold 15). Most of this is not in the body itself: 3 of the 139 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 466, 788, 655, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · proportionPlugin.OnSessionOpen (cyclomatic 66) · ×1
  • proportionPlugin.OnSessionOpen (cyclomatic 66) pkg/scheduler/plugins/proportion/proportion.go:91 — proportionPlugin.OnSessionOpen has cyclomatic complexity 66 (threshold 15). Of this number, 33 points are the body's own statements and 33 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deviceSharePlugin.wrapGPUDevicesForExclusivity (cyclomatic 54) · ×1
  • deviceSharePlugin.wrapGPUDevicesForExclusivity (cyclomatic 54) pkg/scheduler/plugins/deviceshare/gpuexclusive.go:431 — deviceSharePlugin.wrapGPUDevicesForExclusivity has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pod.printPod (cyclomatic 50) · ×1
  • pod.printPod (cyclomatic 50) pkg/cli/pod/pod.go:360 — pod.printPod has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · capacityPlugin.buildHierarchicalQueueAttrs (cyclomatic 48) · ×1
  • capacityPlugin.buildHierarchicalQueueAttrs (cyclomatic 48) pkg/scheduler/plugins/capacity/capacity.go:1210 — capacityPlugin.buildHierarchicalQueueAttrs has cyclomatic complexity 48 (threshold 15). Of this number, 37 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · jobcontroller.syncJob (cyclomatic 47) · ×1
  • jobcontroller.syncJob (cyclomatic 47) pkg/controllers/job/job_controller_actions.go:394 — jobcontroller.syncJob has cyclomatic complexity 47 (threshold 15). Of this number, 40 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · jobcontroller.killPods (cyclomatic 44) · ×1
  • jobcontroller.killPods (cyclomatic 44) pkg/controllers/job/job_controller_actions.go:110 — jobcontroller.killPods has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.Execute (cyclomatic 42) · ×1
  • Action.Execute (cyclomatic 42) REDACTED:101 — Action.Execute has cyclomatic complexity 42 (threshold 15). Of this number, 32 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.
D1 · Cyclomatic Complexity · Action.allocateResourcesForTasks (cyclomatic 41) · ×1
  • Action.allocateResourcesForTasks (cyclomatic 41) REDACTED:933 — Action.allocateResourcesForTasks has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredicatesPlugin.OnSessionOpen (cyclomatic 39) · ×1
  • PredicatesPlugin.OnSessionOpen (cyclomatic 39) pkg/scheduler/plugins/predicates/predicates.go:206 — PredicatesPlugin.OnSessionOpen has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 7 of the 39 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 385, 230, 332, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · featureGate.Enabled (cyclomatic 38) · ×1
  • featureGate.Enabled (cyclomatic 38) pkg/agent/features/feature_gate.go:48 — featureGate.Enabled has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · drfPlugin.OnSessionOpen (cyclomatic 37) · ×1
  • drfPlugin.OnSessionOpen (cyclomatic 37) pkg/scheduler/plugins/drf/drf.go:186 — drfPlugin.OnSessionOpen has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 280, 222, 392, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · fairSharePlugin.OnSessionOpen (cyclomatic 36) · ×1
  • fairSharePlugin.OnSessionOpen (cyclomatic 36) pkg/scheduler/plugins/fairshare/fairshare.go:236 — fairSharePlugin.OnSessionOpen has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extenderPlugin.OnSessionOpen (cyclomatic 34) · ×1
  • extenderPlugin.OnSessionOpen (cyclomatic 34) pkg/scheduler/plugins/extender/extender.go:173 — extenderPlugin.OnSessionOpen has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 191, 220, 244, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · utils.CreateJobBundles (cyclomatic 33) · ×1
  • utils.CreateJobBundles (cyclomatic 33) pkg/scheduler/actions/utils/bundle.go:53 — utils.CreateJobBundles 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.
D1 · Cyclomatic Complexity · vgpu.checkNodeGPUSharingPredicateAndScore (cyclomatic 33) · ×1
  • vgpu.checkNodeGPUSharingPredicateAndScore (cyclomatic 33) REDACTED:379 — vgpu.checkNodeGPUSharingPredicateAndScore has cyclomatic complexity 33 (threshold 15). Of this number, 28 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.
D1 · Cyclomatic Complexity · job.applyPolicies (cyclomatic 32) · ×1
  • job.applyPolicies (cyclomatic 32) pkg/controllers/job/job_controller_util.go:190 — job.applyPolicies has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · jobcontroller.updatePod (cyclomatic 30) · ×1
  • jobcontroller.updatePod (cyclomatic 30) pkg/controllers/job/job_controller_handler.go:218 — jobcontroller.updatePod has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SchedulerCache.addEventHandler (cyclomatic 30) · ×1
  • SchedulerCache.addEventHandler (cyclomatic 30) pkg/scheduler/cache/cache.go:685 — SchedulerCache.addEventHandler has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HyperNodesInfo.UpdateHyperNode (cyclomatic 29) · ×1
  • HyperNodesInfo.UpdateHyperNode (cyclomatic 29) pkg/scheduler/api/hyper_node_info.go:307 — HyperNodesInfo.UpdateHyperNode has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.Execute (cyclomatic 28) · ×1
  • Action.Execute (cyclomatic 28) REDACTED:57 — Action.Execute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SchedulerCache.buildTaskDRAInfo (cyclomatic 28) · ×1
  • SchedulerCache.buildTaskDRAInfo (cyclomatic 28) pkg/scheduler/cache/cache.go:2085 — SchedulerCache.buildTaskDRAInfo has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tdmPlugin.OnSessionOpen (cyclomatic 25) · ×1
  • tdmPlugin.OnSessionOpen (cyclomatic 25) pkg/scheduler/plugins/tdm/tdm.go:139 — tdmPlugin.OnSessionOpen has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 197, 236, 146, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · validate.AdmitNamespaceQueues (cyclomatic 25) · ×1
  • validate.AdmitNamespaceQueues (cyclomatic 25) pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:70 — validate.AdmitNamespaceQueues has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · job.createJobPod (cyclomatic 24) · ×1
  • job.createJobPod (cyclomatic 24) pkg/controllers/job/job_controller_util.go:47 — job.createJobPod has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · capacityPlugin.buildQueueAttrs (cyclomatic 24) · ×1
  • capacityPlugin.buildQueueAttrs (cyclomatic 24) pkg/scheduler/plugins/capacity/capacity.go:1102 — capacityPlugin.buildQueueAttrs has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gangPlugin.OnSessionOpen (cyclomatic 24) · ×1
  • gangPlugin.OnSessionOpen (cyclomatic 24) pkg/scheduler/plugins/gang/gang.go:57 — gangPlugin.OnSessionOpen has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 58, 97, 139, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · networkTopologyAwarePlugin.OnSessionOpen (cyclomatic 24) · ×1
  • networkTopologyAwarePlugin.OnSessionOpen (cyclomatic 24) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:271 — networkTopologyAwarePlugin.OnSessionOpen has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 278, 315, 334, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · validate.AdmitQueues (cyclomatic 24) · ×1
  • validate.AdmitQueues (cyclomatic 24) pkg/webhooks/admission/queues/validate/validate_queue.go:77 — validate.AdmitQueues has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.Run (cyclomatic 23) · ×1
  • app.Run (cyclomatic 23) cmd/webhook-manager/app/server.go:47 — app.Run has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Action.pickUpPendingTasks (cyclomatic 23) · ×1
  • Action.pickUpPendingTasks (cyclomatic 23) REDACTED:137 — Action.pickUpPendingTasks has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preempt.SelectVictimsOnNode (cyclomatic 23) · ×1
  • preempt.SelectVictimsOnNode (cyclomatic 23) REDACTED:739 — preempt.SelectVictimsOnNode has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.BuildNominationPlanInDomain (cyclomatic 23) · ×1
  • utils.BuildNominationPlanInDomain (cyclomatic 23) pkg/scheduler/actions/utils/simulate.go:40 — utils.BuildNominationPlanInDomain has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredicatesPlugin.InitPlugin (cyclomatic 23) · ×1
  • PredicatesPlugin.InitPlugin (cyclomatic 23) pkg/scheduler/plugins/predicates/predicates.go:452 — PredicatesPlugin.InitPlugin has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SchedulerCache.addEventHandler (cyclomatic 21) · ×1
  • SchedulerCache.addEventHandler (cyclomatic 21) pkg/agentscheduler/cache/cache.go:405 — SchedulerCache.addEventHandler has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 497, 467, 436). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · job.PrintJobInfo (cyclomatic 21) · ×1
  • job.PrintJobInfo (cyclomatic 21) pkg/cli/job/view.go:89 — job.PrintJobInfo has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Action.allocateForJob (cyclomatic 21) · ×1
  • Action.allocateForJob (cyclomatic 21) REDACTED:455 — Action.allocateForJob has cyclomatic complexity 21 (threshold 15). Of this number, 16 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.
D1 · Cyclomatic Complexity · JobInfo.GetMinDRAResources (cyclomatic 21) · ×1
  • JobInfo.GetMinDRAResources (cyclomatic 21) pkg/scheduler/api/job_info.go:1660 — JobInfo.GetMinDRAResources has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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 · Session.HyperNodeContainsNomination (cyclomatic 21) · ×1
  • Session.HyperNodeContainsNomination (cyclomatic 21) pkg/scheduler/framework/hyper_node_candidate.go:32 — Session.HyperNodeContainsNomination 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 · groupTopologyAffinityPlugin.enablePlacementTracking (cyclomatic 21) · ×1
  • groupTopologyAffinityPlugin.enablePlacementTracking (cyclomatic 21) pkg/scheduler/plugins/group-topology-affinity/constraints.go:60 — groupTopologyAffinityPlugin.enablePlacementTracking has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · nodeGroupPlugin.OnSessionOpen (cyclomatic 21) · ×1
  • nodeGroupPlugin.OnSessionOpen (cyclomatic 21) pkg/scheduler/plugins/nodegroup/nodegroup.go:436 — nodeGroupPlugin.OnSessionOpen has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 486, 461, 438, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PredicatesPlugin.Predicate (cyclomatic 21) · ×1
  • PredicatesPlugin.Predicate (cyclomatic 21) pkg/scheduler/plugins/predicates/predicates.go:662 — PredicatesPlugin.Predicate has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent 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 · validate.validatePolicies (cyclomatic 21) · ×1
  • validate.validatePolicies (cyclomatic 21) pkg/webhooks/admission/jobs/validate/util.go:62 — validate.validatePolicies 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 · validate.validateNamespaceQueueParentWorkloads (cyclomatic 21) · ×1
  • validate.validateNamespaceQueueParentWorkloads (cyclomatic 21) pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:389 — validate.validateNamespaceQueueParentWorkloads 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 · jobcontroller.AddDelayActionForJob (cyclomatic 20) · ×1
  • jobcontroller.AddDelayActionForJob (cyclomatic 20) pkg/controllers/job/job_controller.go:502 — jobcontroller.AddDelayActionForJob 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 one function literal inside it that branches (line 522). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · api.NewHyperNodeIndex (cyclomatic 20) · ×1
  • api.NewHyperNodeIndex (cyclomatic 20) REDACTED:33 — api.NewHyperNodeIndex has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deviceSharePlugin.OnSessionOpen (cyclomatic 20) · ×1
  • deviceSharePlugin.OnSessionOpen (cyclomatic 20) pkg/scheduler/plugins/deviceshare/deviceshare.go:223 — deviceSharePlugin.OnSessionOpen 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 3 function literals inside it that branch (lines 285, 233, 268). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · nodescore.RunScorePlugins (cyclomatic 20) · ×1
  • nodescore.RunScorePlugins (cyclomatic 20) pkg/scheduler/plugins/util/nodescore/score_helper.go:68 — nodescore.RunScorePlugins has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JobCache.Record (cyclomatic 20) · ×1
  • JobCache.Record (cyclomatic 20) pkg/scheduler/unschedulable/cache.go:130 — JobCache.Record has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.addCaCertForWebhook (cyclomatic 19) · ×1
  • app.addCaCertForWebhook (cyclomatic 19) REDACTED:43 — app.addCaCertForWebhook has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · vjobs.PrintJobInfo (cyclomatic 19) · ×1
  • vjobs.PrintJobInfo (cyclomatic 19) pkg/cli/vjobs/view.go:130 — vjobs.PrintJobInfo has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runningState.Execute (cyclomatic 19) · ×1
  • runningState.Execute (cyclomatic 19) pkg/controllers/job/state/running.go:33 — runningState.Execute has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 63). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · namespaceQueueController.evaluateParent (cyclomatic 19) · ×1
  • namespaceQueueController.evaluateParent (cyclomatic 19) pkg/controllers/namespacequeue/namespacequeue_controller_action.go:140 — namespaceQueueController.evaluateParent has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShardingManager.runPipeline (cyclomatic 19) · ×1
  • ShardingManager.runPipeline (cyclomatic 19) pkg/controllers/sharding/sharding_manager.go:188 — ShardingManager.runPipeline has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.allocateResourcesForQueues (cyclomatic 19) · ×1
  • Action.allocateResourcesForQueues (cyclomatic 19) REDACTED:364 — Action.allocateResourcesForQueues has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AscendDevices.selectDevices (cyclomatic 19) · ×1
  • AscendDevices.selectDevices (cyclomatic 19) pkg/scheduler/api/devices/ascend/hami/device_info.go:448 — AscendDevices.selectDevices has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TestCommonStruct.createSchedulerCache (cyclomatic 19) · ×1
  • TestCommonStruct.createSchedulerCache (cyclomatic 19) pkg/scheduler/uthelper/helper.go:135 — TestCommonStruct.createSchedulerCache has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · validate.validateJobCreate (cyclomatic 19) · ×1
  • validate.validateJobCreate (cyclomatic 19) pkg/webhooks/admission/jobs/validate/admit_job.go:120 — validate.validateJobCreate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · validate.validateJobUpdate (cyclomatic 19) · ×1
  • validate.validateJobUpdate (cyclomatic 19) pkg/webhooks/admission/jobs/validate/admit_job.go:234 — validate.validateJobUpdate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · util.ValidateWorkloadQueueReference (cyclomatic 19) · ×1
  • util.ValidateWorkloadQueueReference (cyclomatic 19) pkg/webhooks/util/queue_reference.go:72 — util.ValidateWorkloadQueueReference has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.Run (cyclomatic 18) · ×1
  • app.Run (cyclomatic 18) cmd/hypernode-controller-manager/app/server.go:56 — app.Run has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pod.CalculateExtendResourcesV2 (cyclomatic 18) · ×1
  • pod.CalculateExtendResourcesV2 (cyclomatic 18) pkg/agent/utils/pod/resources.go:156 — pod.CalculateExtendResourcesV2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · devices.ExtractResourceRequest (cyclomatic 18) · ×1
  • devices.ExtractResourceRequest (cyclomatic 18) pkg/scheduler/api/devices/util.go:210 — devices.ExtractResourceRequest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeOrderPlugin.InitPlugin (cyclomatic 18) · ×1
  • NodeOrderPlugin.InitPlugin (cyclomatic 18) pkg/scheduler/plugins/nodeorder/nodeorder.go:258 — NodeOrderPlugin.InitPlugin has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · predicateHelper.PredicateNodes (cyclomatic 18) · ×1
  • predicateHelper.PredicateNodes (cyclomatic 18) pkg/scheduler/util/predicate_helper.go:45 — predicateHelper.PredicateNodes has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MemoryQoSV2Handle.Handle (cyclomatic 17) · ×1
  • MemoryQoSV2Handle.Handle (cyclomatic 17) pkg/agent/events/handlers/memoryqosv2/memoryqosv2_linux.go:72 — MemoryQoSV2Handle.Handle 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, separate the cases: extract each independent 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 · cronjobcontroller.syncCronJob (cyclomatic 17) · ×1
  • cronjobcontroller.syncCronJob (cyclomatic 17) pkg/controllers/cronjob/cronjob_controller.go:219 — cronjobcontroller.syncCronJob has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · jobcontroller.CleanPodDelayActionsIfNeed (cyclomatic 17) · ×1
  • jobcontroller.CleanPodDelayActionsIfNeed (cyclomatic 17) pkg/controllers/job/job_controller.go:447 — jobcontroller.CleanPodDelayActionsIfNeed has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · numaPlugin.OnSessionOpen (cyclomatic 17) · ×1
  • numaPlugin.OnSessionOpen (cyclomatic 17) REDACTED:82 — numaPlugin.OnSessionOpen 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 4 function literals inside it that branch (lines 120, 175, 88, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · util.GetInqueueResource (cyclomatic 17) · ×1
  • util.GetInqueueResource (cyclomatic 17) pkg/scheduler/plugins/util/util.go:97 — util.GetInqueueResource 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, separate the cases: extract each independent 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 · NetworkQos.Validate (cyclomatic 16) · ×1
  • NetworkQos.Validate (cyclomatic 16) pkg/agent/config/api/validate.go:63 — NetworkQos.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.
D1 · Cyclomatic Complexity · Evicting.Validate (cyclomatic 16) · ×1
  • Evicting.Validate (cyclomatic 16) pkg/agent/config/api/validate.go:108 — Evicting.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.
D1 · Cyclomatic Complexity · ResourcesHandle.Handle (cyclomatic 16) · ×1
  • ResourcesHandle.Handle (cyclomatic 16) pkg/agent/events/handlers/resources/resources.go:60 — ResourcesHandle.Handle has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cronjobcontroller.processFinishedJobs (cyclomatic 16) · ×1
  • cronjobcontroller.processFinishedJobs (cyclomatic 16) pkg/controllers/cronjob/cronjob_controller_handler.go:183 — cronjobcontroller.processFinishedJobs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.buildAllocateContext (cyclomatic 16) · ×1
  • Action.buildAllocateContext (cyclomatic 16) REDACTED:169 — Action.buildAllocateContext has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.allocateForSubJob (cyclomatic 16) · ×1
  • Action.allocateForSubJob (cyclomatic 16) REDACTED:581 — Action.allocateForSubJob has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Action.prioritizeNodes (cyclomatic 16) · ×1
  • Action.prioritizeNodes (cyclomatic 16) REDACTED:1175 — Action.prioritizeNodes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.FormatHyperNodeFitSummary (cyclomatic 16) · ×1
  • api.FormatHyperNodeFitSummary (cyclomatic 16) pkg/scheduler/api/unschedule_info.go:164 — api.FormatHyperNodeFitSummary has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Resource.LessEqualWithDimensionAndResourcesName (cyclomatic 16) · ×1
  • Resource.LessEqualWithDimensionAndResourcesName (cyclomatic 16) pkg/scheduler/api/resource_info.go:479 — Resource.LessEqualWithDimensionAndResourcesName has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · framework.openSession (cyclomatic 16) · ×1
  • framework.openSession (cyclomatic 16) REDACTED:184 — framework.openSession has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · capacity.checkDRAAllocatable (cyclomatic 16) · ×1
  • capacity.checkDRAAllocatable (cyclomatic 16) pkg/scheduler/plugins/capacity/capacity.go:247 — capacity.checkDRAAllocatable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fairshare.New (cyclomatic 16) · ×1
  • fairshare.New (cyclomatic 16) pkg/scheduler/plugins/fairshare/fairshare.go:132 — fairshare.New has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · priorityPlugin.OnSessionOpen (cyclomatic 16) · ×1
  • priorityPlugin.OnSessionOpen (cyclomatic 16) pkg/scheduler/plugins/priority/priority.go:49 — priorityPlugin.OnSessionOpen 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 5 function literals inside it that branch (lines 111, 153, 50, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · util.SelectBestNodes (cyclomatic 16) · ×1
  • util.SelectBestNodes (cyclomatic 16) REDACTED:232 — util.SelectBestNodes 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.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×1
  • Dependency pinned to a stale untagged commit: github.com/google/shlex — Direct dependency `github.com/google/shlex` is required at `v0.0.0-20191202100458-e7afc7fbc510` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2019-12-02, 7 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/google/shlex` and has not moved this requirement in 7 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/google/shlex` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D2 · Cognitive Complexity · capacityPlugin.OnSessionOpen (cognitive 195) · ×1
  • capacityPlugin.OnSessionOpen (cognitive 195) pkg/scheduler/plugins/capacity/capacity.go:442 — capacityPlugin.OnSessionOpen has cognitive complexity 195 (threshold 15). Drivers by points: if/else 88 (144 pts), loops 14 (27 pts), boolean chains 24 (nesting depth added 69). Most of this is not in the body itself: 3 of the 195 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 466, 655, 788, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · deviceSharePlugin.wrapGPUDevicesForExclusivity (cognitive 176) · ×1
  • deviceSharePlugin.wrapGPUDevicesForExclusivity (cognitive 176) pkg/scheduler/plugins/deviceshare/gpuexclusive.go:431 — deviceSharePlugin.wrapGPUDevicesForExclusivity has cognitive complexity 176 (threshold 15). Drivers by points: if/else 29 (108 pts), loops 19 (63 pts), boolean chains 5 (nesting depth added 123). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.Execute (cognitive 113) · ×1
  • Action.Execute (cognitive 113) REDACTED:101 — Action.Execute has cognitive complexity 113 (threshold 15). Drivers by points: if/else 28 (90 pts), loops 9 (18 pts), boolean chains 5 (nesting depth added 71). Of this number, 82 points are the body's own statements and 31 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proportionPlugin.OnSessionOpen (cognitive 110) · ×1
  • proportionPlugin.OnSessionOpen (cognitive 110) pkg/scheduler/plugins/proportion/proportion.go:91 — proportionPlugin.OnSessionOpen has cognitive complexity 110 (threshold 15). Drivers by points: if/else 51 (87 pts), loops 12 (21 pts), boolean chains 2 (nesting depth added 45). Of this number, 72 points are the body's own statements and 38 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobcontroller.killPods (cognitive 91) · ×1
  • jobcontroller.killPods (cognitive 91) pkg/controllers/job/job_controller_actions.go:110 — jobcontroller.killPods has cognitive complexity 91 (threshold 15). Drivers by points: if/else 31 (73 pts), loops 5 (11 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · jobcontroller.syncJob (cognitive 89) · ×1
  • jobcontroller.syncJob (cognitive 89) pkg/controllers/job/job_controller_actions.go:394 — jobcontroller.syncJob has cognitive complexity 89 (threshold 15). Drivers by points: if/else 41 (73 pts), loops 7 (13 pts), boolean chains 3 (nesting depth added 38). Of this number, 66 points are the body's own statements and 23 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.allocateResourcesForTasks (cognitive 84) · ×1
  • Action.allocateResourcesForTasks (cognitive 84) REDACTED:933 — Action.allocateResourcesForTasks has cognitive complexity 84 (threshold 15). Drivers by points: if/else 30 (69 pts), loops 4 (9 pts), boolean chains 6 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · capacityPlugin.buildHierarchicalQueueAttrs (cognitive 83) · ×1
  • capacityPlugin.buildHierarchicalQueueAttrs (cognitive 83) pkg/scheduler/plugins/capacity/capacity.go:1210 — capacityPlugin.buildHierarchicalQueueAttrs has cognitive complexity 83 (threshold 15). Drivers by points: if/else 27 (54 pts), loops 10 (22 pts), boolean chains 7 (nesting depth added 39). Of this number, 72 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.
D2 · Cognitive Complexity · PredicatesPlugin.OnSessionOpen (cognitive 83) · ×1
  • PredicatesPlugin.OnSessionOpen (cognitive 83) pkg/scheduler/plugins/predicates/predicates.go:206 — PredicatesPlugin.OnSessionOpen has cognitive complexity 83 (threshold 15). Drivers by points: if/else 37 (74 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 40). Most of this is not in the body itself: 11 of the 83 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 385, 230, 332, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · pod.printPod (cognitive 80) · ×1
  • pod.printPod (cognitive 80) pkg/cli/pod/pod.go:360 — pod.printPod has cognitive complexity 80 (threshold 15). Drivers by points: if/else 28 (59 pts), boolean chains 13, loops 4 (5 pts), match/switch 2 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · job.applyPolicies (cognitive 80) · ×1
  • job.applyPolicies (cognitive 80) pkg/controllers/job/job_controller_util.go:190 — job.applyPolicies has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (64 pts), boolean chains 9, loops 3 (7 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · vgpu.checkNodeGPUSharingPredicateAndScore (cognitive 69) · ×1
  • vgpu.checkNodeGPUSharingPredicateAndScore (cognitive 69) REDACTED:379 — vgpu.checkNodeGPUSharingPredicateAndScore has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (60 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 33). Of this number, 58 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.
D2 · Cognitive Complexity · Action.Execute (cognitive 68) · ×1
  • Action.Execute (cognitive 68) REDACTED:57 — Action.Execute has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 5 (10 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · drfPlugin.OnSessionOpen (cognitive 66) · ×1
  • drfPlugin.OnSessionOpen (cognitive 66) pkg/scheduler/plugins/drf/drf.go:186 — drfPlugin.OnSessionOpen has cognitive complexity 66 (threshold 15). Drivers by points: if/else 30 (55 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 30). Most of this is not in the body itself: 15 of the 66 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 280, 222, 392, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · fairSharePlugin.OnSessionOpen (cognitive 62) · ×1
  • fairSharePlugin.OnSessionOpen (cognitive 62) pkg/scheduler/plugins/fairshare/fairshare.go:236 — fairSharePlugin.OnSessionOpen has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (37 pts), loops 11 (23 pts), boolean chains 2 (nesting depth added 26). Of this number, 45 points are the body's own statements and 17 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.CreateJobBundles (cognitive 61) · ×1
  • utils.CreateJobBundles (cognitive 61) pkg/scheduler/actions/utils/bundle.go:53 — utils.CreateJobBundles has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 7 (17 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 29). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extenderPlugin.OnSessionOpen (cognitive 60) · ×1
  • extenderPlugin.OnSessionOpen (cognitive 60) pkg/scheduler/plugins/extender/extender.go:173 — extenderPlugin.OnSessionOpen has cognitive complexity 60 (threshold 15). Drivers by points: if/else 31 (58 pts), boolean chains 2 (nesting depth added 27). Most of this is not in the body itself: 14 of the 60 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 191, 220, 244, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · deviceSharePlugin.OnSessionOpen (cognitive 59) · ×1
  • deviceSharePlugin.OnSessionOpen (cognitive 59) pkg/scheduler/plugins/deviceshare/deviceshare.go:223 — deviceSharePlugin.OnSessionOpen has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (50 pts), loops 4 (9 pts) (nesting depth added 38). None of this is in the body itself: all 59 points belong to 3 function literals inside it that branch (lines 285, 233, 268). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SchedulerCache.buildTaskDRAInfo (cognitive 55) · ×1
  • SchedulerCache.buildTaskDRAInfo (cognitive 55) pkg/scheduler/cache/cache.go:2085 — SchedulerCache.buildTaskDRAInfo has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (44 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · devices.ExtractResourceRequest (cognitive 54) · ×1
  • devices.ExtractResourceRequest (cognitive 54) pkg/scheduler/api/devices/util.go:210 — devices.ExtractResourceRequest has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (52 pts), boolean chains 1, loops 1 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Action.allocateResourcesForQueues (cognitive 52) · ×1
  • Action.allocateResourcesForQueues (cognitive 52) REDACTED:364 — Action.allocateResourcesForQueues has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (47 pts), boolean chains 4, loops 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Action.allocateForJob (cognitive 50) · ×1
  • Action.allocateForJob (cognitive 50) REDACTED:455 — Action.allocateForJob has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 29). Of this number, 32 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.
D2 · Cognitive Complexity · Action.pickUpPendingTasks (cognitive 50) · ×1
  • Action.pickUpPendingTasks (cognitive 50) REDACTED:137 — Action.pickUpPendingTasks has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 6 (11 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.Execute (cognitive 45) · ×1
  • Action.Execute (cognitive 45) REDACTED:60 — Action.Execute has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 4 (11 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · pod.CalculateExtendResourcesV2 (cognitive 44) · ×1
  • pod.CalculateExtendResourcesV2 (cognitive 44) pkg/agent/utils/pod/resources.go:156 — pod.CalculateExtendResourcesV2 has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (42 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.
D2 · Cognitive Complexity · utils.BuildNominationPlanInDomain (cognitive 43) · ×1
  • utils.BuildNominationPlanInDomain (cognitive 43) pkg/scheduler/actions/utils/simulate.go:40 — utils.BuildNominationPlanInDomain has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 5 (11 pts), boolean chains 4, jumps 1 (nesting depth added 20). 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.
D2 · Cognitive Complexity · capacityPlugin.buildQueueAttrs (cognitive 43) · ×1
  • capacityPlugin.buildQueueAttrs (cognitive 43) pkg/scheduler/plugins/capacity/capacity.go:1102 — capacityPlugin.buildQueueAttrs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 8 (15 pts), boolean chains 2 (nesting depth added 22). 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.
D2 · Cognitive Complexity · PredicatesPlugin.InitPlugin (cognitive 43) · ×1
  • PredicatesPlugin.InitPlugin (cognitive 43) pkg/scheduler/plugins/predicates/predicates.go:452 — PredicatesPlugin.InitPlugin has cognitive complexity 43 (threshold 15). Drivers by points: if/else 31 (43 pts) (nesting depth added 12). Of this number, 41 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate.validatePolicies (cognitive 42) · ×1
  • validate.validatePolicies (cognitive 42) pkg/webhooks/admission/jobs/validate/util.go:62 — validate.validatePolicies has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HyperNodesInfo.UpdateHyperNode (cognitive 40) · ×1
  • HyperNodesInfo.UpdateHyperNode (cognitive 40) pkg/scheduler/api/hyper_node_info.go:307 — HyperNodesInfo.UpdateHyperNode has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (9 pts), boolean chains 7 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredicatesPlugin.Predicate (cognitive 40) · ×1
  • PredicatesPlugin.Predicate (cognitive 40) pkg/scheduler/plugins/predicates/predicates.go:662 — PredicatesPlugin.Predicate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 2 (nesting depth added 18). Of this number, 27 points are the body's own statements and 13 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate.AdmitNamespaceQueues (cognitive 40) · ×1
  • validate.AdmitNamespaceQueues (cognitive 40) pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:70 — validate.AdmitNamespaceQueues has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 2, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runningState.Execute (cognitive 39) · ×1
  • runningState.Execute (cognitive 39) pkg/controllers/job/state/running.go:33 — runningState.Execute has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 1 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 24). Most of this is not in the body itself: 1 of the 39 points is its own statement and the rest belongs to one function literal inside it that branches (line 63). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ShardingManager.runPipeline (cognitive 39) · ×1
  • ShardingManager.runPipeline (cognitive 39) pkg/controllers/sharding/sharding_manager.go:188 — ShardingManager.runPipeline has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 9 (19 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.addCaCertForWebhook (cognitive 38) · ×1
  • app.addCaCertForWebhook (cognitive 38) REDACTED:43 — app.addCaCertForWebhook has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 20). Of this number, 28 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobInfo.GetMinDRAResources (cognitive 38) · ×1
  • JobInfo.GetMinDRAResources (cognitive 38) pkg/scheduler/api/job_info.go:1660 — JobInfo.GetMinDRAResources has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 17). Of this number, 25 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exclusiveGPUDevices.untrackPod (cognitive 38) · ×1
  • exclusiveGPUDevices.untrackPod (cognitive 38) pkg/scheduler/plugins/deviceshare/gpuexclusive.go:225 — exclusiveGPUDevices.untrackPod has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 4 (11 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.
D2 · Cognitive Complexity · util.GetInqueueResource (cognitive 38) · ×1
  • util.GetInqueueResource (cognitive 38) pkg/scheduler/plugins/util/util.go:97 — util.GetInqueueResource has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 23). Of this number, 34 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · featureGate.Enabled (cognitive 37) · ×1
  • featureGate.Enabled (cognitive 37) pkg/agent/features/feature_gate.go:48 — featureGate.Enabled has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 21, if/else 8 (15 pts), match/switch 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AscendDevices.selectDevices (cognitive 37) · ×1
  • AscendDevices.selectDevices (cognitive 37) pkg/scheduler/api/devices/ascend/hami/device_info.go:448 — AscendDevices.selectDevices has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 6 (11 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobcontroller.CleanPodDelayActionsIfNeed (cognitive 36) · ×1
  • jobcontroller.CleanPodDelayActionsIfNeed (cognitive 36) pkg/controllers/job/job_controller.go:447 — jobcontroller.CleanPodDelayActionsIfNeed has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 4 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SchedulerCache.addEventHandler (cognitive 36) · ×1
  • SchedulerCache.addEventHandler (cognitive 36) pkg/scheduler/cache/cache.go:685 — SchedulerCache.addEventHandler has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 3, match/switch 3 (nesting depth added 10). Of this number, 16 points are the body's own statements and 20 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.Reclaimable (cognitive 36) · ×1
  • Session.Reclaimable (cognitive 36) pkg/scheduler/framework/session_plugins.go:235 — Session.Reclaimable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 4 (12 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Session.Preemptable) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Session.Preemptable (cognitive 36) · ×1
  • Session.Preemptable (cognitive 36) pkg/scheduler/framework/session_plugins.go:284 — Session.Preemptable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 4 (12 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Session.Reclaimable) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · util.ValidateWorkloadQueueReference (cognitive 36) · ×1
  • util.ValidateWorkloadQueueReference (cognitive 36) pkg/webhooks/util/queue_reference.go:72 — util.ValidateWorkloadQueueReference has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (35 pts), 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.
D2 · Cognitive Complexity · cgroup.parseKubeletConfig (cognitive 35) · ×1
  • cgroup.parseKubeletConfig (cognitive 35) pkg/agent/utils/cgroup/cgroup.go:200 — cgroup.parseKubeletConfig has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · job.createJobPod (cognitive 35) · ×1
  • job.createJobPod (cognitive 35) pkg/controllers/job/job_controller_util.go:47 — job.createJobPod has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (31 pts), loops 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.
D2 · Cognitive Complexity · jobcontroller.updatePod (cognitive 35) · ×1
  • jobcontroller.updatePod (cognitive 35) pkg/controllers/job/job_controller_handler.go:218 — jobcontroller.updatePod has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 7, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · capacity.checkDRAAllocatable (cognitive 35) · ×1
  • capacity.checkDRAAllocatable (cognitive 35) pkg/scheduler/plugins/capacity/capacity.go:247 — capacity.checkDRAAllocatable has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (4 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.
D2 · Cognitive Complexity · validate.AdmitQueues (cognitive 35) · ×1
  • validate.AdmitQueues (cognitive 35) pkg/webhooks/admission/queues/validate/validate_queue.go:77 — validate.AdmitQueues has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 4, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · groupTopologyAffinityPlugin.enablePlacementTracking (cognitive 34) · ×1
  • groupTopologyAffinityPlugin.enablePlacementTracking (cognitive 34) pkg/scheduler/plugins/group-topology-affinity/constraints.go:60 — groupTopologyAffinityPlugin.enablePlacementTracking has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (13 pts), boolean chains 8 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeOrderPlugin.InitPlugin (cognitive 34) · ×1
  • NodeOrderPlugin.InitPlugin (cognitive 34) pkg/scheduler/plugins/nodeorder/nodeorder.go:258 — NodeOrderPlugin.InitPlugin has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25 (34 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tdmPlugin.OnSessionOpen (cognitive 34) · ×1
  • tdmPlugin.OnSessionOpen (cognitive 34) pkg/scheduler/plugins/tdm/tdm.go:139 — tdmPlugin.OnSessionOpen has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (26 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 10). None of this is in the body itself: all 34 points belong to 7 function literals inside it that branch (lines 197, 236, 146, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · jobflowcontroller.deployJob (cognitive 33) · ×1
  • jobflowcontroller.deployJob (cognitive 33) pkg/controllers/jobflow/jobflow_controller_action.go:76 — jobflowcontroller.deployJob has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (31 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · api.NewHyperNodeIndex (cognitive 33) · ×1
  • api.NewHyperNodeIndex (cognitive 33) REDACTED:33 — api.NewHyperNodeIndex has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 9 (14 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.
D2 · Cognitive Complexity · framework.updateQueueStatus (cognitive 33) · ×1
  • framework.updateQueueStatus (cognitive 33) REDACTED:485 — framework.updateQueueStatus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 6 (14 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.UnifiedEvictable (cognitive 33) · ×1
  • Session.UnifiedEvictable (cognitive 33) pkg/scheduler/framework/session_plugins.go:335 — Session.UnifiedEvictable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (12 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · networkTopologyAwarePlugin.OnSessionOpen (cognitive 33) · ×1
  • networkTopologyAwarePlugin.OnSessionOpen (cognitive 33) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:271 — networkTopologyAwarePlugin.OnSessionOpen has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 3, loops 3 (nesting depth added 9). None of this is in the body itself: all 33 points belong to 5 function literals inside it that branch (lines 278, 355, 369, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · jobcontroller.createJobIOIfNotExist (cognitive 32) · ×1
  • jobcontroller.createJobIOIfNotExist (cognitive 32) pkg/controllers/job/job_controller_actions.go:762 — jobcontroller.createJobIOIfNotExist has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · namespaceQueueController.evaluateParent (cognitive 32) · ×1
  • namespaceQueueController.evaluateParent (cognitive 32) pkg/controllers/namespacequeue/namespacequeue_controller_action.go:140 — namespaceQueueController.evaluateParent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · Session.HyperNodeContainsNomination (cognitive 32) · ×1
  • Session.HyperNodeContainsNomination (cognitive 32) pkg/scheduler/framework/hyper_node_candidate.go:32 — Session.HyperNodeContainsNomination has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · Action.Execute (cognitive 31) · ×1
  • Action.Execute (cognitive 31) pkg/scheduler/actions/gangreclaim/gangreclaim.go:79 — Action.Execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gangPlugin.OnSessionClose (cognitive 31) · ×1
  • gangPlugin.OnSessionClose (cognitive 31) pkg/scheduler/plugins/gang/gang.go:229 — gangPlugin.OnSessionClose has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (4 pts) (nesting depth added 19). Of this number, 20 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.
D2 · Cognitive Complexity · resourceStrategyFitPlugin.OnSessionOpen (cognitive 31) · ×1
  • resourceStrategyFitPlugin.OnSessionOpen (cognitive 31) pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go:203 — resourceStrategyFitPlugin.OnSessionOpen has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 16). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 225, 209). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · job.PrintJobInfo (cognitive 30) · ×1
  • job.PrintJobInfo (cognitive 30) pkg/cli/job/view.go:89 — job.PrintJobInfo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15, loops 7 (15 pts) (nesting depth added 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.
D2 · Cognitive Complexity · pgcontroller.getAnnotationsFromUpperRes (cognitive 30) · ×1
  • pgcontroller.getAnnotationsFromUpperRes (cognitive 30) pkg/controllers/podgroup/pg_controller_handler.go:214 — pgcontroller.getAnnotationsFromUpperRes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 2 (4 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · Action.buildAllocateContext (cognitive 30) · ×1
  • Action.buildAllocateContext (cognitive 30) REDACTED:169 — Action.buildAllocateContext has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grouptopologyaffinity.compileTerms (cognitive 30) · ×1
  • grouptopologyaffinity.compileTerms (cognitive 30) pkg/scheduler/plugins/group-topology-affinity/constraints.go:152 — grouptopologyaffinity.compileTerms has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobCache.Record (cognitive 30) · ×1
  • JobCache.Record (cognitive 30) pkg/scheduler/unschedulable/cache.go:130 — JobCache.Record has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (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.
D2 · Cognitive Complexity · validate.validateJobCreate (cognitive 30) · ×1
  • validate.validateJobCreate (cognitive 30) pkg/webhooks/admission/jobs/validate/admit_job.go:120 — validate.validateJobCreate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · labelDiscoverer.generateHyperNodeInfo (cognitive 29) · ×1
  • labelDiscoverer.generateHyperNodeInfo (cognitive 29) pkg/controllers/hypernode/discovery/label/label.go:465 — labelDiscoverer.generateHyperNodeInfo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobcontroller.cleanupDelayActions (cognitive 29) · ×1
  • jobcontroller.cleanupDelayActions (cognitive 29) pkg/controllers/job/job_controller.go:612 — jobcontroller.cleanupDelayActions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.allocateForSubJob (cognitive 29) · ×1
  • Action.allocateForSubJob (cognitive 29) REDACTED:581 — Action.allocateForSubJob has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.Execute (cognitive 29) · ×1
  • Action.Execute (cognitive 29) pkg/scheduler/actions/gangpreempt/gangpreempt.go:79 — Action.Execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (4 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.
D2 · Cognitive Complexity · preempt.SelectVictimsOnNode (cognitive 29) · ×1
  • preempt.SelectVictimsOnNode (cognitive 29) REDACTED:739 — preempt.SelectVictimsOnNode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 4, boolean chains 2 (nesting depth added 7). Of this number, 20 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.reclaimForTask (cognitive 29) · ×1
  • Action.reclaimForTask (cognitive 29) REDACTED:180 — Action.reclaimForTask has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeInfo.addResource (cognitive 29) · ×1
  • NodeInfo.addResource (cognitive 29) pkg/scheduler/api/node_info.go:536 — NodeInfo.addResource has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 1 (2 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. This shape REPEATS in the file: one other method here (NodeInfo.subResource) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · NodeInfo.subResource (cognitive 29) · ×1
  • NodeInfo.subResource (cognitive 29) pkg/scheduler/api/node_info.go:575 — NodeInfo.subResource has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 1 (2 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. This shape REPEATS in the file: one other method here (NodeInfo.addResource) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · vnpu310p.ScoreBatchNodes (cognitive 29) · ×1
  • vnpu310p.ScoreBatchNodes (cognitive 29) pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/score_policy.go:30 — vnpu310p.ScoreBatchNodes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryQoSV2Handle.Handle (cognitive 28) · ×1
  • MemoryQoSV2Handle.Handle (cognitive 28) pkg/agent/events/handlers/memoryqosv2/memoryqosv2_linux.go:72 — MemoryQoSV2Handle.Handle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 1, loops 1 (nesting depth added 12). Of this number, 24 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.prioritizeNodes (cognitive 28) · ×1
  • Action.prioritizeNodes (cognitive 28) REDACTED:1175 — Action.prioritizeNodes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (5 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · vgpu.checkGPUtype (cognitive 28) · ×1
  • vgpu.checkGPUtype (cognitive 28) REDACTED:228 — vgpu.checkGPUtype has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredicatesPlugin.onAllocate (cognitive 28) · ×1
  • PredicatesPlugin.onAllocate (cognitive 28) pkg/scheduler/plugins/predicates/predicates.go:824 — PredicatesPlugin.onAllocate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 1 (2 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.
D2 · Cognitive Complexity · validate.validateCronjobSpec (cognitive 28) · ×1
  • validate.validateCronjobSpec (cognitive 28) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:171 — validate.validateCronjobSpec has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 1 (3 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.
D2 · Cognitive Complexity · vjobs.PrintJobInfo (cognitive 27) · ×1
  • vjobs.PrintJobInfo (cognitive 27) pkg/cli/vjobs/view.go:130 — vjobs.PrintJobInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, loops 6 (13 pts) (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · jobcontroller.isDependsOnPodsReady (cognitive 27) · ×1
  • jobcontroller.isDependsOnPodsReady (cognitive 27) pkg/controllers/job/job_controller_actions.go:707 — jobcontroller.isDependsOnPodsReady has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (3 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.
D2 · Cognitive Complexity · capacityPlugin.checkHierarchicalQueue (cognitive 27) · ×1
  • capacityPlugin.checkHierarchicalQueue (cognitive 27) pkg/scheduler/plugins/capacity/capacity.go:1501 — capacityPlugin.checkHierarchicalQueue has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (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.
D2 · Cognitive Complexity · pdbPlugin.OnSessionOpen (cognitive 27) · ×1
  • pdbPlugin.OnSessionOpen (cognitive 27) pkg/scheduler/plugins/pdb/pdb.go:55 — pdbPlugin.OnSessionOpen has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 13). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to one function literal inside it that branches (line 65). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AscendDevices.ScoreNode (cognitive 26) · ×1
  • AscendDevices.ScoreNode (cognitive 26) pkg/scheduler/api/devices/ascend/hami/device_info.go:292 — AscendDevices.ScoreNode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 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.
D2 · Cognitive Complexity · Session.JobEnqueueable (cognitive 26) · ×1
  • Session.JobEnqueueable (cognitive 26) pkg/scheduler/framework/session_plugins.go:595 — Session.JobEnqueueable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exclusiveGPUDevices.Allocate (cognitive 26) · ×1
  • exclusiveGPUDevices.Allocate (cognitive 26) pkg/scheduler/plugins/deviceshare/gpuexclusive.go:305 — exclusiveGPUDevices.Allocate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · priorityPlugin.OnSessionOpen (cognitive 26) · ×1
  • priorityPlugin.OnSessionOpen (cognitive 26) pkg/scheduler/plugins/priority/priority.go:49 — priorityPlugin.OnSessionOpen has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 2 (nesting depth added 7). None of this is in the body itself: all 26 points belong to 5 function literals inside it that branch (lines 111, 153, 50, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TestCommonStruct.createSchedulerCache (cognitive 26) · ×1
  • TestCommonStruct.createSchedulerCache (cognitive 26) pkg/scheduler/uthelper/helper.go:135 — TestCommonStruct.createSchedulerCache has cognitive complexity 26 (threshold 15). Drivers by points: loops 14 (15 pts), if/else 4 (11 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.
D2 · Cognitive Complexity · app.Run (cognitive 25) · ×1
  • app.Run (cognitive 25) cmd/webhook-manager/app/server.go:47 — app.Run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Action.prioritizeNodes (cognitive 25) · ×1
  • Action.prioritizeNodes (cognitive 25) pkg/agentscheduler/actions/allocate/allocate.go:163 — Action.prioritizeNodes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · namespaceQueueController.enqueueNamespaceQueueTrees (cognitive 25) · ×1
  • namespaceQueueController.enqueueNamespaceQueueTrees (cognitive 25) pkg/controllers/namespacequeue/namespacequeue_controller_handler.go:439 — namespaceQueueController.enqueueNamespaceQueueTrees has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · namespaceQueueController.validateCapabilityAgainstAncestors (cognitive 25) · ×1
  • namespaceQueueController.validateCapabilityAgainstAncestors (cognitive 25) REDACTED:78 — namespaceQueueController.validateCapabilityAgainstAncestors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 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.
D2 · Cognitive Complexity · HyperNodesInfo.BuildHyperNodeCache (cognitive 25) · ×1
  • HyperNodesInfo.BuildHyperNodeCache (cognitive 25) pkg/scheduler/api/hyper_node_info.go:432 — HyperNodesInfo.BuildHyperNodeCache has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 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.
D2 · Cognitive Complexity · deviceshare.parseExclusiveRules (cognitive 25) · ×1
  • deviceshare.parseExclusiveRules (cognitive 25) pkg/scheduler/plugins/deviceshare/gpuexclusive.go:69 — deviceshare.parseExclusiveRules has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · drfPlugin.updateHierarchicalShare (cognitive 25) · ×1
  • drfPlugin.updateHierarchicalShare (cognitive 25) pkg/scheduler/plugins/drf/drf.go:503 — drfPlugin.updateHierarchicalShare has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (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.
D2 · Cognitive Complexity · gangPlugin.OnSessionOpen (cognitive 25) · ×1
  • gangPlugin.OnSessionOpen (cognitive 25) pkg/scheduler/plugins/gang/gang.go:57 — gangPlugin.OnSessionOpen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 4, loops 1 (nesting depth added 3). None of this is in the body itself: all 25 points belong to 7 function literals inside it that branch (lines 97, 58, 139, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cpumanager.takeByTopology (cognitive 25) · ×1
  • cpumanager.takeByTopology (cognitive 25) pkg/scheduler/plugins/numaaware/provider/cpumanager/cpu_assignment.go:139 — cpumanager.takeByTopology has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (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.
D2 · Cognitive Complexity · nodescore.RunScorePlugins (cognitive 25) · ×1
  • nodescore.RunScorePlugins (cognitive 25) pkg/scheduler/plugins/util/nodescore/score_helper.go:68 — nodescore.RunScorePlugins has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (7 pts), match/switch 3, boolean chains 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · util.SelectBestNodes (cognitive 25) · ×1
  • util.SelectBestNodes (cognitive 25) REDACTED:232 — util.SelectBestNodes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate.validateResourceQuantityOfQueue (cognitive 25) · ×1
  • validate.validateResourceQuantityOfQueue (cognitive 25) pkg/webhooks/admission/queues/validate/validate_queue.go:273 — validate.validateResourceQuantityOfQueue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cgroup.parseCgroupDriverFromCmdline (cognitive 24) · ×1
  • cgroup.parseCgroupDriverFromCmdline (cognitive 24) pkg/agent/utils/cgroup/cgroup.go:301 — cgroup.parseCgroupDriverFromCmdline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchedulerCache.addEventHandler (cognitive 24) · ×1
  • SchedulerCache.addEventHandler (cognitive 24) pkg/agentscheduler/cache/cache.go:405 — SchedulerCache.addEventHandler has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, match/switch 3 (nesting depth added 7). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 497, 467, 436). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cronjobcontroller.processFinishedJobs (cognitive 24) · ×1
  • cronjobcontroller.processFinishedJobs (cognitive 24) pkg/controllers/cronjob/cronjob_controller_handler.go:183 — cronjobcontroller.processFinishedJobs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, match/switch 1 (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.
D2 · Cognitive Complexity · Action.organizeJobWorksheet (cognitive 24) · ×1
  • Action.organizeJobWorksheet (cognitive 24) REDACTED:259 — Action.organizeJobWorksheet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.prioritizeNodesForSimulate (cognitive 24) · ×1
  • utils.prioritizeNodesForSimulate (cognitive 24) pkg/scheduler/actions/utils/simulate.go:321 — utils.prioritizeNodesForSimulate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · api.amendResourceLimitAccordingToPodFeatures (cognitive 24) · ×1
  • api.amendResourceLimitAccordingToPodFeatures (cognitive 24) pkg/scheduler/api/pod_info.go:341 — api.amendResourceLimitAccordingToPodFeatures has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · capacity.getDRADelta (cognitive 24) · ×1
  • capacity.getDRADelta (cognitive 24) pkg/scheduler/plugins/capacity/capacity.go:196 — capacity.getDRADelta has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fairshare.New (cognitive 24) · ×1
  • fairshare.New (cognitive 24) pkg/scheduler/plugins/fairshare/fairshare.go:132 — fairshare.New has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 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.
D2 · Cognitive Complexity · validate.validateJobUpdate (cognitive 24) · ×1
  • validate.validateJobUpdate (cognitive 24) pkg/webhooks/admission/jobs/validate/admit_job.go:234 — validate.validateJobUpdate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResourcesHandle.Handle (cognitive 23) · ×1
  • ResourcesHandle.Handle (cognitive 23) pkg/agent/events/handlers/resources/resources.go:60 — ResourcesHandle.Handle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · JobInfo.DeletePod (cognitive 23) · ×1
  • JobInfo.DeletePod (cognitive 23) pkg/controllers/apis/job_info.go:204 — JobInfo.DeletePod has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (23 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · pgcontroller.addStatefulSet (cognitive 23) · ×1
  • pgcontroller.addStatefulSet (cognitive 23) pkg/controllers/podgroup/pg_controller_handler.go:121 — pgcontroller.addStatefulSet has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · local.getMemoryUsage (cognitive 23) · ×1
  • local.getMemoryUsage (cognitive 23) pkg/metriccollect/local/memory.go:90 — local.getMemoryUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.Execute (cognitive 23) · ×1
  • Action.Execute (cognitive 23) pkg/scheduler/actions/enqueue/enqueue.go:45 — Action.Execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GPUDevices.addResource (cognitive 23) · ×1
  • GPUDevices.addResource (cognitive 23) pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:189 — GPUDevices.addResource has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (17 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.
D2 · Cognitive Complexity · capacity.parseDRAResourceList (cognitive 23) · ×1
  • capacity.parseDRAResourceList (cognitive 23) pkg/scheduler/plugins/capacity/capacity.go:143 — capacity.parseDRAResourceList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nodeGroupPlugin.OnSessionOpen (cognitive 23) · ×1
  • nodeGroupPlugin.OnSessionOpen (cognitive 23) pkg/scheduler/plugins/nodegroup/nodegroup.go:436 — nodeGroupPlugin.OnSessionOpen has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2, loops 2 (nesting depth added 3). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 486, 461, 438, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · jobflow.DeleteJobFlow (cognitive 22) · ×1
  • jobflow.DeleteJobFlow (cognitive 22) pkg/cli/jobflow/delete.go:58 — jobflow.DeleteJobFlow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobtemplate.DeleteJobTemplate (cognitive 22) · ×1
  • jobtemplate.DeleteJobTemplate (cognitive 22) pkg/cli/jobtemplate/delete.go:58 — jobtemplate.DeleteJobTemplate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.reclaimJobInDomains (cognitive 22) · ×1
  • Action.reclaimJobInDomains (cognitive 22) pkg/scheduler/actions/gangreclaim/gangreclaim.go:145 — Action.reclaimJobInDomains has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Action.normalPreempt (cognitive 22) · ×1
  • Action.normalPreempt (cognitive 22) REDACTED:340 — Action.normalPreempt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · SchedulerCache.getPodCSIVolumes (cognitive 22) · ×1
  • SchedulerCache.getPodCSIVolumes (cognitive 22) pkg/scheduler/cache/event_handlers.go:104 — SchedulerCache.getPodCSIVolumes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · framework.openSession (cognitive 22) · ×1
  • framework.openSession (cognitive 22) REDACTED:184 — framework.openSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · networkTopologyAwarePlugin.getSubJobHyperNodeBinPackingScore (cognitive 22) · ×1
  • networkTopologyAwarePlugin.getSubJobHyperNodeBinPackingScore (cognitive 22) pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:412 — networkTopologyAwarePlugin.getSubJobHyperNodeBinPackingScore has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (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.
D2 · Cognitive Complexity · predicateHelper.PredicateNodes (cognitive 22) · ×1
  • predicateHelper.PredicateNodes (cognitive 22) pkg/scheduler/util/predicate_helper.go:45 — predicateHelper.PredicateNodes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · hypernode.GetMembers (cognitive 22) · ×1
  • hypernode.GetMembers (cognitive 22) pkg/util/hypernode/member_selector.go:32 — hypernode.GetMembers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate.validateNamespaceQueueParentWorkloads (cognitive 22) · ×1
  • validate.validateNamespaceQueueParentWorkloads (cognitive 22) pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:389 — validate.validateNamespaceQueueParentWorkloads has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pod.ListPods (cognitive 21) · ×1
  • pod.ListPods (cognitive 21) pkg/cli/pod/pod.go:90 — pod.ListPods 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.
D2 · Cognitive Complexity · ufmDiscoverer.classifyLeafs (cognitive 21) · ×1
  • ufmDiscoverer.classifyLeafs (cognitive 21) REDACTED:349 — ufmDiscoverer.classifyLeafs has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (10 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · utils.runSimulateTrialAtHyperNode (cognitive 21) · ×1
  • utils.runSimulateTrialAtHyperNode (cognitive 21) pkg/scheduler/actions/utils/simulate.go:217 — utils.runSimulateTrialAtHyperNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.FormatHyperNodeFitSummary (cognitive 21) · ×1
  • api.FormatHyperNodeFitSummary (cognitive 21) pkg/scheduler/api/unschedule_info.go:164 — api.FormatHyperNodeFitSummary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchedulerCache.SyncNode (cognitive 21) · ×1
  • SchedulerCache.SyncNode (cognitive 21) pkg/scheduler/cache/event_handlers.go:803 — SchedulerCache.SyncNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Framework.NodeOrderMapFn (cognitive 20) · ×1
  • Framework.NodeOrderMapFn (cognitive 20) pkg/agentscheduler/framework/plugins.go:173 — Framework.NodeOrderMapFn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobflow.DescribeJobFlow (cognitive 20) · ×1
  • jobflow.DescribeJobFlow (cognitive 20) pkg/cli/jobflow/describe.go:57 — jobflow.DescribeJobFlow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobtemplate.DescribeJobTemplate (cognitive 20) · ×1
  • jobtemplate.DescribeJobTemplate (cognitive 20) pkg/cli/jobtemplate/describe.go:57 — jobtemplate.DescribeJobTemplate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TasksPriority.CalcPGMinResources (cognitive 20) · ×1
  • TasksPriority.CalcPGMinResources (cognitive 20) pkg/controllers/job/job_controller_util.go:364 — TasksPriority.CalcPGMinResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), 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.
D2 · Cognitive Complexity · pgcontroller.addReplicaSet (cognitive 20) · ×1
  • pgcontroller.addReplicaSet (cognitive 20) pkg/controllers/podgroup/pg_controller_handler.go:68 — pgcontroller.addReplicaSet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CPUResourceCollector.CollectLocalMetrics (cognitive 20) · ×1
  • CPUResourceCollector.CollectLocalMetrics (cognitive 20) pkg/metriccollect/local/cpu.go:57 — CPUResourceCollector.CollectLocalMetrics has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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.
D2 · Cognitive Complexity · Action.preemptJobInDomains (cognitive 20) · ×1
  • Action.preemptJobInDomains (cognitive 20) pkg/scheduler/actions/gangpreempt/gangpreempt.go:143 — Action.preemptJobInDomains has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobInfo.CheckTaskPipelined (cognitive 20) · ×1
  • JobInfo.CheckTaskPipelined (cognitive 20) pkg/scheduler/api/job_info.go:1222 — JobInfo.CheckTaskPipelined has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.NodeOrderMapFn (cognitive 20) · ×1
  • Session.NodeOrderMapFn (cognitive 20) pkg/scheduler/framework/session_plugins.go:1087 — Session.NodeOrderMapFn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CooldownProtectionPlugin.OnSessionOpen (cognitive 20) · ×1
  • CooldownProtectionPlugin.OnSessionOpen (cognitive 20) pkg/scheduler/plugins/cdp/cdp.go:74 — CooldownProtectionPlugin.OnSessionOpen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 75). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · numaaware.filterNodeByPolicy (cognitive 20) · ×1
  • numaaware.filterNodeByPolicy (cognitive 20) REDACTED:198 — numaaware.filterNodeByPolicy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resourcestrategyfit.Score (cognitive 20) · ×1
  • resourcestrategyfit.Score (cognitive 20) pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go:325 — resourcestrategyfit.Score has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 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.
D2 · Cognitive Complexity · validate.validateHierarchicalAttributes (cognitive 20) · ×1
  • validate.validateHierarchicalAttributes (cognitive 20) pkg/webhooks/admission/queues/validate/validate_queue.go:192 — validate.validateHierarchicalAttributes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.Run (cognitive 19) · ×1
  • app.Run (cognitive 19) cmd/hypernode-controller-manager/app/server.go:56 — app.Run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · JobInfo.SetJob (cognitive 19) · ×1
  • JobInfo.SetJob (cognitive 19) pkg/controllers/apis/job_info.go:87 — JobInfo.SetJob has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobCache.TaskFailed (cognitive 19) · ×1
  • jobCache.TaskFailed (cognitive 19) pkg/controllers/cache/cache.go:367 — jobCache.TaskFailed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (8 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.
D2 · Cognitive Complexity · cronjobcontroller.processCtlJobAndActiveJob (cognitive 19) · ×1
  • cronjobcontroller.processCtlJobAndActiveJob (cognitive 19) pkg/controllers/cronjob/cronjob_controller_handler.go:240 — cronjobcontroller.processCtlJobAndActiveJob has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2, 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.
D2 · Cognitive Complexity · sharding.ParseShardingConfig (cognitive 19) · ×1
  • sharding.ParseShardingConfig (cognitive 19) pkg/controllers/sharding/config.go:124 — sharding.ParseShardingConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShardingController.calculateMetricsFromPodsAndNode (cognitive 19) · ×1
  • ShardingController.calculateMetricsFromPodsAndNode (cognitive 19) pkg/controllers/sharding/node_utilization.go:106 — ShardingController.calculateMetricsFromPodsAndNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.aggregateAllContainerResourceRequests (cognitive 19) · ×1
  • api.aggregateAllContainerResourceRequests (cognitive 19) pkg/scheduler/api/pod_info.go:82 — api.aggregateAllContainerResourceRequests has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (api.aggregateAllContainerResourceLimits) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · api.aggregateAllContainerResourceLimits (cognitive 19) · ×1
  • api.aggregateAllContainerResourceLimits (cognitive 19) pkg/scheduler/api/pod_info.go:131 — api.aggregateAllContainerResourceLimits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (api.aggregateAllContainerResourceRequests) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Resource.LessEqualWithDimensionAndResourcesName (cognitive 19) · ×1
  • Resource.LessEqualWithDimensionAndResourcesName (cognitive 19) pkg/scheduler/api/resource_info.go:479 — Resource.LessEqualWithDimensionAndResourcesName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 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.
D2 · Cognitive Complexity · Session.PredicateForPreemptAction (cognitive 19) · ×1
  • Session.PredicateForPreemptAction (cognitive 19) REDACTED:696 — Session.PredicateForPreemptAction 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.
D2 · Cognitive Complexity · Session.PrePredicateFn (cognitive 19) · ×1
  • Session.PrePredicateFn (cognitive 19) pkg/scheduler/framework/session_plugins.go:989 — Session.PrePredicateFn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fairshare.CalculateFairShares (cognitive 19) · ×1
  • fairshare.CalculateFairShares (cognitive 19) pkg/scheduler/plugins/fairshare/fairshare.go:621 — fairshare.CalculateFairShares has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobManager.buildBucket (cognitive 19) · ×1
  • JobManager.buildBucket (cognitive 19) pkg/scheduler/plugins/task-topology/manager.go:259 — JobManager.buildBucket has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 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.
D2 · Cognitive Complexity · AdmissionServiceConfig.GetNamespaceQueuesByParent (cognitive 19) · ×1
  • AdmissionServiceConfig.GetNamespaceQueuesByParent (cognitive 19) pkg/webhooks/router/indexer.go:109 — AdmissionServiceConfig.GetNamespaceQueuesByParent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 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.
D2 · Cognitive Complexity · vjobs.PrintJobs (cognitive 18) · ×1
  • vjobs.PrintJobs (cognitive 18) pkg/cli/vjobs/view.go:326 — vjobs.PrintJobs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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.
D2 · Cognitive Complexity · JobInfo.UpdatePod (cognitive 18) · ×1
  • JobInfo.UpdatePod (cognitive 18) pkg/controllers/apis/job_info.go:163 — JobInfo.UpdatePod 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.
D2 · Cognitive Complexity · manager.processTopology (cognitive 18) · ×1
  • manager.processTopology (cognitive 18) pkg/controllers/hypernode/discovery/manager.go:382 — manager.processTopology has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 2 (6 pts), loops 1 (nesting depth added 11). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · hyperNodeController.reconcileTopology (cognitive 18) · ×1
  • hyperNodeController.reconcileTopology (cognitive 18) pkg/controllers/hypernode/hypernode_controller.go:190 — hyperNodeController.reconcileTopology has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 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.
D2 · Cognitive Complexity · jobcontroller.createOrUpdatePodGroup (cognitive 18) · ×1
  • jobcontroller.createOrUpdatePodGroup (cognitive 18) pkg/controllers/job/job_controller_actions.go:850 — jobcontroller.createOrUpdatePodGroup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShardingManager.initializePolicies (cognitive 18) · ×1
  • ShardingManager.initializePolicies (cognitive 18) pkg/controllers/sharding/sharding_manager.go:75 — ShardingManager.initializePolicies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preempt.pickOneNodeForPreemption (cognitive 18) · ×1
  • preempt.pickOneNodeForPreemption (cognitive 18) REDACTED:930 — preempt.pickOneNodeForPreemption has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts) (nesting depth added 8). 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.
D2 · Cognitive Complexity · utils.organizeEvictionWorksheet (cognitive 18) · ×1
  • utils.organizeEvictionWorksheet (cognitive 18) pkg/scheduler/actions/utils/simulate.go:158 — utils.organizeEvictionWorksheet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GPUDevices.Allocate (cognitive 18) · ×1
  • GPUDevices.Allocate (cognitive 18) pkg/scheduler/api/devices/nvidia/gpushare/device_info.go:213 — GPUDevices.Allocate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), 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.
D2 · Cognitive Complexity · GPUDevices.SubResource (cognitive 18) · ×1
  • GPUDevices.SubResource (cognitive 18) pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:247 — GPUDevices.SubResource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), 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.
D2 · Cognitive Complexity · api.NewResource (cognitive 18) · ×1
  • api.NewResource (cognitive 18) pkg/scheduler/api/resource_info.go:87 — api.NewResource 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). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobInfo.schedulingDimensions (cognitive 18) · ×1
  • JobInfo.schedulingDimensions (cognitive 18) pkg/scheduler/api/job_info.go:949 — JobInfo.schedulingDimensions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 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.
D2 · Cognitive Complexity · SchedulerCache.Snapshot (cognitive 18) · ×1
  • SchedulerCache.Snapshot (cognitive 18) pkg/scheduler/cache/cache.go:1632 — SchedulerCache.Snapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 6 (nesting depth added 5). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.SubJobPipelined (cognitive 18) · ×1
  • Session.SubJobPipelined (cognitive 18) pkg/scheduler/framework/session_plugins.go:461 — Session.SubJobPipelined 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.
D2 · Cognitive Complexity · Session.VictimTasks (cognitive 18) · ×1
  • Session.VictimTasks (cognitive 18) pkg/scheduler/framework/session_plugins.go:665 — Session.VictimTasks has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Configs.parseArguments (cognitive 18) · ×1
  • Configs.parseArguments (cognitive 18) pkg/scheduler/plugins/rescheduling/rescheduling.go:148 — Configs.parseArguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scheduler.UnmarshalSchedulerConf (cognitive 18) · ×1
  • scheduler.UnmarshalSchedulerConf (cognitive 18) pkg/scheduler/util.go:53 — scheduler.UnmarshalSchedulerConf 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.
D2 · Cognitive Complexity · unschedulable.gangMinimumsReachable (cognitive 18) · ×1
  • unschedulable.gangMinimumsReachable (cognitive 18) pkg/scheduler/unschedulable/hint.go:200 — unschedulable.gangMinimumsReachable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 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.
D2 · Cognitive Complexity · JobCache.candidateRecordsForIndexSnapshots (cognitive 18) · ×1
  • JobCache.candidateRecordsForIndexSnapshots (cognitive 18) pkg/scheduler/unschedulable/index.go:167 — JobCache.candidateRecordsForIndexSnapshots has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (6 pts), boolean chains 1 (nesting depth added 8). 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, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · hintRegistry.register (cognitive 18) · ×1
  • hintRegistry.register (cognitive 18) pkg/scheduler/unschedulable/registry.go:43 — hintRegistry.register has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · validate.validateChildrenConstraints (cognitive 18) · ×1
  • validate.validateChildrenConstraints (cognitive 18) pkg/webhooks/admission/queues/validate/validate_queue.go:707 — validate.validateChildrenConstraints has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), 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.
D2 · Cognitive Complexity · ServerOption.checkControllers (cognitive 17) · ×1
  • ServerOption.checkControllers (cognitive 17) cmd/controller-manager/app/options/options.go:158 — ServerOption.checkControllers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CPUBurstHandle.Handle (cognitive 17) · ×1
  • CPUBurstHandle.Handle (cognitive 17) pkg/agent/events/handlers/cpuburst/cpu_burst_linux.go:64 — CPUBurstHandle.Handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · policy.EvictPods (cognitive 17) · ×1
  • policy.EvictPods (cognitive 17) pkg/agent/oversubscription/policy/policy.go:100 — policy.EvictPods has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (nesting depth added 8). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 101). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cronjobcontroller.processConcurrencyPolicy (cognitive 17) · ×1
  • cronjobcontroller.processConcurrencyPolicy (cognitive 17) pkg/controllers/cronjob/cronjob_controller_handler.go:349 — cronjobcontroller.processConcurrencyPolicy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cronjobcontroller.createJob (cognitive 17) · ×1
  • cronjobcontroller.createJob (cognitive 17) pkg/controllers/cronjob/cronjob_controller_handler.go:382 — cronjobcontroller.createJob has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
D2 · Cognitive Complexity · Plugin.OnPodCreate (cognitive 17) · ×1
  • Plugin.OnPodCreate (cognitive 17) pkg/controllers/job/plugins/distributed-framework/mpi/mpi.go:87 — Plugin.OnPodCreate 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.
D2 · Cognitive Complexity · NetworkThrottlingConfig.CreateOrUpdateThrottlingConfig (cognitive 17) · ×1
  • NetworkThrottlingConfig.CreateOrUpdateThrottlingConfig (cognitive 17) REDACTED:141 — NetworkThrottlingConfig.CreateOrUpdateThrottlingConfig 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.
D2 · Cognitive Complexity · hami.selectDevicesWithTopology (cognitive 17) · ×1
  • hami.selectDevicesWithTopology (cognitive 17) pkg/scheduler/api/devices/ascend/hami/device_info.go:598 — hami.selectDevicesWithTopology has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HyperNodeIndex.OccupiedHyperNodes (cognitive 17) · ×1
  • HyperNodeIndex.OccupiedHyperNodes (cognitive 17) REDACTED:183 — HyperNodeIndex.OccupiedHyperNodes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobInfo.NeedContinueAllocating (cognitive 17) · ×1
  • JobInfo.NeedContinueAllocating (cognitive 17) pkg/scheduler/api/job_info.go:1101 — JobInfo.NeedContinueAllocating has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · framework.getPodGroupPhase (cognitive 17) · ×1
  • framework.getPodGroupPhase (cognitive 17) REDACTED:566 — framework.getPodGroupPhase 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.
D2 · Cognitive Complexity · Session.Allocatable (cognitive 17) · ×1
  • Session.Allocatable (cognitive 17) pkg/scheduler/framework/session_plugins.go:415 — Session.Allocatable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.JobPipelined (cognitive 17) · ×1
  • Session.JobPipelined (cognitive 17) pkg/scheduler/framework/session_plugins.go:518 — Session.JobPipelined has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 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.
D2 · Cognitive Complexity · Session.resolveHyperNodeGradients (cognitive 17) · ×1
  • Session.resolveHyperNodeGradients (cognitive 17) pkg/scheduler/framework/session_plugins.go:1205 — Session.resolveHyperNodeGradients has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (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.
D2 · Cognitive Complexity · Statement.Allocate (cognitive 17) · ×1
  • Statement.Allocate (cognitive 17) REDACTED:258 — Statement.Allocate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (nesting depth added 5). Of this number, 14 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.
D2 · Cognitive Complexity · numaPlugin.OnSessionOpen (cognitive 17) · ×1
  • numaPlugin.OnSessionOpen (cognitive 17) REDACTED:82 — numaPlugin.OnSessionOpen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 120, 175, 88, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tasktopology.affinityCheck (cognitive 17) · ×1
  • tasktopology.affinityCheck (cognitive 17) pkg/scheduler/plugins/task-topology/topology.go:243 — tasktopology.affinityCheck has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobManager.ApplyTaskTopology (cognitive 17) · ×1
  • JobManager.ApplyTaskTopology (cognitive 17) pkg/scheduler/plugins/task-topology/manager.go:112 — JobManager.ApplyTaskTopology has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 2 (4 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.
D2 · Cognitive Complexity · usagePlugin.OnSessionOpen (cognitive 17) · ×1
  • usagePlugin.OnSessionOpen (cognitive 17) pkg/scheduler/plugins/usage/usage.go:258 — usagePlugin.OnSessionOpen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cni.add (cognitive 16) · ×1
  • cni.add (cognitive 16) cmd/network-qos/cni/cni.go:131 — cni.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.Run (cognitive 16) · ×1
  • app.Run (cognitive 16) cmd/scheduler/app/server.go:54 — app.Run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 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.
D2 · Cognitive Complexity · monitor.detectCPUQuota (cognitive 16) · ×1
  • monitor.detectCPUQuota (cognitive 16) pkg/agent/events/probes/nodemonitor/node_monitor.go:226 — monitor.detectCPUQuota has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 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.
D2 · Cognitive Complexity · pod.CalculateExtendResources (cognitive 16) · ×1
  • pod.CalculateExtendResources (cognitive 16) pkg/agent/utils/pod/resources.go:53 — pod.CalculateExtendResources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · version.compareVersion (cognitive 16) · ×1
  • version.compareVersion (cognitive 16) pkg/agent/utils/version/compare.go:43 — version.compareVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pod.PrintPods (cognitive 16) · ×1
  • pod.PrintPods (cognitive 16) pkg/cli/pod/pod.go:168 — pod.PrintPods has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 4 (7 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · util.HumanDuration (cognitive 16) · ×1
  • util.HumanDuration (cognitive 16) pkg/cli/util/util.go:158 — util.HumanDuration 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.
D2 · Cognitive Complexity · cronjobcontroller.syncCronJob (cognitive 16) · ×1
  • cronjobcontroller.syncCronJob (cognitive 16) pkg/controllers/cronjob/cronjob_controller.go:219 — cronjobcontroller.syncCronJob 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.
D2 · Cognitive Complexity · labelDiscoverer.Start (cognitive 16) · ×1
  • labelDiscoverer.Start (cognitive 16) pkg/controllers/hypernode/discovery/label/label.go:120 — labelDiscoverer.Start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hyperNodeNameResolver.buildHyperNodeName (cognitive 16) · ×1
  • hyperNodeNameResolver.buildHyperNodeName (cognitive 16) pkg/controllers/hypernode/discovery/label/label.go:530 — hyperNodeNameResolver.buildHyperNodeName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobcontroller.AddDelayActionForJob (cognitive 16) · ×1
  • jobcontroller.AddDelayActionForJob (cognitive 16) pkg/controllers/job/job_controller.go:502 — jobcontroller.AddDelayActionForJob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 522). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · jobflowcontroller.getAllJobStatus (cognitive 16) · ×1
  • jobflowcontroller.getAllJobStatus (cognitive 16) pkg/controllers/jobflow/jobflow_controller_action.go:143 — jobflowcontroller.getAllJobStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · namespaceQueueController.computeChildrenAggregate (cognitive 16) · ×1
  • namespaceQueueController.computeChildrenAggregate (cognitive 16) REDACTED:146 — namespaceQueueController.computeChildrenAggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), 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.
D2 · Cognitive Complexity · pgcontroller.createOrUpdateNormalPodPG (cognitive 16) · ×1
  • pgcontroller.createOrUpdateNormalPodPG (cognitive 16) pkg/controllers/podgroup/pg_controller_handler.go:324 — pgcontroller.createOrUpdateNormalPodPG 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.
D2 · Cognitive Complexity · ClusterInfo.String (cognitive 16) · ×1
  • ClusterInfo.String (cognitive 16) pkg/scheduler/api/cluster_info.go:48 — ClusterInfo.String has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 4 (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.
D2 · Cognitive Complexity · NPUDevices.DeepCopy (cognitive 16) · ×1
  • NPUDevices.DeepCopy (cognitive 16) pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_info.go:248 — NPUDevices.DeepCopy has cognitive complexity 16 (threshold 15). Drivers by points: loops 13 (15 pts), if/else 1 (nesting depth added 2). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GPUDevices.addToPodMap (cognitive 16) · ×1
  • GPUDevices.addToPodMap (cognitive 16) pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:216 — GPUDevices.addToPodMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), 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.
D2 · Cognitive Complexity · vgpu.NewGPUDevices (cognitive 16) · ×1
  • vgpu.NewGPUDevices (cognitive 16) pkg/scheduler/api/devices/nvidia/vgpu/device_info.go:94 — vgpu.NewGPUDevices 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.
D2 · Cognitive Complexity · HyperNodesInfo.GetDescendants (cognitive 16) · ×1
  • HyperNodesInfo.GetDescendants (cognitive 16) pkg/scheduler/api/hyper_node_info.go:531 — HyperNodesInfo.GetDescendants has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HyperNodesInfo.GetRegexOrLabelMatchLeafHyperNodes (cognitive 16) · ×1
  • HyperNodesInfo.GetRegexOrLabelMatchLeafHyperNodes (cognitive 16) pkg/scheduler/api/hyper_node_info.go:606 — HyperNodesInfo.GetRegexOrLabelMatchLeafHyperNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobInfo.getJobAllocatedRoles (cognitive 16) · ×1
  • JobInfo.getJobAllocatedRoles (cognitive 16) pkg/scheduler/api/job_info.go:1152 — JobInfo.getJobAllocatedRoles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Resource.LessEqual (cognitive 16) · ×1
  • Resource.LessEqual (cognitive 16) pkg/scheduler/api/resource_info.go:439 — Resource.LessEqual 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). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Resource.LessEqualPartly (cognitive 16) · ×1
  • Resource.LessEqualPartly (cognitive 16) pkg/scheduler/api/resource_info.go:598 — Resource.LessEqualPartly 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). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.adjustNetworkTopologySpec (cognitive 16) · ×1
  • Session.adjustNetworkTopologySpec (cognitive 16) REDACTED:1064 — Session.adjustNetworkTopologySpec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Statement.Pipeline (cognitive 16) · ×1
  • Statement.Pipeline (cognitive 16) REDACTED:151 — Statement.Pipeline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resourcestrategyfit.calculateWeight (cognitive 16) · ×1
  • resourcestrategyfit.calculateWeight (cognitive 16) pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go:100 — resourcestrategyfit.calculateWeight has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slaPlugin.OnSessionOpen (cognitive 16) · ×1
  • slaPlugin.OnSessionOpen (cognitive 16) pkg/scheduler/plugins/sla/sla.go:84 — slaPlugin.OnSessionOpen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobManager.checkTaskSetAffinity (cognitive 16) · ×1
  • JobManager.checkTaskSetAffinity (cognitive 16) pkg/scheduler/plugins/task-topology/manager.go:223 — JobManager.checkTaskSetAffinity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resourcefit.RejectionKeys (cognitive 16) · ×1
  • resourcefit.RejectionKeys (cognitive 16) pkg/scheduler/plugins/util/resourcefit/resourcefit.go:97 — resourcefit.RejectionKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 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.
D2 · Cognitive Complexity · mutate.mutateSpec (cognitive 16) · ×1
  • mutate.mutateSpec (cognitive 16) pkg/webhooks/admission/jobs/mutate/mutate_job.go:186 — mutate.mutateSpec 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.
D2 · Cognitive Complexity · validate.validateIO (cognitive 16) · ×1
  • validate.validateIO (cognitive 16) pkg/webhooks/admission/jobs/validate/util.go:169 — validate.validateIO has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 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.
D22 · Internal API Consistency · `jobflow.PrintJobFlowDetail` takes no context.Context; its 5 sibling operations take one · ×1
  • `jobflow.PrintJobFlowDetail` takes no context.Context; its 5 sibling operations take one pkg/cli/jobflow/describe.go:105 — 5 of 6 fallible operations of `package jobflow` take a `ctx context.Context` (5 of 6). Siblings: jobflow.CreateJobFlow (pkg/cli/jobflow/create.go:51); jobflow.DeleteJobFlow (pkg/cli/jobflow/delete.go:58); jobflow.DescribeJobFlow (pkg/cli/jobflow/describe.go:57); jobflow.GetJobFlow (pkg/cli/jobflow/get.go:52); jobflow.ListJobFlow (pkg/cli/jobflow/list.go:65). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `jobtemplate.PrintJobTemplateDetail` takes no context.Context; its 5 sibling operations take one · ×1
  • `jobtemplate.PrintJobTemplateDetail` takes no context.Context; its 5 sibling operations take one pkg/cli/jobtemplate/describe.go:105 — 5 of 6 fallible operations of `package jobtemplate` take a `ctx context.Context` (5 of 6). Siblings: jobtemplate.CreateJobTemplate (pkg/cli/jobtemplate/create.go:51); jobtemplate.DeleteJobTemplate (pkg/cli/jobtemplate/delete.go:58); jobtemplate.DescribeJobTemplate (pkg/cli/jobtemplate/describe.go:57); jobtemplate.GetJobTemplate (pkg/cli/jobtemplate/get.go:52); jobtemplate.ListJobTemplate (pkg/cli/jobtemplate/list.go:56). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `framework.OpenSession` takes functional options (`opts ...Option`) where its 3 sibling constructors take a config struct · ×1
  • `framework.OpenSession` takes functional options (`opts ...Option`) where its 3 sibling constructors take a config struct pkg/scheduler/framework/framework.go:59 — 3 of 4 constructors of `package framework` that take options take a config struct (3 of 4). Siblings: framework.NewJobUpdater (REDACTED:47); framework.NewPodLister (pkg/scheduler/framework/util.go:66); framework.NewPodListerFromNode (pkg/scheduler/framework/util.go:98). Take a config struct, like the package's other constructors. [rule A7]
D22 · Internal API Consistency · `Framework.ListPlugins` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) · ×1
  • `Framework.ListPlugins` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) pkg/scheduler/plugins/util/k8s/framework.go:116 — 3 of 4 collection-returning members of `Framework` return a slice (`[]T`) (3 of 4). Siblings: Framework.RunScorePlugins (pkg/scheduler/plugins/util/k8s/framework.go:160); Framework.Extenders (pkg/scheduler/plugins/util/k8s/framework.go:204); Framework.VolcanoNodeInfos (pkg/scheduler/plugins/util/k8s/framework.go:249). Return a slice (`[]T`). [rule A4]
D22 · Internal API Consistency · `util.CalculateNumOfFeasibleNodesToFind` signals absence with a bare `T` (the zero value when absent) where its 4 sibling single-key reads use a nil `*T` · ×1
  • `util.CalculateNumOfFeasibleNodesToFind` signals absence with a bare `T` (the zero value when absent) where its 4 sibling single-key reads use a nil `*T` REDACTED:56 — 4 of 5 single-key reads of `package util` return a nil `*T` (4 of 5). Siblings: util.NewPredicateHelperWithFeasibleNodeTarget (pkg/scheduler/util/predicate_helper.go:166); util.NewFakeBinder (pkg/scheduler/util/test_utils.go:551); util.NewFakeEvictor (pkg/scheduler/util/test_utils.go:597); util.MakeQueue (pkg/scheduler/util/test_utils.go:669). Return a nil `*T` like its siblings. [rule A5]
D22 · Internal API Consistency · `util.BuildPodWithResourceClaim` takes (ns, name) where its 8 siblings take (name, ns) · ×1
  • `util.BuildPodWithResourceClaim` takes (ns, name) where its 8 siblings take (name, ns) pkg/scheduler/util/test_utils.go:99 — 8 of 9 members of `package util` with these two same-typed parameters take them in the order (name, ns) (8 of 9). Siblings: util.BuildPodGroup (pkg/scheduler/util/test_utils.go:343); util.BuildPodGroupWithSubGroupPolicy (pkg/scheduler/util/test_utils.go:388); util.BuildPodGroupWithNetWorkTopologies (pkg/scheduler/util/test_utils.go:401); util.BuildPodGroupUsingNetWorkTopologiesWithTierName (pkg/scheduler/util/test_utils.go:412); util.BuildPodGroupWithMinResources (pkg/scheduler/util/test_utils.go:423). Reorder to (name, ns); both are the same type, so the compiler cannot catch a swapped call. [rule A3]
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 45 shared lines) · ×1
  • Near-duplicate member family (3 members, 45 shared lines) cmd/agent-scheduler/app/server.go:50 — cmd/agent-scheduler/app/server.go:50-134 | cmd/controller-manager/app/server.go:50-134 | cmd/scheduler/app/server.go:54-152 — These 3 members are variants of one another: a block of 45 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.
D4 · Code Duplication · Near-duplicate member pair (38 shared lines) · ×1
  • Near-duplicate member pair (38 shared lines) pkg/scheduler/actions/gangpreempt/gangpreempt.go:189 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:189-259 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:194-258 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (19 shared lines) · ×1
  • Near-duplicate member pair (19 shared lines) pkg/cli/job/list.go:137 — pkg/cli/job/list.go:137-178 | pkg/cli/vjobs/view.go:326-373 — These two members are variants of one another: 19 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) REDACTED:259 — REDACTED:259-340 | pkg/scheduler/actions/utils/simulate.go:158-211 — 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 (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) pkg/cli/jobflow/delete.go:58 — pkg/cli/jobflow/delete.go:58-120 | pkg/cli/jobtemplate/delete.go:58-120 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copy of a member (61 corresponding lines) pkg/scheduler/actions/gangpreempt/gangpreempt.go:79 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:79-139 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:79-141 — 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 (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) pkg/scheduler/actions/gangpreempt/gangpreempt.go:143 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:143-187 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:145-192 — 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 (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) pkg/controllers/jobflow/jobflow_controller.go:89 — pkg/controllers/jobflow/jobflow_controller.go:89-133 | pkg/controllers/jobtemplate/jobtemplate_controller.go:83-121 — 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 · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) pkg/agentscheduler/scheduler.go:217 — pkg/agentscheduler/scheduler.go:217-267 | pkg/scheduler/scheduler.go:178-226 — 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) pkg/cli/jobflow/describe.go:57 — pkg/cli/jobflow/describe.go:57-102 | pkg/cli/jobtemplate/describe.go:57-102 — 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) pkg/networkqos/cni/config.go:54 — pkg/networkqos/cni/config.go:54-99 | pkg/networkqos/cni/config.go:101-144 — 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 copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) pkg/scheduler/api/node_info.go:536 — pkg/scheduler/api/node_info.go:536-572 | pkg/scheduler/api/node_info.go:575-606 — 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 (3 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 36+ corresponding lines) pkg/controllers/queue/state/closing.go:28 — pkg/controllers/queue/state/closing.go:28-63 | pkg/controllers/queue/state/open.go:28-63 | pkg/controllers/queue/state/unknown.go:28-63 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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 (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) pkg/cli/job/run.go:71 — pkg/cli/job/run.go:71-114 | pkg/cli/vsub/run.go:125-164 — 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 (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) pkg/cli/job/run.go:138 — pkg/cli/job/run.go:138-175 | pkg/cli/vsub/run.go:166-213 — 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 copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) pkg/scheduler/plugins/binpack/binpack.go:206 — pkg/scheduler/plugins/binpack/binpack.go:206-246 | pkg/scheduler/plugins/resource-strategy-fit/sra.go:94-127 — 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, 38+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 38+ corresponding lines) pkg/scheduler/framework/session_plugins.go:235 — pkg/scheduler/framework/session_plugins.go:235-281 | pkg/scheduler/framework/session_plugins.go:284-331 | pkg/scheduler/framework/session_plugins.go:335-372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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, 29+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 29+ corresponding lines) pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:69 — pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:69-102 | pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:63-91 | pkg/webhooks/admission/queues/mutate/mutate_queue.go:67-100 — 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 (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/controllers/jobflow/jobflow_controller.go:210 — pkg/controllers/jobflow/jobflow_controller.go:210-226 | pkg/controllers/jobtemplate/jobtemplate_controller.go:193-209 | pkg/controllers/queue/queue_controller.go:252-268 — 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.
D4 · Code Duplication · Edited copies of one member (4 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) pkg/scheduler/api/resource_info.go:403 — pkg/scheduler/api/resource_info.go:403-434 | pkg/scheduler/api/resource_info.go:439-473 | pkg/scheduler/api/resource_info.go:565-593 | pkg/scheduler/api/resource_info.go:598-629 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) pkg/controllers/job/job_controller_plugins.go:30 — pkg/controllers/job/job_controller_plugins.go:30-46 | pkg/controllers/job/job_controller_plugins.go:48-68 | pkg/controllers/job/job_controller_plugins.go:70-90 | pkg/controllers/job/job_controller_plugins.go:92-112 — 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 (8 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 22+ corresponding lines) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:56 — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:56-78 | pkg/webhooks/admission/jobflows/validate/validate_jobflow.go:44-65 | pkg/webhooks/admission/jobs/mutate/mutate_job.go:53-82 | pkg/webhooks/admission/jobs/validate/admit_job.go:60-83 | pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:44-67 | pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go:39-66 | pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:38-60 | pkg/webhooks/admission/queues/validate/validate_queue.go:51-74 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) pkg/cli/job/list.go:35 — pkg/cli/job/list.go:35-81 | pkg/cli/vjobs/view.go:39-91 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/controllers/garbagecollector/garbagecollector.go:96 — pkg/controllers/garbagecollector/garbagecollector.go:96-115 | pkg/controllers/namespacequeue/namespacequeue_controller.go:184-204 | pkg/controllers/queue/queue_controller.go:175-198 — 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, 19+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 19+ corresponding lines) cmd/network-qos/tools/get.go:41 — cmd/network-qos/tools/get.go:41-59 | cmd/network-qos/tools/prepare.go:40-61 | cmd/network-qos/tools/reset.go:40-58 | cmd/network-qos/tools/set.go:37-57 | cmd/network-qos/tools/status.go:39-57 — 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 (5 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 20+ corresponding lines) pkg/agentscheduler/framework/plugins.go:127 — pkg/agentscheduler/framework/plugins.go:127-146 | pkg/agentscheduler/framework/plugins.go:149-170 | pkg/scheduler/framework/session_plugins.go:1037-1056 | pkg/scheduler/framework/session_plugins.go:1059-1080 | pkg/scheduler/framework/session_plugins.go:1115-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.
D4 · Code Duplication · Edited copies of one member (6 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 16+ corresponding lines) cmd/cli/vcancel/main.go:28 — cmd/cli/vcancel/main.go:28-43 | cmd/cli/vjobs/main.go:28-43 | cmd/cli/vqueues/main.go:28-43 | cmd/cli/vresume/main.go:28-43 | cmd/cli/vsub/main.go:28-43 | cmd/cli/vsuspend/main.go:28-43 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:213 — pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:213-229 | pkg/scheduler/plugins/util/hintutil/hintutil.go:66-81 | pkg/scheduler/plugins/util/hintutil/hintutil.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 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/agentscheduler/actions/allocate/allocate.go:267 — pkg/agentscheduler/actions/allocate/allocate.go:267-275 | REDACTED:1278-1291 | pkg/scheduler/actions/utils/simulate.go:284-291 — 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 (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) pkg/agentscheduler/framework/plugins.go:84 — pkg/agentscheduler/framework/plugins.go:84-102 | pkg/agentscheduler/framework/plugins.go:105-124 | pkg/scheduler/framework/session_plugins.go:890-907 | pkg/scheduler/framework/session_plugins.go:929-946 — 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 (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/controllers/cronjob/cronjob_controller.go:131 — pkg/controllers/cronjob/cronjob_controller.go:131-143 | pkg/controllers/jobflow/jobflow_controller.go:135-151 | pkg/controllers/jobtemplate/jobtemplate_controller.go:123-139 — 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 (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) cmd/cli/job.go:26 — cmd/cli/job.go:26-36 | cmd/cli/jobflow.go:26-36 | cmd/cli/jobtemplate.go:26-36 | cmd/cli/queue.go:26-37 — 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 (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/controllers/jobflow/jobflow_controller.go:228 — pkg/controllers/jobflow/jobflow_controller.go:228-236 | pkg/controllers/jobtemplate/jobtemplate_controller.go:211-219 | pkg/controllers/queue/queue_controller_handler.go:179-187 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) pkg/agentscheduler/cache/cache.go:283 — pkg/agentscheduler/cache/cache.go:283-285 | pkg/controllers/cronjob/injection.go:44-48 | pkg/scheduler/cache/cache.go:366-368 — 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.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 4+ corresponding lines) pkg/agentscheduler/actions/allocate/allocate.go:65 — pkg/agentscheduler/actions/allocate/allocate.go:65-69 | REDACTED:139-142 | REDACTED:55-58 | REDACTED:52-55 — 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 · Duplicated block (109 lines × 2) · ×1
  • Duplicated block (109 lines × 2) pkg/cli/job/view.go:90 — pkg/cli/job/view.go:90-198 | pkg/cli/vjobs/view.go:131-239 — `pkg/cli/job/view.go` and `pkg/cli/vjobs/view.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 5 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.
D4 · Code Duplication · Duplicated block (32–38 lines × 3) · ×1
  • Duplicated block (32–38 lines × 3) pkg/scheduler/framework/session_plugins.go:244 — pkg/scheduler/framework/session_plugins.go:244-281 | pkg/scheduler/framework/session_plugins.go:294-331 | pkg/scheduler/framework/session_plugins.go:341-372 — 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 `pkg/scheduler/framework/session_plugins.go:244` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) pkg/cli/job/list.go:48 — pkg/cli/job/list.go:48-79 | pkg/cli/vjobs/view.go:58-89 — before extracting anything, compare `pkg/cli/job/list.go` and `pkg/cli/vjobs/view.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `pkg/cli/job/list.go: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.
D4 · Code Duplication · Duplicated block (26–30 lines × 3) · ×1
  • Duplicated block (26–30 lines × 3) pkg/scheduler/plugins/capacity/capacity.go:1131 — pkg/scheduler/plugins/capacity/capacity.go:1131-1159 | pkg/scheduler/plugins/capacity/capacity.go:1268-1293 | pkg/scheduler/plugins/proportion/proportion.go:156-185 — 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 `pkg/scheduler/plugins/capacity/capacity.go:1131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) pkg/agentscheduler/cache/cache.go:433 — pkg/agentscheduler/cache/cache.go:433-461 | pkg/scheduler/cache/cache.go:709-737 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) pkg/agentscheduler/scheduler.go:235 — pkg/agentscheduler/scheduler.go:235-262 | pkg/scheduler/scheduler.go:193-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/agentscheduler/scheduler.go:235` 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, `pkg/scheduler/scheduler.go:192` calls `logLoadedSchedulerConf` and `pkg/agentscheduler/scheduler.go:234` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:88 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:88-115 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:88-114 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 `pkg/scheduler/actions/gangpreempt/gangpreempt.go: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.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) cmd/agent-scheduler/app/server.go:109 — cmd/agent-scheduler/app/server.go:109-134 | cmd/controller-manager/app/server.go:109-134 | cmd/scheduler/app/server.go:127-152 — before extracting anything, compare `cmd/agent-scheduler/app/server.go` and `cmd/controller-manager/app/server.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/agent-scheduler/app/server.go:109` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) REDACTED:262 — REDACTED:262-286 | pkg/scheduler/actions/utils/simulate.go:159-180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:322 — pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:322-345 | pkg/scheduler/plugins/network-topology-aware/network_topology_aware.go:707-731 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) pkg/controllers/queue/state/closed.go:37 — pkg/controllers/queue/state/closed.go:37-58 | pkg/controllers/queue/state/unknown.go:41-63 — 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 `pkg/controllers/queue/state/closed.go: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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) pkg/controllers/sharding/policy/arguments.go:42 — pkg/controllers/sharding/policy/arguments.go:42-63 | pkg/scheduler/framework/arguments.go:59-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) pkg/scheduler/uthelper/helper.go:266 — pkg/scheduler/uthelper/helper.go:266-286 | pkg/scheduler/uthelper/helper.go:395-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–19 lines × 4) · ×1
  • Duplicated block (18–19 lines × 4) cmd/agent-scheduler/app/options/options.go:151 — cmd/agent-scheduler/app/options/options.go:151-169 | cmd/controller-manager/app/options/options.go:182-200 | cmd/scheduler/app/options/options.go:250-268 | cmd/webhook-manager/app/options/options.go:136-153 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) pkg/scheduler/actions/gangpreempt/gangpreempt.go:157 — pkg/scheduler/actions/gangpreempt/gangpreempt.go:157-175 | pkg/scheduler/actions/gangreclaim/gangreclaim.go:162-180 — `pkg/scheduler/actions/gangpreempt/gangpreempt.go` and `pkg/scheduler/actions/gangreclaim/gangreclaim.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 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 `pkg/scheduler/actions/gangpreempt/gangpreempt.go:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) pkg/scheduler/api/pod_info.go:107 — pkg/scheduler/api/pod_info.go:107-125 | pkg/scheduler/api/pod_info.go:156-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/scheduler/api/pod_info.go: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/scheduler/api/pod_info.go:126` calls `AddScalar` and `pkg/scheduler/api/pod_info.go:172` 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) REDACTED:1183 — REDACTED:1183-1199 | pkg/scheduler/actions/utils/simulate.go:323-340 — 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:1183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) cmd/agent-scheduler/main.go:63 — cmd/agent-scheduler/main.go:63-79 | cmd/controller-manager/main.go:89-104 | cmd/scheduler/main.go:65-81 — `cmd/agent-scheduler/main.go` and `cmd/scheduler/main.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 2 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/agent-scheduler/main.go:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) pkg/scheduler/api/job_info.go:659 — pkg/scheduler/api/job_info.go:659-675 | pkg/scheduler/api/pod_info.go:206-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) pkg/controllers/job/job_controller_handler.go:166 — pkg/controllers/job/job_controller_handler.go:166-181 | pkg/controllers/job/job_controller_handler.go:257-272 | pkg/controllers/job/job_controller_handler.go:368-383 — 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 `pkg/controllers/job/job_controller_handler.go: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.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) pkg/scheduler/plugins/conformance/conformance.go:48 — pkg/scheduler/plugins/conformance/conformance.go:48-63 | pkg/scheduler/plugins/conformance/conformance.go:69-79 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) pkg/scheduler/plugins/predicates/predicates.go:696 — pkg/scheduler/plugins/predicates/predicates.go:696-708 | pkg/scheduler/plugins/predicates/predicates.go:750-765 — both copies are in the same file, so extract the 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 `pkg/scheduler/plugins/predicates/predicates.go:696` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) pkg/scheduler/api/pod_info.go:322 — pkg/scheduler/api/pod_info.go:322-336 | pkg/scheduler/api/pod_info.go:353-366 — both copies are in the same file, so extract the 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 `pkg/scheduler/api/pod_info.go:322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) pkg/scheduler/cache/util.go:77 — pkg/scheduler/cache/util.go:77-91 | pkg/scheduler/cache/util.go:115-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/scheduler/cache/util.go:114` calls `responsibleForPodGroup` and `pkg/scheduler/cache/util.go:76` 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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) pkg/agentscheduler/cache/cache.go:543 — pkg/agentscheduler/cache/cache.go:543-556 | pkg/agentscheduler/cache/cache_mock.go:140-153 | pkg/scheduler/cache/cache.go:923-936 | pkg/scheduler/cache/cache_mock.go:191-204 — before extracting anything, compare `pkg/agentscheduler/cache/cache.go` and `pkg/scheduler/cache/cache.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 200 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 `pkg/scheduler/cache/cache.go:923` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:217 — pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:217-229 | pkg/scheduler/plugins/util/hintutil/hintutil.go:68-81 | pkg/scheduler/plugins/util/hintutil/hintutil.go:89-102 — 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 `pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:217` 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, `pkg/scheduler/plugins/util/hintutil/hintutil.go:87` calls `UsageReleasedForRequest` and `pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go:216` 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.
D4 · Code Duplication · Duplicated block (3–14 lines × 3) · ×1
  • Duplicated block (3–14 lines × 3) pkg/controllers/job/job_controller_actions.go:475 — pkg/controllers/job/job_controller_actions.go:475-487 | pkg/controllers/job/job_controller_actions.go:667-680 | pkg/controllers/job/job_controller_actions.go:1039-1041 — 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 `pkg/controllers/job/job_controller_actions.go:475` 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. 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, `pkg/controllers/job/job_controller_actions.go:475` calls `BatchV1alpha1`, `Jobs`, `UpdateStatus` and `pkg/controllers/job/job_controller_actions.go:1039` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) pkg/scheduler/plugins/capacity/capacity.go:761 — pkg/scheduler/plugins/capacity/capacity.go:761-774 | pkg/scheduler/plugins/proportion/proportion.go:412-424 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/scheduler/plugins/capacity/capacity.go:757` calls `isLeafQueue` and `pkg/scheduler/plugins/proportion/proportion.go:411` 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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) pkg/controllers/podgroup/pg_controller_handler.go:297 — pkg/controllers/podgroup/pg_controller_handler.go:297-317 | pkg/controllers/podgroup/pg_controller_handler.go:328-347 — both copies are in the same file, so extract the 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 `pkg/controllers/podgroup/pg_controller_handler.go: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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) cmd/agent-scheduler/app/server.go:96 — cmd/agent-scheduler/app/server.go:96-107 | cmd/controller-manager/app/server.go:96-107 | cmd/scheduler/app/server.go:114-125 — before extracting anything, compare `cmd/agent-scheduler/app/server.go` and `cmd/controller-manager/app/server.go` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) pkg/controllers/apis/job_info.go:127 — pkg/controllers/apis/job_info.go:127-138 | pkg/controllers/apis/job_info.go:165-175 — both copies are in the same file, so extract the 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 `pkg/controllers/apis/job_info.go:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) pkg/agent/utils/pod/resources.go:54 — pkg/agent/utils/pod/resources.go:54-64 | pkg/agent/utils/pod/resources.go:157-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/agent/utils/pod/resources.go:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) REDACTED:288 — REDACTED:288-298 | pkg/scheduler/actions/utils/simulate.go:182-191 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) pkg/controllers/podgroup/pg_controller_handler.go:79 — pkg/controllers/podgroup/pg_controller_handler.go:79-87 | pkg/controllers/podgroup/pg_controller_handler.go:130-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/controllers/podgroup/pg_controller_handler.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/controllers/podgroup/pg_controller_handler.go:77` calls `V`, `Infof` and `pkg/controllers/podgroup/pg_controller_handler.go:129` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) pkg/scheduler/cache/cache.go:372 — pkg/scheduler/cache/cache.go:372-379 | pkg/scheduler/cache/cache.go:454-460 — both copies are in the same file, so extract the 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 `pkg/scheduler/cache/cache.go:372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (1–7 lines × 4) · ×1
  • Duplicated block (1–7 lines × 4) pkg/cli/job/list.go:168 — pkg/cli/job/list.go:168-168 | pkg/cli/job/list.go:172-178 | pkg/cli/vjobs/view.go:363-363 | pkg/cli/vjobs/view.go:367-373 — before extracting anything, compare `pkg/cli/job/list.go` and `pkg/cli/vjobs/view.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `pkg/cli/job/list.go: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) cmd/agent-scheduler/app/options/options.go:172 — cmd/agent-scheduler/app/options/options.go:172-183 | cmd/controller-manager/app/options/options.go:203-214 | cmd/scheduler/app/options/options.go:271-282 | cmd/webhook-manager/app/options/options.go:156-167 — 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 after the matched lines, `cmd/scheduler/app/options/options.go:286` calls `Do` and `cmd/agent-scheduler/app/options/options.go: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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) cmd/cli/job.go:79 — cmd/cli/job.go:79-92 | cmd/cli/jobflow.go:72-85 | cmd/cli/jobtemplate.go:72-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cli/job.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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) pkg/cli/job/delete.go:41 — pkg/cli/job/delete.go:41-45 | pkg/cli/job/resume.go:39-44 | pkg/cli/job/suspend.go:39-44 | pkg/cli/job/view.go:56-61 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) pkg/scheduler/uthelper/helper.go:268 — pkg/scheduler/uthelper/helper.go:268-278 | pkg/scheduler/uthelper/helper.go:306-316 | pkg/scheduler/uthelper/helper.go:397-407 — 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 `pkg/scheduler/uthelper/helper.go:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:60 — pkg/webhooks/admission/cronjobs/validate/admit_cronjob.go:60-68 | pkg/webhooks/admission/hypernodes/validate/admit_hypernode.go:40-48 | pkg/webhooks/admission/jobflows/validate/validate_jobflow.go:47-54 | pkg/webhooks/admission/jobs/validate/admit_job.go:64-72 | pkg/webhooks/admission/podgroups/validate/validate_podgroup.go:41-49 — 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 `pkg/webhooks/admission/cronjobs/validate/admit_cronjob.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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) pkg/agentscheduler/cache/cache.go:538 — pkg/agentscheduler/cache/cache.go:538-542 | pkg/agentscheduler/cache/cache_mock.go:135-139 | pkg/scheduler/cache/cache_mock.go:185-189 — 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 `pkg/agentscheduler/cache/cache.go:538` 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 (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) REDACTED:60 — REDACTED:60-89 | REDACTED:91-124 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: Snapshot (LCOM4 5) pkg/scheduler/plugins/util/k8s/snapshot.go:46 — Snapshot's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Minor — 336 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×171
  • Orphaned file pkg/scheduler/plugins/drf/drf.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/agent/utils/cgroup/cgroup.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/cronjob/cronjob_controller_handler.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/sharding/config.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/type.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/scheduler/plugins/extender/extender.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/cli/vjobs/view.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/cronjob/cronjob_controller_util.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/sharding/test_utils.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/sharding/sharding_manager.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/agentscheduler/actions/allocate/allocate.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/cronjob/cronjob_controller.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/scheduler/plugins/tdm/tdm.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/jobflow/jobflow_controller_action.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/cli/job/view.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file cmd/controller-manager/app/options/options.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/queue/queue_controller.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/scheduler/plugins/task-topology/manager.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/garbagecollector/garbagecollector.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/scheduler/plugins/task-topology/topology.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file staging/src/volcano.sh/apis/pkg/apis/helpers/helpers.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/job/plugins/distributed-framework/ray/ray.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/controllers/colocationconfig/colocation_config_controller_handler.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 146 more in this group — see findings.md.
D31 · IaC & Container Security · Low IaC · ×77
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 52 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×29
  • Duplicated predicate pkg/scheduler/cache/util.go:46 — `commonutil.HasNamespaceQueuePrefix(reference) && !utilfeature.DefaultFeatureGate.Enabled(features.NamespaceQueue)` appears character-identically in 2 files — pkg/scheduler/cache/util.go, pkg/webhooks/util/queue_reference.go. 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 pkg/controllers/job/job_controller_util.go:340 — `controllerRef.APIVersion == gvk.GroupVersion().String() && controllerRef.Kind == gvk.Kind` appears character-identically in 2 files — pkg/controllers/job/job_controller_util.go, pkg/controllers/jobflow/jobflow_controller_util.go. 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 pkg/controllers/colocationconfig/colocation_config_controller_handler.go:237 — `err != nil && !apierrors.IsNotFound(err)` appears character-identically in 4 files — pkg/controllers/colocationconfig/colocation_config_controller_handler.go, pkg/controllers/job/job_controller_actions.go, pkg/controllers/job/job_controller_resync.go, pkg/controllers/podgroup/pg_controller_handler.go. 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 pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go:280 — `err == nil && resolvedParentRef == parentRef` appears character-identically in 2 files — pkg/webhooks/admission/namespacequeues/validate/validate_namespacequeue.go, pkg/webhooks/router/indexer.go. 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 pkg/agentscheduler/cache/cache_mock.go:92 — `err == nil && threads > 0 && threads <= math.MaxUint32` appears character-identically in 2 files — pkg/agentscheduler/cache/cache_mock.go, pkg/scheduler/cache/cache_mock.go. 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 cmd/network-qos/cni/cni.go:135 — `errors.Is(err, cilliumbpf.ErrKeyNotExist) || os.IsNotExist(err)` appears character-identically in 5 files — cmd/network-qos/cni/cni.go, cmd/network-qos/tools/get.go, cmd/network-qos/tools/reset.go, cmd/network-qos/tools/status.go. 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 REDACTED:1052 — `fitErrors != nil && ssn.RejectionTrackingEnabled()` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate pkg/scheduler/api/node_info.go:377 — `gpushare.GpuSharingEnable || gpushare.GpuNumberEnable` appears character-identically in 2 files — pkg/scheduler/api/node_info.go, pkg/scheduler/plugins/deviceshare/deviceshare.go. 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 pkg/agentscheduler/cache/cache.go:296 — `index < 0 || index >= (nodeSelectorLabelLen-1)` appears character-identically in 2 files — pkg/agentscheduler/cache/cache.go, pkg/scheduler/cache/cache.go. 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 REDACTED:853 — `job.ContainsHardTopology() || job.ContainsHardPodGroupAntiAffinity()` appears character-identically in 2 files — REDACTED, pkg/scheduler/actions/utils/simulate.go. 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 pkg/scheduler/plugins/capacity/capacity.go:1153 — `job.PodGroup.Status.Phase == scheduling.PodGroupRunning && job.PodGroup.Spec.MinResources != nil && int32(util.CalculateAllocatedTaskNum(job…` appears character-identically in 3 files — pkg/scheduler/plugins/capacity/capacity.go, pkg/scheduler/plugins/overcommit/overcommit.go, pkg/scheduler/plugins/proportion/proportion.go. 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 pkg/scheduler/actions/gangpreempt/gangpreempt.go:191 — `len(domainNodes) == 0 || len(pendingTasks) == 0` appears character-identically in 2 files — pkg/scheduler/actions/gangpreempt/gangpreempt.go, pkg/scheduler/actions/gangreclaim/gangreclaim.go. 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 pkg/scheduler/api/hyper_node_info.go:861 — `len(selector.LabelMatch.MatchLabels) == 0 && len(selector.LabelMatch.MatchExpressions) == 0` appears character-identically in 2 files — pkg/scheduler/api/hyper_node_info.go, pkg/util/hypernode/member_selector.go. 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 pkg/controllers/jobflow/state/pending.go:37 — `len(status.FailedJobs) > 0 || len(status.TerminatedJobs) > 0` appears character-identically in 2 files — pkg/controllers/jobflow/state/pending.go, pkg/controllers/jobflow/state/running.go. 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 pkg/webhooks/admission/jobs/validate/admit_job.go:263 — `networkTopology != nil && networkTopology.HighestTierAllowed != nil && networkTopology.HighestTierName != ""` appears character-identically in 2 files — pkg/webhooks/admission/jobs/validate/admit_job.go, pkg/webhooks/admission/podgroups/validate/validate_podgroup.go. 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 pkg/controllers/sharding/pod_events.go:51 — `oldPod.Spec.NodeName == "" && newPod.Spec.NodeName != ""` appears character-identically in 2 files — pkg/controllers/sharding/pod_events.go, pkg/scheduler/cache/event_handlers.go. 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 pkg/agentscheduler/cache/cache_mock.go:115 — `options.ServerOpts != nil && len(options.ServerOpts.NodeSelector) > 0` appears character-identically in 2 files — pkg/agentscheduler/cache/cache_mock.go, pkg/scheduler/cache/cache_mock.go. 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 pkg/agentscheduler/cache/cache.go:427 — `options.ServerOpts != nil && options.ServerOpts.EnableCSIStorage` appears character-identically in 2 files — pkg/agentscheduler/cache/cache.go, pkg/scheduler/cache/cache.go. 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 pkg/agentscheduler/cache/cache_mock.go:88 — `options.ServerOpts != nil && options.ServerOpts.NodeWorkerThreads > 0` appears character-identically in 2 files — pkg/agentscheduler/cache/cache_mock.go, pkg/scheduler/cache/cache_mock.go. 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 pkg/scheduler/api/devices/nvidia/gpushare/share.go:217 — `pod.Status.Phase == v1.PodSucceeded || pod.Status.Phase == v1.PodFailed` appears character-identically in 2 files — pkg/scheduler/api/devices/nvidia/gpushare/share.go, pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go. 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 pkg/controllers/queue/queue_controller_action.go:224 — `queue.Spec.Parent != "" && queue.Spec.Parent != "root"` appears character-identically in 2 files — pkg/controllers/queue/queue_controller_action.go, pkg/webhooks/admission/queues/validate/validate_queue.go. 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 cmd/agent-scheduler/main.go:78 — `s.CaCertFile != "" && s.CertFile != "" && s.KeyFile != ""` appears character-identically in 3 files — cmd/agent-scheduler/main.go, cmd/controller-manager/main.go, cmd/scheduler/main.go. 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 pkg/agentscheduler/cache/event_handlers.go:99 — `sc.allocatedPodInCache(newPod) && newPod.Spec.NodeName == ""` appears character-identically in 2 files — pkg/agentscheduler/cache/event_handlers.go, pkg/scheduler/cache/event_handlers.go. 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 REDACTED:1189 — `shardingMode == commonutil.SoftShardingMode && !ssn.NodesInShard.Has(n.Name)` appears character-identically in 2 files — REDACTED, pkg/scheduler/actions/utils/simulate.go. 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 pkg/agentscheduler/cache/event_handlers.go:47 — `status == schedulingapi.Succeeded || status == schedulingapi.Failed` appears character-identically in 2 files — pkg/agentscheduler/cache/event_handlers.go, pkg/scheduler/cache/event_handlers.go. 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.
  • + 4 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D8 · Code Coverage · Tests reach code only in some runs · ×10
  • Tests reach code only in some runs: pkg/controllers/hypernode/discovery/manager.go pkg/controllers/hypernode/discovery/manager.go:425 — 2 line(s) (425-426) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: REDACTED REDACTED:208 — 5 line(s) (208-210, 245-246) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: REDACTED REDACTED:118 — 2 line(s) (118-119) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: pkg/scheduler/cache/cache.go pkg/scheduler/cache/cache.go:965 — 8 line(s) (965-966, 1390-1391, 1408-1411) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: pkg/scheduler/cache/event_handlers.go pkg/scheduler/cache/event_handlers.go:304 — 7 line(s) (304-306, 566-569) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: pkg/scheduler/plugins/fairshare/fairshare.go pkg/scheduler/plugins/fairshare/fairshare.go:370 — 3 line(s) (370-372) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: pkg/scheduler/plugins/priority/priority.go pkg/scheduler/plugins/priority/priority.go:79 — 2 line(s) (79-80) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: pkg/scheduler/uthelper/helper.go pkg/scheduler/uthelper/helper.go:249 — 5 line(s) (249-250, 309, 349-350) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: third_party/kubernetes/pkg/scheduler/backend/queue/backoff_queue.go third_party/kubernetes/pkg/scheduler/backend/queue/backoff_queue.go:159 — 10 line(s) (159, 164-166, 169, 172-173, 179, 181-182) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: third_party/kubernetes/pkg/scheduler/backend/queue/scheduling_queue.go third_party/kubernetes/pkg/scheduler/backend/queue/scheduling_queue.go:405 — 2 line(s) (405-406) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file pkg/controllers/sharding/sharding_controller.go:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D41 · Kernel & Syscall Confinement · No seccomp profile · ×3
  • No seccomp profile REDACTED:213 — 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.
  • No seccomp profile REDACTED:412 — 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.
  • No seccomp profile REDACTED:530 — 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.
AX6 · Interface segregation · Fat interface · ×2
  • Fat interface: Cache (24 methods) pkg/agentscheduler/cache/interface.go:45 — `Cache` declares 24 methods: `Run`, `Snapshot`, `WaitForCacheSync`, `AddBindTask`, `RecordCandidateNodesInBinder`, `RemoveCandidateNodesFromBinder`, `Client`, `VCClient`, `ClientConfig`, `UpdateSchedulerNumaInfo`, `SharedInformerFactory`, `VCSharedInformerFactory`, `SetMetricsConf`, `EventRecorder`, `RegisterBinder`, `SharedDRAManager`, `UpdateSnapshot`, `TaskUnschedulable`, `EnqueueScheduleResult`, `SchedulingQueue`, `GetTaskInfo`, `UpdateNodeShardStatus`, `OnWorkerStartSchedulingCycle`, `OnWorkerEndSchedulingCycle`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: Cache (23 methods) pkg/scheduler/cache/interface.go:41 — `Cache` declares 23 methods: `Run`, `Snapshot`, `WaitForCacheSync`, `AddBindTask`, `BindPodGroup`, `Evict`, `RecordJobStatusEvent`, `UpdateJobStatus`, `UpdateQueueStatus`, `Client`, `VCClient`, `ClientConfig`, `AddUnassignedNumaPods`, `SharedInformerFactory`, `SetMetricsConf`, `GetMetricsConf`, `EventRecorder`, `RegisterBinder`, `SharedDRAManager`, `IsJobTerminated`, `UpdateNodeShardStatus`, `OnSessionOpen`, `OnSessionClose`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 8 significant file(s) lose their only recent owner: pkg/scheduler/unschedulable/cache.go, pkg/scheduler/unschedulable/hint.go, pkg/scheduler/plugins/util/resourcefit/resourcefit.go, pkg/scheduler/plugins/predicates/hintprovider/resource_fit_provider.go, benchmark/testcases/util/util.go, pkg/scheduler/unschedulable/registry.go, pkg/agentscheduler/metrics/metrics.go, pkg/webhooks/router/server.go. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/controllers/hypernode/discovery/manager.go, cmd/hypernode-controller-manager/app/server.go, cmd/hypernode-controller-manager/app/options/options.go, pkg/controllers/job/job_controller_resync.go. Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Silent fallback default on error · ×2
  • Silent fallback default on error pkg/agent/utils/cgroup/cgroup.go:202 — `parseKubeletConfig` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error pkg/scheduler/plugins/group-topology-affinity/group_topology_affinity.go:73 — `OnSessionOpen` turns a non-nil `err` into `return api.HyperNodeGradientResult{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 8 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (22 single-owned of 340 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 340 of the 764 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: pkg/scheduler/plugins/fairshare/persist.go, pkg/scheduler/metrics/namespace.go, pkg/scheduler/api/devices/device_info.go, pkg/webhooks/config/config.go, pkg/cli/jobflow/describe.go, pkg/scheduler/gate/schedulinggate.go, pkg/controllers/job/plugins/svc/svc.go, pkg/controllers/job/plugins/distributed-framework/tensorflow/tensorflow.go (+2 more).
D20 · ADR Quality · ADR has no Decision section · ×1
  • ADR has no Decision section docs/design/evictablefn-evolution-for-gang-eviction.md:1 — docs/design/evictablefn-evolution-for-gang-eviction.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality · ADR considers only one option · ×1
  • ADR considers only one option docs/design/resource-strategy-fit-scheduling.md:257 — `docs/design/resource-strategy-fit-scheduling.md:257` lists one option, one sub-heading, so the record shows no choice being made. List the alternatives that were rejected and why, or remove the section.
D21 · Naming Consistency · `CgroupCpuSubsystem` spells `Cpu` where 93 names in the project spell it `CPU` · ×1
  • `CgroupCpuSubsystem` spells `Cpu` where 93 names in the project spell it `CPU` pkg/agent/utils/cgroup/cgroup.go:47 — 93 of 95 names in project volcano.sh/volcano spell the token `CPU` (93 of 95; unit: names in project volcano.sh/volcano containing `CPU`). Peers: VolcanoAgentOptions.ExtendResourceCPUName (cmd/agent/app/options/options.go:74); apis.NodeOverSubscriptionCPUKey (pkg/agent/apis/types.go:30); apis.PodEvictedOverSubscriptionCPUHighWaterMarkKey (pkg/agent/apis/types.go:49); apis.PodEvictedOverSubscriptionCPULowWaterMarkKey (pkg/agent/apis/types.go:55); apis.PodEvictedCPUHighWaterMarkKey (pkg/agent/apis/types.go:61). Rename to `CgroupCPUSubsystem`. [rule N6]
D21 · Naming Consistency · `JobUid` spells `Uid` where 24 names in the project spell it `UID` · ×1
  • `JobUid` spells `Uid` where 24 names in the project spell it `UID` pkg/controllers/apis/request.go:32 — 24 of 25 names in project volcano.sh/volcano spell the token `UID` (24 of 25; unit: names in project volcano.sh/volcano containing `UID`). Peers: CgroupManager.GetPodCgroupPath(podUID) (pkg/agent/utils/cgroup/cgroup.go:91); CgroupManagerImpl.GetPodCgroupPath(podUID) (pkg/agent/utils/cgroup/cgroup.go:481); cgroup.getPodCgroupNameSuffix(podUID) (pkg/agent/utils/cgroup/cgroup.go:596); PodScheduleResult.ScheduleCycleUID (pkg/agentscheduler/api/types.go:49); Framework.GetCycleState(taskUID) (pkg/agentscheduler/framework/framework.go:117). Rename to `JobUID`. [rule N6]
D21 · Naming Consistency · `getCpuNumPerChip` spells `Cpu` where 93 names in the project spell it `CPU` · ×1
  • `getCpuNumPerChip` spells `Cpu` where 93 names in the project spell it `CPU` pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:599 — 93 of 95 names in project volcano.sh/volcano spell the token `CPU` (93 of 95; unit: names in project volcano.sh/volcano containing `CPU`). Peers: VolcanoAgentOptions.ExtendResourceCPUName (cmd/agent/app/options/options.go:74); apis.NodeOverSubscriptionCPUKey (pkg/agent/apis/types.go:30); apis.PodEvictedOverSubscriptionCPUHighWaterMarkKey (pkg/agent/apis/types.go:49); apis.PodEvictedOverSubscriptionCPULowWaterMarkKey (pkg/agent/apis/types.go:55); apis.PodEvictedCPUHighWaterMarkKey (pkg/agent/apis/types.go:61). Rename to `getCPUNumPerChip`. [rule N6]
D21 · Naming Consistency · `GetChipKindFromNpuNode` spells `Npu` where 17 names in the project spell it `NPU` · ×1
  • `GetChipKindFromNpuNode` spells `Npu` where 17 names in the project spell it `NPU` pkg/scheduler/plugins/deviceshare/devices/ascend/310p/vnpu/init_policy.go:732 — 17 of 18 names in project volcano.sh/volcano spell the token `NPU` (17 of 18; unit: names in project volcano.sh/volcano containing `NPU`). Peers: vnpu.NewNPUDevices (pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_info.go:42); NPUDevices.CheckNodeNPUByPod (pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:402); NPUDevices.CheckNodeNPUByDyPod (pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:414); NPUDevices.BuildNPUTopologyAnnotations (pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:529); vnpu.AddNPUAllocationPatch (pkg/scheduler/api/devices/ascend/mindcluster/ascend310p/vnpu/device_manage.go:642). Rename to `GetChipKindFromNPUNode`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (88332 LoC, 742 module-visible types across 244 directories) overshoots its size bounds. 1 of 2 build unit(s) (Go) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D27 · Navigability · Scattered collaborators · ×1
  • Scattered collaborators — 68 % of calls cross a namespace and only 38 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 174 of 341 significant files have no living knowledge, while the repository is still being changed at a low rate (168 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 174 separate risks. Counted over 341 of the 764 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D40 · Network Egress Confinement · No network policy · ×1
  • No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
D42 · Runtime Threat Enforcement · No runtime threat detection · ×1
  • No runtime threat detection — No runtime threat-detection engine (Tetragon TracingPolicy / Falco) is committed. These observe process, file and network activity in-kernel and can alert or kill on malicious behaviour a static scan cannot catch.
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 15 ADR-shaped document(s) detected by content — `docs/design/agent-cgroup-v2-adaptation.md`, `docs/design/capacity-dra-support.md`, `docs/design/distributed-framework-plugins.md`, `docs/design/evictablefn-evolution-for-gang-eviction.md`, `docs/design/extender.md`, `docs/design/gang-aware-eviction-design.md`, `docs/design/group-topology-affinity.md`, `docs/design/hyperNode-auto-discovery.md`, `docs/design/hypernode-controller-standalone.md`, `docs/design/namespace-queue.md`, `docs/design/numa-aware.md`, `docs/design/queue-scoped-overcommit.md`, `docs/design/resource-strategy-fit-scheduling.md`, `docs/design/scheduling-gates-queue-admission.md`, `docs/design/unschedulable-job-cache.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift benchmark/README.md:13 — benchmark/README.md names Go 1.24 or later, but REDACTED:3 requires `go 1.26.0` (the lowest of 2 declarations): the code does not build on Go 1.24. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, 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.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:118 — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
X2 · Cancellation propagation · Not all functions that make a request accept a context.Context · ×1
  • Not all functions that make a request accept a context.Context — Only 0/2 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Minor — 21 finding(s)
D12 · Dependency Hygiene · Outdated · ×21
  • Outdated: github.com/agiledragon/gomonkey/v2 — `github.com/agiledragon/gomonkey/v2` is required at v2.14.1 in REDACTED, but v2.14.4 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/agiledragon/gomonkey/v2@v2.14.4 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/cilium/ebpf — `github.com/cilium/ebpf` is required at v0.17.3 in REDACTED, but v0.22.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/cilium/ebpf@v0.22.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/containernetworking/cni — `github.com/containernetworking/cni` is required at v1.3.0 in REDACTED, but v1.3.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/containernetworking/cni@v1.3.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/containernetworking/plugins — `github.com/containernetworking/plugins` is required at v1.1.1 in REDACTED, but v1.10.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/containernetworking/plugins@v1.10.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/imdario/mergo — `github.com/imdario/mergo` is required at v0.3.16 in REDACTED, but v1.0.2 is the module's current release — so this build is missing every fix published since, including any security fix. This crosses a major version — v0 releases carry no compatibility promise, so read the changelog before taking it. Run `go get github.com/imdario/mergo@v1.0.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/moby/sys/userns — `github.com/moby/sys/userns` is required at v0.1.0 in REDACTED, but v0.2.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/moby/sys/userns@v0.2.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/onsi/ginkgo/v2 — `github.com/onsi/ginkgo/v2` is required at v2.32.0 in REDACTED, but v2.34.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/onsi/ginkgo/v2@v2.34.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/onsi/gomega — `github.com/onsi/gomega` is required at v1.42.1 in REDACTED, but v1.44.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/onsi/gomega@v1.44.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/opencontainers/cgroups — `github.com/opencontainers/cgroups` is required at v0.0.8 in REDACTED, but v0.1.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/opencontainers/cgroups@v0.1.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/prometheus/client_golang — `github.com/prometheus/client_golang` is required at v1.24.0 in REDACTED, but v1.25.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/prometheus/client_golang@v1.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/prometheus/client_model — `github.com/prometheus/client_model` is required at v0.6.2 in REDACTED, but v0.6.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/prometheus/client_model@v0.6.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/prometheus/common — `github.com/prometheus/common` is required at v0.70.0 in REDACTED, but v0.74.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/prometheus/common@v0.74.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/prometheus/prometheus — `github.com/prometheus/prometheus` is required at v0.311.3 in REDACTED, but v0.316.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/prometheus/prometheus@v0.316.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/spf13/pflag — `github.com/spf13/pflag` is required at v1.0.10 in REDACTED, but v1.1.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/spf13/pflag@v1.1.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/stretchr/testify — `github.com/stretchr/testify` is required at v1.11.1 in REDACTED, but v1.12.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/stretchr/testify@v1.12.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.56.0 in REDACTED, but v0.59.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/crypto@v0.59.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.47.0 in REDACTED, but v0.50.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.50.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/time — `golang.org/x/time` is required at v0.15.0 in REDACTED, but v0.16.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/time@v0.16.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: k8s.io/code-generator — `k8s.io/code-generator` is required at v0.37.1 in REDACTED, but v0.37.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get k8s.io/code-generator@v0.37.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: k8s.io/kubernetes — `k8s.io/kubernetes` is required at v1.37.1 in REDACTED, but v1.37.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get k8s.io/kubernetes@v1.37.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: sigs.k8s.io/controller-runtime — `sigs.k8s.io/controller-runtime` is required at v0.24.1 in REDACTED, but v0.25.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get sigs.k8s.io/controller-runtime@v0.25.3 && go mod tidy` and commit the updated REDACTED and go.sum.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-c208a3160a374a42947f2e30b8beed2f/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-c208a3160a374a42947f2e30b8beed2f/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-c208a3160a374a42947f2e30b8beed2f/history-2.json --exit-code 0 --source .1artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=3964" --report-format json --report-path /tmp/watchdog-gitleaks-c208a3160a374a42947f2e30b8beed2f/history-3.json --exit-code 0 --source .1artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c208a3160a374a42947f2e30b8beed2f/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude staging/src/volcano.sh/apis/pkg/apis/openapi .70artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-39cf6cb0d84b42738f406974517088e817artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .338artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep --config /opt/semgrep-rules/gdpr.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude staging/src/volcano.sh/apis/pkg/apis/openapi .33artifacts/raw/semgrep-gdpr.json
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-39cf6cb0d84b42738f406974517088e80artifacts/raw/osv-scanner.json

Run 01a1e5ba-08a8-736a-b771-6ca2e1f29056 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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