Public report — nacos, published 5 Aug 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
1142findings with an exact file:lineof 1155 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
49/113dimensions across the health lenses303514 LoC — wide & deep
Executive summary
Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.
alibaba/nacos carries serious gaps (43%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.
It is strongest in Domain Modelling (100%) — the domain model is expressive and well-guarded. Architecture (99%) is solid too.
Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.
The area that most needs attention is Readiness (37%) — releases are harder to depend on — versioning, release notes and dependency hygiene are thin, so consumers can't easily tell what changed or trust an upgrade. Security (38%) is the next concern — exposure to security and compliance incidents is elevated.
Leadership focus, highest impact first: tests that import the unreached modules (directly or through… (Test Coverage); unused dependencies, declare unlisted imports explicitly,… (Dependency Hygiene); Document RTO/RPO and a tested restore procedure (a backup… (DR & Backup).
For scale: Large (~303,514 production lines); rebuilding it from scratch would take roughly ~4.6 person-years (~2–9 engineers). Approximate, ±~30%.
It builds on a genuinely strong Domain Modelling foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
0.7× (at 43% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
Dead frontend code
~3951 LoC unreachable (24 file(s)) — that slice of this estimate buys code with zero runtime value; deleting it is the cheapest win in this report (the R7 card lists every file)
This codebase represents roughly ~4.6 person-years of build effort (about ~€670,000 to rebuild). Its weakest lens is Readiness at 37% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain High (×1.4) — CQRS, domain model × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Add tests that import the unreached modules (directly or through their public entry).
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~4.6 person-years to rebuild), and its weakest lens is Readiness at 37%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 80.7–484 engineer-days every year, paid as drag on the ~1,236,064 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 3–6% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 304,783 line(s) changed over a 90-day window ⇒ ~1,236,064/year · D1/D2/D4 code quality: averaging 7.0/10 ⇒ a 3–6% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add tests that import the unreached modules (directly or through their public entry). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add tests that import the unreached modules (directly or through their public entry).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.0/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–6% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 7.0/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
At a glance — Code Health · 51% · Adequate · gated by R2
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
40
High / Critical
A06:2021 — Vulnerable & Outdated Components
40
High / Critical
A04:2021 — Insecure Design
23
High / Critical
A02:2021 — Cryptographic Failures
6
High / Critical
A05:2021 — Security Misconfiguration
2
Medium
Roadmap
Begin by expanding test coverage to include all currently unreached modules. Next, clean up the dependency list by removing unused packages and explicitly declaring all imports. Then, document disaster recovery procedures, including RTO/RPO and tested restore steps. After that, implement a manual approval gate for deployments to prevent bad builds from reaching users. Finally, ensure every form control and button has a proper programmatic label for accessibility.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add tests that import the unreached modules (directly or through their public entry).
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Data Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 47 of 49 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 49 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1142 of 1155 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.
Repo exclusion declarations: 16 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity (jscpd) — 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.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
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.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
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").
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.
D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
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.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A clean result is "no unlabelled native control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
167 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was render at 81. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being ClassReader.<init> at 22 — they are counted neither in the figure above nor in this dimension's score.
+ 119 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 (anonymous) (cyclomatic 18) finding(s) in Cyclomatic Complexity — start with codemirror.js (4), ShowTools.js. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 3 (anonymous) (cyclomatic 39) finding(s) in Cyclomatic Complexity — start with SkillOptimizeDialog.js, NewAgent.js, index.js. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 (anonymous) (cyclomatic 20) finding(s) in Cyclomatic Complexity — start with SkillOptimizeDialog.js, NewMcpServer.js, McpDetail.js. — One of this dimension's main actionable groups (3 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 238 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 (anonymous) (cognitive 20) finding(s) in Cognitive Complexity — start with codemirror.js (2), ShowTools.js, AgentDetail.js. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 4 (anonymous) (cognitive 19) finding(s) in Cognitive Complexity — start with SkillOptimizeDialog.js, NewSkill.js, NewMcpServer.js. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 4 (anonymous) (cognitive 17) finding(s) in Cognitive Complexity — start with codemirror.js (4). — One of this dimension's main actionable groups (4 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.3 / 10Exemplary✓ 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.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: 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.
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.6 / 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.
56 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is console-ui-next/src/pages/configurationManagement/index.tsx.
Off-boarding risk: anonymized user #1 · ×3
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.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
Nacos has an excellent README with a strong What does it do section and a dedicated specs directory that is itself well written. The example module gives concrete runnable code examples (standalone Nacos, Hello Nacos app, ConfigExample, NamingExample), while the console-ui docs cover prerequisites, install, local development, build, and deployment for both legacy and new UIs with adaptation notes. All sections in the outline are present and visible in the visible text.
The Prerequisites section lists Node.js >= 20.19+ and npm >= 10, but the .npmrc configuration is cut off mid-sentence in the visible portion.console-ui-next/README.md
What to do
Resolve the 1 The Prerequisites section lists Node.js >= 20.19+ and npm >= 10, but the… finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.
6 finding(s): 0 critical, 6 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
Secret: generic-api-key · ×5.github/workflows/it-new.yml:40detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed
What to do
Resolve the 5 Secret finding(s) in Secrets (history) — start with application.properties (4), it-new.yml. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
High: github-actions-mutable-action-tag · ×17.github/workflows/anti-spam.yml:15detected by semgrep finding
Medium: weak-ssl-context · ×18common/src/main/java/com/alibaba/nacos/common/tls/TlsHelper.java:60detected by semgrep finding
Low: insecure-trust-manager · ×5common/src/main/java/com/alibaba/nacos/common/tls/SelfTrustManager.java:48detected by semgrep finding
What to do
Resolve the 18 Medium finding(s) in Static Analysis (SAST) — start with AuthExternalPaginationHelperImpl.java (9), ExternalStoragePaginationHelperImpl.java (2), TlsHelper.java. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 17 High finding(s) in Static Analysis (SAST) — start with ci.yml (4), frontend-ci.yml (4), it-new.yml (2). — One of this dimension's main actionable groups (17 issue-level).
Resolve the 5 Low finding(s) in Static Analysis (SAST) — start with SelfTrustManager.java (3), OidcLoginController.java (2). — One of this dimension's main actionable groups (5 recommendation-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
Medium IaC: CKV_DOCKER_3 · ×2console/src/main/resources/static/legacy/js/vs/basic-languages/src/dockerfile.js:1detected by trivy finding
✓ On the Gold path — maintain.
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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 pattern scan via semgrep across the repo, using Watchdog's own ruleset (personal data reaching log/console sinks, URLs and query strings, or unprotected browser storage); matches map to severity and a 0-10 wide normalizer. NotApplicable when the scan runs and detects no PII/GDPR surface (no unearned 10); reported LOUDLY as a measurement gap, never as not-applicable, if the ruleset is missing from the analyzer image. Exhaustive, advisory-leaning; degrades on parse failure.
High: watchdog-sensitive-personal-data-in-log · ×23client-basic/src/main/java/com/alibaba/nacos/client/address/AbstractServerListManager.java:71detected by semgrep finding
What to do
Resolve the 23 High finding(s) in Data Compliance (PII/GDPR) — start with AbstractServerListManager.java (2), ServerHttpAgent.java (2), ClientWorker.java (2). — One of this dimension's main actionable groups (23 issue-level).
Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
257 of 1427 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is common/src/main/java/com/alibaba/nacos/common/packagescan/classreading/ClassReader.java.
Resolve the 4 Orphaned knowledge finding(s) in Knowledge Freshness — start with ClassReader.java, CapacityService.java, NacosRestTemplate.java. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 Further orphaned files (smaller) 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.
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; coupling through a build step, config, or non-source file isn't seen.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 No SBOM 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.
What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.
Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.
High CVE: [GHSA redacted] · ×21console-ui/package-lock.jsondetected by osv-scanner finding
High vulnerability: [GHSA redacted] · ×5console-ui-next/package-lock.jsondetected by osv-scanner finding
Critical CVE: [GHSA redacted] · ×3console-ui/package-lock.jsondetected by osv-scanner finding
Medium CVE: [GHSA redacted] · ×7console-ui/package-lock.jsondetected by osv-scanner finding
Low CVE: [GHSA redacted] · ×4console-ui/package-lock.jsondetected by osv-scanner finding
What to do
Resolve the 21 High CVE finding(s) in OSV Dependency Vulnerabilities — start with package-lock.json (21). — One of this dimension's main actionable groups (21 issue-level).
Resolve the 5 High vulnerability finding(s) in OSV Dependency Vulnerabilities — start with package-lock.json (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 3 Critical CVE finding(s) in OSV Dependency Vulnerabilities — start with package-lock.json (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d38_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives5.2 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — Login.jsx:143, Register.jsx:134
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels2.9 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×15) — ImportAiResourceDialog.tsx:423, McpToolSelector.tsx:138, SkillOptimizeDialog.tsx:226, …
This UI-library field component has no label / aria-label / aria-labelledby / id / name, and nothing it renders carries one either. The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×10) — index.tsx:241, index.tsx:1448, index.tsx:336, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×11) — McpToolList.tsx:540, index.tsx:538, UploadAgentSpecDialog.tsx:92, …
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
`.pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus` sets color: #999999 on background-color: #ffffff — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — bootstrap.css:5000, bootstrap.css:5000
`.btn.btn-primary.disabled,.btn.btn-primary[disabled]` sets color: #fff on background-color: #ccc — 1.6:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from). (×2) — console1412.css:1, console1412.css:1
`.disabled.next-tag-default.next-tag-level-primary,[disabled].next-tag-default.next-tag-level-primary` sets color: #ccc on background-color: #fafafa — 1.5:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from). — main.css:524
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Do you agree with this assessment?
DM4 · Rich vs anemic model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether entities protect their state (private/init-only setters) instead of exposing public setters that bypass invariants. Softened when a rehydration framework (Marten/EF) is present.
Method: Roslyn (DDD-gated): public setters on entities detected; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether clusters of primitives that travel together (a missing value object) are extracted — a low-weight suggestion, LLM-confirmed when configured.
Method: Roslyn (DDD-gated): primitive parameter clusters recurring three or more times across signatures extracted, then confirmed by language model when configured. Advisory, low-weight.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 52 of 56 project(s) that lack one — worth up to 1.9 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ 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).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
Do you agree with this assessment?
R1 · Type Safety4.7 / 10Weak✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
239 typed · 268 plain JS — the untyped files are console-ui/src/components/BatchHandle/BatchHandle.js, console-ui/src/components/BatchHandle/index.js, console-ui/src/components/CloneDialog/CloneDialog.js, console-ui/src/components/CloneDialog/index.js, console-ui/src/components/Copy/index.jsx, console-ui/src/components/DeleteDialog/DeleteDialog.js (+262 more).
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm over JS/TS tokens, D-386).
Method: Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm run over JS/TS tokens). Deterministic.
console-ui-next/src/pages/promptManagement/components/PromptVersionTimeline.tsx:65 · console-ui-next/src/pages/skillManagement/components/SkillVersionTimeline.tsx:75 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — PromptVersionTimeline.tsx:65
console-ui-next/src/pages/agentSpecManagement/components/VersionTimeline.tsx:137 · console-ui-next/src/pages/skillManagement/components/SkillVersionTimeline.tsx:200 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — VersionTimeline.tsx:137
console-ui/src/pages/AI/NewSkill/NewSkill.js:1772 · console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1099 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — NewSkill.js:1772
console-ui/src/pages/AI/PromptDetail/PromptDetail.js:296 · console-ui/src/pages/AI/SkillDetail/SkillDetail.js:443 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — PromptDetail.js:296
console-ui-next/src/pages/agentSpecManagement/components/VersionTimeline.tsx:53 · console-ui-next/src/pages/promptManagement/components/PromptVersionTimeline.tsx:63 · console-ui-next/src/pages/skillManagement/components/SkillVersionTimeline.tsx:73 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — VersionTimeline.tsx:53
console-ui/src/pages/AI/McpManagement/DashboardCard.js:92 · console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/DashboardCard.js:92 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — DashboardCard.js:92
console-ui/src/pages/AI/NewSkill/NewSkill.js:3356 · console-ui/src/pages/AI/SkillDetail/SkillDetail.js:2136 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — NewSkill.js:3356
console-ui-next/src/components/ui/dialog.tsx:60 · console-ui-next/src/components/ui/sheet.tsx:83 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — dialog.tsx:60
What to do
Extract the duplicated blocks into shared functions/components.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×8) — index.tsx:109, index.tsx:108, index.tsx:87, …
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files4.9 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
58 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: console/src/main/resources/static/console-ui/public/js/codemirror.js (8557), console/src/main/resources/static/legacy/js/codemirror.js (8557), console-ui/src/pages/AI/NewSkill/NewSkill.js (3752), console-ui/src/pages/AI/SkillDetail/SkillDetail.js (2281), console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js (2176), console-ui/src/pages/AI/PromptDetail/PromptDetail.js (1837) (+52 more).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage2.3 / 10Critical✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×8) — codemirror.js, codemirror.js, NewSkill.js, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D33 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D33). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.6 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
109 file(s) (~27446 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: console/src/main/resources/static/console-ui/js/app-window-CZtpCOoa.js imports './button-D4VgS8ri.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here.
3 file(s) (~1567 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — test
Unreachable from the 122 application, 3 tooling and 55 test entry point(s) detected in this repo. Gate removals on your build/type-check — an undetected custom entry would make these reachable.
no import path from any entry point (122 application, 3 tooling, 55 test roots considered) (×5) — ConfigEditor.js, ShowServiceCodeing.js, ShowCodeing.js, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — codemirror.lib.json-lint.js:440, codemirror.lib.json-lint.js:446, NewPrompt.js:24
Declared in console-ui-next/package.json but never imported anywhere in that package or its workspace members — dead weight and attack surface. Verify against build tooling before removing. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 64 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — no DI registrations detected
AX10 Code composition — not assessed — code composition is computed by ROLE over a document set that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — no singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
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.
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.
D10 Test Quality — ~267925 lines of test source are present (.java, .ts, .js) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included
D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Maven POM and package.json), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — No exposed public API
D23 Boundary Type-Coupling — Production source is present (.java, .ts, .tsx) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Maven POM and package.json — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .java, .ts, .tsx, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
D9 Test Distribution — Test source is present (.java, .ts, .js) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM6 Domain ↔ infrastructure boundary — no domain-layer types detected — domain↔infrastructure boundary check not applicable
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 event handler(s); 6 CQRS handler(s)
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this check looks for (an Axon event-sourcing framework (@Aggregate/@CommandHandler/@EventSourcingHandler annotations))
GD1 Unfinished & placeholder code — no source files
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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
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
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
High: watchdog-sensitive-personal-data-in-log client-basic/src/main/java/com/alibaba/nacos/client/address/AbstractServerListManager.java:71— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client-basic/src/main/java/com/alibaba/nacos/client/address/AbstractServerListManager.java:76— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:302— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:305— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:652— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:661— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java:207— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java:211— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java:189— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java:191— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java:210— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java:213— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/core/ServiceInfoUpdateService.java:155— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/core/ServiceInfoUpdateService.java:157— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/remote/NamingClientProxyDelegate.java:229— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/remote/NamingClientProxyDelegate.java:236— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:516— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:518— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log console-ui/src/pages/AI/NewSkill/NewSkill.js:585— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/remote/ClientHttpProxy.java:361— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/remote/ClientHttpProxy.java:370— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/proxy/MapperProxy.java:85— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
High: watchdog-sensitive-personal-data-in-log sys/src/main/java/com/alibaba/nacos/sys/filter/NacosTypeExcludeFilter.java:64— Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
D38 · OSV Dependency Vulnerabilities· High CVE · ×21
High CVE: [GHSA redacted] console-ui/package-lock.json— @babel/plugin-transform-modules-systemjs 7.23.0: [GHSA redacted] — @babel/plugin-transform-modules-systemjs is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin @babel/plugin-transform-modules-systemjs to 7.29.4 with an `overrides` entry).
High CVE: [GHSA redacted] console-ui/package-lock.json— axios 0.21.4: [GHSA redacted] — upgrade to 0.31.1. This is 1 of 23 advisories with a published fix this scan raises against axios 0.21.4, and their fixed versions do not agree — anything below 0.33.0 still leaves at least one of them open. Take this package to 0.33.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 23 advisories this scan raises against axios 0.21.4: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui-next/package-lock.json— axios 1.16.1: [GHSA redacted] — this repo declares axios ^1.13.6, a range that ALREADY admits the fixed 1.18.0, so there is no manifest edit to make here. Re-resolve the lock so axios moves onto 1.18.0 or later; if the flagged 1.16.1 comes back, a dependency is pinning it — upgrade that dependent, or pin axios with an `overrides` entry so only one copy resolves. This one row stands for the 10 advisories this scan raises against axios 1.16.1: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui-next/package-lock.json— brace-expansion 1.1.13: [GHSA redacted] — brace-expansion is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin brace-expansion to 1.1.16 with an `overrides` entry). This is 1 of 3 advisories with a published fix this scan raises against brace-expansion 1.1.13, and their fixed versions do not agree — anything below 1.1.18 still leaves at least one of them open. Take this package to 1.1.18 or later: that is the floor for the package, not this row's target alone. (in 2 dependency files: console-ui-next/package-lock.json, console-ui/package-lock.json) This one row stands for the 3 advisories this scan raises against brace-expansion 1.1.13: [GHSA redacted], [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui-next/package-lock.json— brace-expansion 5.0.6: [GHSA redacted] — brace-expansion is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin brace-expansion to 5.0.7 with an `overrides` entry). This is 1 of 3 advisories with a published fix this scan raises against brace-expansion 5.0.6, and their fixed versions do not agree — anything below 5.0.9 still leaves at least one of them open. Take this package to 5.0.9 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against brace-expansion 5.0.6: [GHSA redacted], [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— braces 2.3.2: [GHSA redacted] — braces is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 3.0.3 is a MAJOR ahead of the resolved 2.3.2, so an `overrides` pin would force a breaking version under a dependent written against 2.3.2; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
High CVE: [GHSA redacted] console-ui/package-lock.json— flatted 2.0.2: [GHSA redacted] — flatted is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 3.4.0 is a MAJOR ahead of the resolved 2.0.2, so an `overrides` pin would force a breaking version under a dependent written against 2.0.2; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). This is 1 of 2 advisories with a published fix this scan raises against flatted 2.0.2, and their fixed versions do not agree — anything below 3.4.2 still leaves at least one of them open. Take this package to 3.4.2 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against flatted 2.0.2: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— html-minifier 3.5.21: [GHSA redacted] — no fixed version has been published yet. Track the advisory; html-minifier is not declared in this repo's manifests: it is pulled in transitively, so the action is on the dependency that requires it — upgrade or replace that dependent.
High CVE: [GHSA redacted] console-ui/package-lock.json— http-proxy-middleware 0.19.1: [GHSA redacted] — http-proxy-middleware is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 2.0.7 is a MAJOR ahead of the resolved 0.19.1, so an `overrides` pin would force a breaking version under a dependent written against 0.19.1; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). This is 1 of 2 advisories with a published fix this scan raises against http-proxy-middleware 0.19.1, and their fixed versions do not agree — anything below 2.0.10 still leaves at least one of them open. Take this package to 2.0.10 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against http-proxy-middleware 0.19.1: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— immutable 4.3.8: [GHSA redacted] — immutable is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin immutable to 4.3.9 with an `overrides` entry). This one row stands for the 2 advisories this scan raises against immutable 4.3.8: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— ip 1.1.9: [GHSA redacted] — no fixed version has been published yet. Track the advisory; ip is not declared in this repo's manifests: it is pulled in transitively, so the action is on the dependency that requires it — upgrade or replace that dependent.
High CVE: [GHSA redacted] console-ui/package-lock.json— js-yaml 3.14.2: [GHSA redacted] — this repo declares js-yaml ^4.1.0, but the vulnerable 3.14.2 is a SEPARATE copy on another release line, so editing your own js-yaml entry cannot move it: upgrade the dependency that pulls it in (or pin js-yaml to 3.15.0 with an `overrides` entry). This one row stands for the 2 advisories this scan raises against js-yaml 3.14.2: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— js-yaml 4.1.1: [GHSA redacted] — this repo declares js-yaml ^4.1.0, a range that ALREADY admits the fixed 4.3.0, so there is no manifest edit to make here. Re-resolve the lock so js-yaml moves onto 4.3.0 or later; if the flagged 4.1.1 comes back, a dependency is pinning it — upgrade that dependent, or pin js-yaml with an `overrides` entry so only one copy resolves. This is 1 of 2 advisories with a published fix this scan raises against js-yaml 4.1.1, and their fixed versions do not agree — anything below 4.3.0 still leaves at least one of them open. Take this package to 4.3.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against js-yaml 4.1.1: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui-next/package-lock.json— js-yaml 4.2.0: [GHSA redacted] — this repo declares js-yaml ^4.1.1, a range that ALREADY admits the fixed 4.3.0, so there is no manifest edit to make here. Re-resolve the lock so js-yaml moves onto 4.3.0 or later; if the flagged 4.2.0 comes back, a dependency is pinning it — upgrade that dependent, or pin js-yaml with an `overrides` entry so only one copy resolves.
High CVE: [GHSA redacted] console-ui/package-lock.json— json5 0.5.1: [GHSA redacted] — json5 is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 1.0.2 is a MAJOR ahead of the resolved 0.5.1, so an `overrides` pin would force a breaking version under a dependent written against 0.5.1; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
High CVE: [GHSA redacted] console-ui/package-lock.json— node-forge 0.10.0: [GHSA redacted] — node-forge is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 1.4.0 is a MAJOR ahead of the resolved 0.10.0, so an `overrides` pin would force a breaking version under a dependent written against 0.10.0; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). This is 1 of 13 advisories with a published fix this scan raises against node-forge 0.10.0, and their fixed versions do not agree — anything below 1.4.0 still leaves at least one of them open. Take this package to 1.4.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 13 advisories this scan raises against node-forge 0.10.0: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— nth-check 1.0.2: [GHSA redacted] — nth-check is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 2.0.1 is a MAJOR ahead of the resolved 1.0.2, so an `overrides` pin would force a breaking version under a dependent written against 1.0.2; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
High CVE: [GHSA redacted] console-ui/package-lock.json— postcss 7.0.39: [GHSA redacted] — postcss is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 8.5.12 is a MAJOR ahead of the resolved 7.0.39, so an `overrides` pin would force a breaking version under a dependent written against 7.0.39; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). This is 1 of 5 advisories with a published fix this scan raises against postcss 7.0.39, and their fixed versions do not agree — anything below 8.5.23 still leaves at least one of them open. Take this package to 8.5.23 or later: that is the floor for the package, not this row's target alone. This one row stands for the 5 advisories this scan raises against postcss 7.0.39: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— tmp 0.0.33: [GHSA redacted] — tmp is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin tmp to 0.2.6 with an `overrides` entry). This is 1 of 2 advisories with a published fix this scan raises against tmp 0.0.33, and their fixed versions do not agree — anything below 0.2.6 still leaves at least one of them open. Take this package to 0.2.6 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against tmp 0.0.33: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] console-ui/package-lock.json— webpack-dev-middleware 3.7.3: [GHSA redacted] — webpack-dev-middleware is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 5.3.4 is a MAJOR ahead of the resolved 3.7.3, so an `overrides` pin would force a breaking version under a dependent written against 3.7.3; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
High CVE: [GHSA redacted] console-ui/package-lock.json— ws 6.2.3: [GHSA redacted] — ws is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin ws to 6.2.4 with an `overrides` entry).
High: github-actions-mutable-action-tag .github/workflows/anti-spam.yml:15— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v7`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v7 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:25— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/cache@<40-character SHA>`. This step references `actions/cache@v4`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:32— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:34— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:87— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: codecov/codecov-action@<40-character SHA>`. This step references `codecov/codecov-action@v5`; resolve the SHA it points at today with `gh api repos/codecov/codecov-action/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/frontend-ci.yml:21— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/frontend-ci.yml:23— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/frontend-ci.yml:38— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/frontend-ci.yml:40— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/issue-assign.yml:15— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v7`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v7 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/it-new.yml:23— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/it-new.yml:26— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/pr-comment.yml:15— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: hasura/comment-progress@<40-character SHA>`. This step references `hasura/comment-progress@v2.3.0`; resolve the SHA it points at today with `gh api repos/hasura/comment-progress/commits/v2.3.0 --jq .sha`. Note that `v2.3.0` is an exact release tag rather than a floating major: it is still mutable (a tag can be repointed), but by convention it moves only on a force-push, so pin the floating-major and branch references in this file first.
High: github-actions-mutable-action-tag .github/workflows/pr-validation.yml:16— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v7`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v7 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/stale.yml:13— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/stale@<40-character SHA>`. This step references `actions/stale@v10`; resolve the SHA it points at today with `gh api repos/actions/stale/commits/v10 --jq .sha`.
High: npm-missing-minimum-release-age console-ui-next/.npmrc:1— `min-release-age` is set to 3, below the recommended 7 — raise it. npmrc does not set a minimum release age or sets it too low. Newly published packages can be malicious or unstable. Added in: v11.10 Reference: https://github.blog/changelog/2026-02-18-npm-bulk-trusted-publishing-config-and-script-security-now-generally-available/. This is a semgrep security-AUDIT rule reporting a POLICY that is absent or weaker than its recommendation, not an exploitable defect. Confirm whether the current setting is a deliberate decision for this repository — and apply the change where it is not; where it is (a policy your release process already enforces elsewhere, or one this repository has consciously opted out of), record the decision and leave the configuration as it is.
High: object-deserialization core/src/main/java/com/alibaba/nacos/core/cluster/Member.java:132— Found object deserialization using ObjectInputStream. Deserializing entire Java objects is dangerous because malicious actors can create Java object streams with unintended consequences. Ensure that the objects being deserialized are not user-controlled. If this must be done, consider using HMACs to sign the data stream to make sure it is not tampered with, or consider only transmitting object fields and populating a new object. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Boundary-crossing change coupling: SkillOperationService.java ↔ SkillHandler.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationService.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationService.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/ai/SkillHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 68% of the time (13 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillOperationServiceImpl.java ↔ SkillHandler.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/ai/SkillHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 68% of the time (13 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillOperationServiceImpl.java ↔ SkillInnerHandler.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/ai/SkillInnerHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 68% of the time (17 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillOperationServiceImpl.java ↔ SkillProxy.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/proxy/ai/SkillProxy.java` (context console) sit in DIFFERENT parts of the tree yet change together 67% of the time (12 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillOperationService.java ↔ SkillProxy.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationService.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationService.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/proxy/ai/SkillProxy.java` (context console) sit in DIFFERENT parts of the tree yet change together 67% of the time (12 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillOperationService.java ↔ SkillNoopHandler.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationService.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationService.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/ai/SkillNoopHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillOperationServiceImpl.java ↔ SkillNoopHandler.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java— `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/ai/SkillNoopHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillAdminController.java ↔ SkillNoopHandler.java ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java— `ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/ai/SkillNoopHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillAdminController.java ↔ SkillMaintainerService.java ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java— `ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java` (context ai) and `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerService.java` (context maintainer-client) sit in DIFFERENT parts of the tree yet change together 63% of the time (12 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Boundary-crossing change coupling: SkillAdminController.java ↔ SkillHandler.java ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java— `ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java` (context ai) and `console/src/main/java/com/alibaba/nacos/console/handler/ai/SkillHandler.java` (context console) sit in DIFFERENT parts of the tree yet change together 63% of the time (12 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
D38 · OSV Dependency Vulnerabilities· High vulnerability · ×5
High vulnerability: [GHSA redacted] console-ui-next/package-lock.json— postcss 8.5.15: [GHSA redacted] — postcss is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin postcss to 8.5.18 with an `overrides` entry). This is 1 of 2 advisories with a published fix this scan raises against postcss 8.5.15, and their fixed versions do not agree — anything below 8.5.23 still leaves at least one of them open. Take this package to 8.5.23 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against postcss 8.5.15: [GHSA redacted], [GHSA redacted].
High vulnerability: [GHSA redacted] console-ui-next/package-lock.json— react-router 7.18.0: [GHSA redacted] — react-router is not declared by the manifests that govern this lockfile: it is pulled in transitively here (the ^5.1.2 this repo declares for it belongs to a separate install root and does not reach this one), so upgrade the dependency that requires it (— 8.3.0 is a MAJOR ahead of the resolved 7.18.0, so an `overrides` pin would force a breaking version under a dependent written against 7.18.0; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
High vulnerability: [GHSA redacted] console-ui/package-lock.json— serialize-javascript 1.9.1: [GHSA redacted] — serialize-javascript is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 7.0.3 is a MAJOR ahead of the resolved 1.9.1, so an `overrides` pin would force a breaking version under a dependent written against 1.9.1; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). This is 1 of 3 advisories with a published fix this scan raises against serialize-javascript 1.9.1, and their fixed versions do not agree — anything below 7.0.3 still leaves at least one of them open. Take this package to 7.0.3 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against serialize-javascript 1.9.1: [GHSA redacted], [GHSA redacted], [GHSA redacted].
High vulnerability: [GHSA redacted] console-ui/package-lock.json— serialize-javascript 4.0.0: [GHSA redacted] — serialize-javascript is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 7.0.3 is a MAJOR ahead of the resolved 4.0.0, so an `overrides` pin would force a breaking version under a dependent written against 4.0.0; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
High vulnerability: [GHSA redacted] console-ui/package-lock.json— svgo 1.3.2: [GHSA redacted] — svgo is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 2.8.3 is a MAJOR ahead of the resolved 1.3.2, so an `overrides` pin would force a breaking version under a dependent written against 1.3.2; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
Orphaned knowledge common/src/main/java/com/alibaba/nacos/common/packagescan/classreading/ClassReader.java— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge config/src/main/java/com/alibaba/nacos/config/server/service/capacity/CapacityService.java— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge common/src/main/java/com/alibaba/nacos/common/http/client/NacosRestTemplate.java— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge config/src/main/java/com/alibaba/nacos/config/server/aspect/CapacityManagementAspect.java— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Critical CVE: [GHSA redacted] console-ui/package-lock.json— loader-utils 0.2.17: [GHSA redacted] — loader-utils is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 1.4.1 is a MAJOR ahead of the resolved 0.2.17, so an `overrides` pin would force a breaking version under a dependent written against 0.2.17; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
Critical CVE: [GHSA redacted] console-ui/package-lock.json— swiper 6.5.0: [GHSA redacted] — swiper is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin swiper to 6.5.1 with an `overrides` entry).
Critical CVE: [GHSA redacted] console-ui/package-lock.json— websocket-driver 0.7.4: [GHSA redacted] — websocket-driver is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin websocket-driver to 0.7.5 with an `overrides` entry). This one row stands for the 2 advisories this scan raises against websocket-driver 0.7.4: [GHSA redacted], [GHSA redacted].
Duplicated block (7 lines × 2) address/src/main/java/com/alibaba/nacos/address/controller/AddressServerClusterController.java:148— address/src/main/java/com/alibaba/nacos/address/controller/AddressServerClusterController.java:148-154 | address/src/main/java/com/alibaba/nacos/address/controller/AddressServerClusterController.java:202-208 — both copies are in the same file, so extract the 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 `address/src/main/java/com/alibaba/nacos/address/controller/AddressServerClusterController.java:148` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/controller/PipelineAdminController.java:64— ai/src/main/java/com/alibaba/nacos/ai/controller/PipelineAdminController.java:64-70 | ai/src/main/java/com/alibaba/nacos/ai/controller/PipelineAdminController.java:110-116 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/controller/PipelineAdminController.java:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/importer/security/AiResourceImportSecurityGuard.java:157— ai/src/main/java/com/alibaba/nacos/ai/importer/security/AiResourceImportSecurityGuard.java:157-163 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/http/DefaultImportHttpClient.java:221-227 — 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 `ai/src/main/java/com/alibaba/nacos/ai/importer/security/AiResourceImportSecurityGuard.java:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/index/AbstractMcpServerIndex.java:83— ai/src/main/java/com/alibaba/nacos/ai/index/AbstractMcpServerIndex.java:83-89 | ai/src/main/java/com/alibaba/nacos/ai/service/a2a/A2aServerOperationService.java:328-335 — 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 `ai/src/main/java/com/alibaba/nacos/ai/index/AbstractMcpServerIndex.java:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/remote/manager/AiConnectionBasedClientManager.java:57— ai/src/main/java/com/alibaba/nacos/ai/remote/manager/AiConnectionBasedClientManager.java:57-63 | naming/src/main/java/com/alibaba/nacos/naming/core/v2/client/manager/impl/ConnectionBasedClientManager.java:62-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/remote/manager/AiConnectionBasedClientManager.java:57` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:187— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:187-193 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:858-864 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:340— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:340-346 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1015-1021 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:546— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:546-553 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:597-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:546` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:674— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:674-680 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:719-725 — both copies are in the same file, so extract the block into 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) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1159— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1159-1165 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:781-788 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:487— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:487-493 | ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:606-612 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:606` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:111— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:111-117 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:105-111 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:111` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:192— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:192-198 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:203-210 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:221— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:221-227 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:240-246 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:221` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:207— ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:207-213 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:220-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:331— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:331-339 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:238-244 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpResourceOperationService.java:98— ai/src/main/java/com/alibaba/nacos/ai/service/McpResourceOperationService.java:98-104 | ai/src/main/java/com/alibaba/nacos/ai/service/McpToolOperationService.java:99-106 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:165— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:165-171 | client/src/main/java/com/alibaba/nacos/client/naming/remote/NamingClientProxyDelegate.java:92-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:659— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:659-665 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:234-240 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:659` it begins part-way through the construct above it, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1096— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1096-1102 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1151-1157 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1096` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/aspect/CapacityManagementAspect.java:78— config/src/main/java/com/alibaba/nacos/config/server/aspect/CapacityManagementAspect.java:78-84 | config/src/main/java/com/alibaba/nacos/config/server/aspect/RequestLogAspect.java:69-75 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (7 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/aspect/RequestLogAspect.java:102— config/src/main/java/com/alibaba/nacos/config/server/aspect/RequestLogAspect.java:102-108 | config/src/main/java/com/alibaba/nacos/config/server/aspect/RequestLogAspect.java:124-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:221— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:221-227 | console/src/main/java/com/alibaba/nacos/console/controller/v3/config/ConsoleConfigController.java:137-143 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:221` it does not close everything it opens, so those 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 (7 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigOpenApiController.java:122— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigOpenApiController.java:122-128 | config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java:116-122 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigOpenApiController.java:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/HistoryControllerV3.java:80— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/HistoryControllerV3.java:80-86 | console/src/main/java/com/alibaba/nacos/console/controller/v3/config/ConsoleHistoryController.java:98-104 — 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) ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/McpRegistryController.java:118— ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/McpRegistryController.java:118-126 | ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/McpRegistryController.java:149-157 — both copies are in the same file, so extract the 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 `ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/McpRegistryController.java:118` it begins part-way through the construct above it, so those 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) ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:370— ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:370-378 | ai/src/main/java/com/alibaba/nacos/ai/config/SkillDataBootstrapInitializer.java:293-301 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java:237— ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java:237-245 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleSkillController.java:224-232 — 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 `ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java:237` it begins part-way through the construct above it, so those 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 (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:164— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:164-172 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:836-844 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:752— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:752-760 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillClientOperationServiceImpl.java:144-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:752` it begins part-way through the construct above it, so those 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) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1329— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1329-1339 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1383-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:109— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:109-117 | ai/src/main/java/com/alibaba/nacos/ai/service/SkillDownloadCountManager.java:109-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:141— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:141-149 | ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:206-214 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourceVersionPersistServiceImpl.java:133— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourceVersionPersistServiceImpl.java:133-141 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourceVersionPersistServiceImpl.java:128-136 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:151— ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:151-159 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:174-182 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:151` it begins part-way through the construct above it, so those 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) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:753— ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:753-761 | ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:1168-1176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:857— ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:857-865 | ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:1369-1377 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:857` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:938— ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:938-946 | ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:1369-1377 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:938` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1617— ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1617-1625 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1639-1647 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1617` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:160— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:160-168 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:101-109 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:245— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:245-253 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:145-153 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:311— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:311-321 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:221-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. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) api/src/main/java/com/alibaba/nacos/api/utils/StringUtils.java:74— api/src/main/java/com/alibaba/nacos/api/utils/StringUtils.java:74-82 | common/src/main/java/com/alibaba/nacos/common/utils/StringUtils.java:69-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `api/src/main/java/com/alibaba/nacos/api/utils/StringUtils.java:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also 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) client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/ConfigResourceInjector.java:50— client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/ConfigResourceInjector.java:50-58 | client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/LockResourceInjector.java:44-52 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/ConfigResourceInjector.java:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:379— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:379-387 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:416-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:379` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:426— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:426-434 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:502-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) client/src/main/java/com/alibaba/nacos/client/lock/NacosLock.java:143— client/src/main/java/com/alibaba/nacos/client/lock/NacosLock.java:143-151 | client/src/main/java/com/alibaba/nacos/client/lock/NacosLock.java:188-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/lock/NacosLock.java: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.
Duplicated block (9 lines × 2) common/src/main/java/com/alibaba/nacos/common/packagescan/classreading/ClassReader.java:399— common/src/main/java/com/alibaba/nacos/common/packagescan/classreading/ClassReader.java:399-416 | common/src/main/java/com/alibaba/nacos/common/packagescan/classreading/ClassReader.java:419-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ListenerControllerV3.java:83— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ListenerControllerV3.java:83-91 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:242-250 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ListenerControllerV3.java:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (9 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRawDiskService.java:67— config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRawDiskService.java:67-75 | config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRawDiskService.java:95-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 `config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRawDiskService.java:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportManager.java:142— ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportManager.java:142-149 | ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportManager.java:182-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. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportManager.java:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/remote/handler/ReleaseMcpServerRequestHandler.java:101— ai/src/main/java/com/alibaba/nacos/ai/remote/handler/ReleaseMcpServerRequestHandler.java:101-108 | client/src/main/java/com/alibaba/nacos/client/ai/NacosAiService.java:181-188 — 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 `ai/src/main/java/com/alibaba/nacos/ai/remote/handler/ReleaseMcpServerRequestHandler.java:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/a2a/A2aServerOperationService.java:493— ai/src/main/java/com/alibaba/nacos/ai/service/a2a/A2aServerOperationService.java:493-500 | ai/src/main/java/com/alibaba/nacos/ai/service/a2a/A2aServerOperationService.java:510-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. 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) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:410— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:410-417 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:465-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:660— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:660-668 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:696-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:660` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:887— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:887-894 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1149-1156 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:169— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:169-176 | ai/src/main/java/com/alibaba/nacos/ai/service/SkillDownloadCountManager.java:171-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:182— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:182-189 | ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:208-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:135— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:135-142 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:125-132 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourceVersionPersistServiceImpl.java:105— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourceVersionPersistServiceImpl.java:105-112 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourceVersionPersistServiceImpl.java:103-110 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:722— ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:722-729 | ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:959-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1113— ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1113-1120 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1476-1483 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:503— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:503-510 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:294-301 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:503` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java:387— ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java:387-394 | ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java:516-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java:387` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/AiResourceInjector.java:58— client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/AiResourceInjector.java:58-65 | client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/ConfigResourceInjector.java:61-68 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/ConfigResourceInjector.java:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1004— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1004-1011 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1029-1036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchContext.java:488— client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchContext.java:488-495 | client/src/main/java/com/alibaba/nacos/client/naming/cache/NamingFuzzyWatchContext.java:354-361 — 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 `client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchContext.java:488` it does not close everything it opens, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:56— client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:56-63 | config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java:62-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:226— client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:226-233 | client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:257-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) common/src/main/java/com/alibaba/nacos/common/trace/publisher/TraceEventPublisher.java:118— common/src/main/java/com/alibaba/nacos/common/trace/publisher/TraceEventPublisher.java:118-125 | naming/src/main/java/com/alibaba/nacos/naming/core/v2/event/publisher/NamingEventPublisher.java:116-123 — 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 `common/src/main/java/com/alibaba/nacos/common/trace/publisher/TraceEventPublisher.java:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:367— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:367-374 | console/src/main/java/com/alibaba/nacos/console/controller/v3/config/ConsoleConfigController.java:263-270 — 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:438— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:438-445 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:495-502 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:438` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/capacity/CapacityService.java:406— config/src/main/java/com/alibaba/nacos/config/server/service/capacity/CapacityService.java:406-413 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/CapacityService.java:513-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:403— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:403-411 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:541-548 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:403` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:723— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:723-730 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:815-822 — 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) ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/SkillsRegistryController.java:139— ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/SkillsRegistryController.java:139-144 | ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/SkillsRegistryController.java:194-199 — both copies are in the same file, so extract the 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 `ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/controller/SkillsRegistryController.java:139` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportSourceManager.java:207— ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportSourceManager.java:207-212 | ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportSourceManager.java:219-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/remote/handler/a2a/AgentEndpointRequestHandler.java:146— ai/src/main/java/com/alibaba/nacos/ai/remote/handler/a2a/AgentEndpointRequestHandler.java:146-151 | ai/src/main/java/com/alibaba/nacos/ai/remote/handler/McpServerEndpointRequestHandler.java:198-203 — 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 `ai/src/main/java/com/alibaba/nacos/ai/remote/handler/a2a/AgentEndpointRequestHandler.java:146` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:584— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:584-589 | ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:620-625 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:76— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:76-81 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:71-76 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (6 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:170— ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:170-175 | ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:248-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:170` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1629— ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1629-1634 | api/src/main/java/com/alibaba/nacos/api/ai/model/skills/SkillUtils.java:408-414 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:186— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:186-191 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:125-130 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) api/src/main/java/com/alibaba/nacos/api/grpc/auto/BiRequestStreamGrpc.java:53— api/src/main/java/com/alibaba/nacos/api/grpc/auto/BiRequestStreamGrpc.java:53-58 | api/src/main/java/com/alibaba/nacos/api/grpc/auto/RequestGrpc.java:58-63 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `api/src/main/java/com/alibaba/nacos/api/grpc/auto/BiRequestStreamGrpc.java: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 (6 lines × 2) api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java:301— api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java:301-306 | naming/src/main/java/com/alibaba/nacos/naming/utils/InstanceUtil.java:99-104 — 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) client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:86— client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:86-91 | client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:102-107 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java: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 (6 lines × 2) client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:240— client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:240-245 | client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:271-276 — both copies are in the same file, so extract the block into 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) common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java:559— common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java:559-564 | core/src/main/java/com/alibaba/nacos/core/remote/grpc/negotiator/tls/DefaultTlsContextBuilder.java:65-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 `common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java:559` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:382— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:382-387 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:516-521 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:382` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:206— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:206-211 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:192-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. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:218— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:218-223 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:204-209 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:218` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:335— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:335-340 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedHistoryConfigInfoPersistServiceImpl.java:108-113 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:385— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:385-390 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:461-466 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:385` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:929— config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:929-934 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1302-1309 — both copies are in the same file, so extract the 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:929` it does not close everything it opens, so those 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:436— config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:436-441 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:458-463 — both copies are in the same file, so extract the block into 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) config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:228— config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:228-233 | config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:252-257 — both copies are in the same file, so extract the 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 `config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:228` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/utils/MD5Util.java:62— config/src/main/java/com/alibaba/nacos/config/server/utils/MD5Util.java:62-67 | config/src/main/java/com/alibaba/nacos/config/server/utils/MD5Util.java:83-89 — both copies are in the same file, so extract the 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 `config/src/main/java/com/alibaba/nacos/config/server/utils/MD5Util.java: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. 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) console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:132— console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:132-137 | naming/src/main/java/com/alibaba/nacos/naming/utils/NamingRequestUtil.java:91-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleServiceController.java:94— console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleServiceController.java:94-99 | naming/src/main/java/com/alibaba/nacos/naming/controllers/v3/ServiceControllerV3.java:100-105 — 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) console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleServiceController.java:127— console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleServiceController.java:127-132 | naming/src/main/java/com/alibaba/nacos/naming/controllers/v3/ServiceControllerV3.java:198-203 — 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) ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:323— ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:323-332 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1231-1240 — 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 `ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:323` it begins part-way through the construct above it, so those 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) ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java:206— ai/src/main/java/com/alibaba/nacos/ai/controller/SkillAdminController.java:206-215 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleSkillController.java:193-202 — 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) ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecScopeForm.java:43— ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecScopeForm.java:43-52 | ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillScopeForm.java:43-52 — 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 `ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecScopeForm.java:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:226— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:226-235 | ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:254-263 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1276— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1276-1285 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1619-1628 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1276` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:76— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptDownloadCountManager.java:76-85 | ai/src/main/java/com/alibaba/nacos/ai/service/SkillDownloadCountManager.java:76-85 — 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) ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:150— ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:150-159 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:140-149 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/repository/AiResourcePersistServiceImpl.java:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:298— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:298-307 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:208-217 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecRequestUtil.java:107— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecRequestUtil.java:107-116 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillRequestUtil.java:390-399 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecRequestUtil.java: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. 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 (10 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:163— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:163-172 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillSeedArchiveReader.java:166-175 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:199— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:199-208 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:503-512 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:641— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:641-650 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:216-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:349— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:349-358 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:493-502 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:349` it does not close everything it opens, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:67— client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:67-76 | client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:191-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:208— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:208-217 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:241-250 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:208` it begins part-way through the construct above it, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchGroupKeyHolder.java:243— client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchGroupKeyHolder.java:243-252 | client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchGroupKeyHolder.java:257-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:146— client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:146-156 | client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java:120-129 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:551— common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:551-560 | common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java: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. 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) config/src/main/java/com/alibaba/nacos/config/server/aspect/ConfigChangeAspect.java:120— config/src/main/java/com/alibaba/nacos/config/server/aspect/ConfigChangeAspect.java:120-129 | config/src/main/java/com/alibaba/nacos/config/server/aspect/ConfigChangeAspect.java:160-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:194— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:194-203 | console/src/main/java/com/alibaba/nacos/console/controller/v3/config/ConsoleConfigController.java:120-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:194` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:602— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:602-612 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:313-322 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:602` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:629— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:629-639 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:337-346 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:629` it begins part-way through the construct above it, so those 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:766— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:766-775 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:279-288 — 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) config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:403— config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:403-413 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:368-377 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:403` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:463— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:463-472 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:438-447 — 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.
TooManyMethods: NacosNamingService client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java:74— TooManyMethods — 81 methods. 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: AiResourceManager ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:71— TooManyMethods — 72 methods. 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: SwitchDomain naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchDomain.java:37— TooManyMethods — 72 methods. 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: SkillOperationServiceImpl ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:99— TooManyMethods — 71 methods. 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: PropertyUtil config/src/main/java/com/alibaba/nacos/config/server/utils/PropertyUtil.java:40— TooManyMethods — 51 methods. 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: PromptOperationServiceImpl ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:83— TooManyMethods — 50 methods. 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: AgentSpecOperationServiceImpl ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:86— TooManyMethods — 49 methods. 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: EnvUtil sys/src/main/java/com/alibaba/nacos/sys/env/EnvUtil.java:57— TooManyMethods — 49 methods. 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: SkillWellKnownImportService plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/skill/SkillWellKnownImportService.java:67— TooManyMethods — 47 methods. 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: ExternalConfigInfoPersistServiceImpl config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:104— TooManyMethods — 45 methods. Most of these members implement repository.ConfigInfoPersistService (34 of 43 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: ConfigHistoryInfoDetail config/src/main/java/com/alibaba/nacos/config/server/model/ConfigHistoryInfoDetail.java:27— TooManyMethods — 43 methods. 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: SkillUploadPrecheckResult api/src/main/java/com/alibaba/nacos/api/ai/model/skills/SkillUploadPrecheckResult.java:27— TooManyMethods — 41 methods. 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: CacheData client/src/main/java/com/alibaba/nacos/client/config/impl/CacheData.java:55— TooManyMethods — 41 methods. 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: ConfigForm config/src/main/java/com/alibaba/nacos/config/server/model/form/ConfigForm.java:31— TooManyMethods — 41 methods. 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: EmbeddedConfigInfoPersistServiceImpl config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:98— TooManyMethods — 40 methods. Most of these members implement repository.ConfigInfoPersistService (34 of 37 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: SkillsShImportService plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/skill/SkillsShImportService.java:59— TooManyMethods — 40 methods. 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: StringUtils common/src/main/java/com/alibaba/nacos/common/utils/StringUtils.java:34— TooManyMethods — 39 methods. 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: ServiceInfo api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java:38— TooManyMethods — 38 methods. 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: NamingGrpcClientProxy client/src/main/java/com/alibaba/nacos/client/naming/remote/gprc/NamingGrpcClientProxy.java:90— TooManyMethods — 38 methods. 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: RpcClient common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:69— TooManyMethods — 38 methods. 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: MetricsMonitor naming/src/main/java/com/alibaba/nacos/naming/monitor/MetricsMonitor.java:40— TooManyMethods — 38 methods. 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: AiGrpcClient client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:98— TooManyMethods — 37 methods. 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: ConfigHistoryInfo config/src/main/java/com/alibaba/nacos/config/server/model/ConfigHistoryInfo.java:31— TooManyMethods — 37 methods. 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: Instance api/src/main/java/com/alibaba/nacos/api/naming/pojo/Instance.java:40— TooManyMethods — 36 methods. 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: NacosAiService client/src/main/java/com/alibaba/nacos/client/ai/NacosAiService.java:84— TooManyMethods — 36 methods. 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.
Duplicated block (11 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/pipeline/repository/PipelineExecutionRepositoryImpl.java:150— ai/src/main/java/com/alibaba/nacos/ai/pipeline/repository/PipelineExecutionRepositoryImpl.java:150-160 | ai/src/main/java/com/alibaba/nacos/ai/pipeline/repository/PipelineExecutionRepositoryImpl.java:187-197 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/pipeline/repository/PipelineExecutionRepositoryImpl.java:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1171— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1171-1181 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:793-803 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:384— ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:384-396 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/mcp/McpRegistryClient.java:275-285 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/McpExternalDataAdaptor.java:384` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:106— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:106-116 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillSeedArchiveReader.java:112-122 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:106` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:208— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:208-218 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillSeedArchiveReader.java:211-221 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecSeedArchiveReader.java:208` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:220— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:220-230 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:524-534 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:220` it begins part-way through the construct above it, so those 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) client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosAgentCardCacheHolder.java:199— client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosAgentCardCacheHolder.java:199-209 | client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosMcpServerCacheHolder.java:177-187 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosAgentCardCacheHolder.java:199` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:79— client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:79-89 | client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:203-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:262— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:262-273 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:286-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:262` it begins part-way through the construct above it, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:420— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:420-430 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:476-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:225— client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:225-239 | client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:296-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) common/src/main/java/com/alibaba/nacos/common/notify/DefaultPublisher.java:209— common/src/main/java/com/alibaba/nacos/common/notify/DefaultPublisher.java:209-220 | common/src/main/java/com/alibaba/nacos/common/trace/publisher/TraceEventPublisher.java:119-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `common/src/main/java/com/alibaba/nacos/common/notify/DefaultPublisher.java:209` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:303— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:303-313 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:182-192 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:303` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:693— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:693-703 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:409-419 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:693` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java:288— config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java:288-298 | config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java:195-205 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java:288` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/model/ConfigCacheFactoryDelegate.java:46— config/src/main/java/com/alibaba/nacos/config/server/model/ConfigCacheFactoryDelegate.java:46-56 | config/src/main/java/com/alibaba/nacos/config/server/model/ConfigCachePostProcessorDelegate.java:49-59 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/model/ConfigCacheFactoryDelegate.java: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 (11 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoBase.java:194— config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoBase.java:194-204 | config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoChanged.java:76-86 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoBase.java:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:281— config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:281-291 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:262-272 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:281` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java:148— config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java:148-158 | config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeGrayConfigWorker.java:148-159 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java:148` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:380— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:380-391 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:355-365 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:778— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:778-788 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:867-877 — 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:281— config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:281-291 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:369-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:281` it does not close everything it opens, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/HistoryService.java:80— config/src/main/java/com/alibaba/nacos/config/server/service/HistoryService.java:80-90 | config/src/main/java/com/alibaba/nacos/config/server/service/HistoryService.java:102-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. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/HistoryService.java:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) copilot/src/main/java/com/alibaba/nacos/copilot/service/PromptOptimizationServiceImpl.java:76— copilot/src/main/java/com/alibaba/nacos/copilot/service/PromptOptimizationServiceImpl.java:76-86 | copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillOptimizationServiceImpl.java:100-110 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (11 lines × 2) copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillGenerationServiceImpl.java:161— copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillGenerationServiceImpl.java:161-171 | copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillGenerationServiceImpl.java:192-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillGenerationServiceImpl.java:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/controller/PromptAdminController.java:189— ai/src/main/java/com/alibaba/nacos/ai/controller/PromptAdminController.java:189-193 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsolePromptController.java:182-187 — 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 `ai/src/main/java/com/alibaba/nacos/ai/controller/PromptAdminController.java:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) ai/src/main/java/com/alibaba/nacos/ai/remote/handler/a2a/AgentEndpointRequestHandler.java:136— ai/src/main/java/com/alibaba/nacos/ai/remote/handler/a2a/AgentEndpointRequestHandler.java:136-140 | ai/src/main/java/com/alibaba/nacos/ai/remote/handler/McpServerEndpointRequestHandler.java:189-193 — 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) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:474— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:474-478 | ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:574-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:298— ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:298-302 | ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:324-328 — both copies are in the same file, so extract the 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 `ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:298` it does not close everything it opens, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:870— ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:870-874 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1013-1018 — both copies are in the same file, so extract the block into 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) client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:101— client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:101-105 | client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:119-123 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:144— client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:144-148 | client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:200-204 — both copies are in the same file, so extract the block into 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) config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:596— config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:596-600 | console/src/main/java/com/alibaba/nacos/console/handler/impl/inner/config/ConfigInnerHandler.java:306-310 — 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 `config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:596` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:88— config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:88-92 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:85-89 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (5 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:314— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:314-318 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:385-389 — 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:705— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:705-709 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:754-758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:806— config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:806-810 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:853-857 — both copies are in the same file, so extract the block into 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:347— config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:347-351 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:381-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.
Duplicated block (5 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:444— config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:444-448 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:468-472 — both copies are in the same file, so extract the block into 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) console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:152— console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:152-157 | naming/src/main/java/com/alibaba/nacos/naming/utils/InstanceUtil.java:158-162 — 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 `console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) console/src/main/java/com/alibaba/nacos/console/handler/impl/remote/ai/AiResourceImportRemoteHandler.java:157— console/src/main/java/com/alibaba/nacos/console/handler/impl/remote/ai/AiResourceImportRemoteHandler.java:157-161 | console/src/main/java/com/alibaba/nacos/console/handler/impl/remote/ai/AiResourceImportRemoteHandler.java:167-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 `console/src/main/java/com/alibaba/nacos/console/handler/impl/remote/ai/AiResourceImportRemoteHandler.java: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.
Duplicated block (5 lines × 2) console/src/main/java/com/alibaba/nacos/console/NacosConsoleStartUp.java:111— console/src/main/java/com/alibaba/nacos/console/NacosConsoleStartUp.java:111-115 | core/src/main/java/com/alibaba/nacos/core/listener/startup/NacosCoreStartUp.java:124-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 `console/src/main/java/com/alibaba/nacos/console/NacosConsoleStartUp.java:111` it does not close everything it opens, so those exact lines 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) example/src/main/java/com/alibaba/nacos/example/AgentSpecExample.java:90— example/src/main/java/com/alibaba/nacos/example/AgentSpecExample.java:90-94 | example/src/main/java/com/alibaba/nacos/example/AgentSpecExample.java:107-111 — both copies are in the same file, so extract the block into 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) lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:453— lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:453-457 | lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:481-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/PromptMaintainerServiceImpl.java:90— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/PromptMaintainerServiceImpl.java:90-94 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:357-361 — 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) naming/src/main/java/com/alibaba/nacos/naming/core/ClientServiceImpl.java:279— naming/src/main/java/com/alibaba/nacos/naming/core/ClientServiceImpl.java:279-283 | naming/src/main/java/com/alibaba/nacos/naming/core/ClientServiceImpl.java:306-310 — both copies are in the same file, so extract the 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 `naming/src/main/java/com/alibaba/nacos/naming/core/ClientServiceImpl.java:279` it does not close everything it opens, so those exact lines 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) naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/handler/InstanceRequestHandler.java:91— naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/handler/InstanceRequestHandler.java:91-95 | naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/handler/PersistentInstanceRequestHandler.java:89-93 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:189— ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:189-200 | ai/src/main/java/com/alibaba/nacos/ai/config/SkillDataBootstrapInitializer.java:179-190 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/importer/security/AiResourceImportSecurityGuard.java:104— ai/src/main/java/com/alibaba/nacos/ai/importer/security/AiResourceImportSecurityGuard.java:104-115 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/http/DefaultImportHttpClient.java:166-177 — 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 `ai/src/main/java/com/alibaba/nacos/ai/importer/security/AiResourceImportSecurityGuard.java: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.
Duplicated block (12 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:818— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:818-829 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1071-1083 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:818` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1295— ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1295-1306 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1641-1652 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:1295` it begins part-way through the construct above it, so those exact lines 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) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:157— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:157-168 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:241-252 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) api/src/main/java/com/alibaba/nacos/api/ai/model/agentspecs/AgentSpecUtils.java:72— api/src/main/java/com/alibaba/nacos/api/ai/model/agentspecs/AgentSpecUtils.java:72-83 | api/src/main/java/com/alibaba/nacos/api/ai/model/skills/SkillUtils.java:609-621 — 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 `api/src/main/java/com/alibaba/nacos/api/ai/model/agentspecs/AgentSpecUtils.java:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:327— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:327-338 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:471-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:327` it begins part-way through the construct above it, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchContext.java:267— client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchContext.java:267-278 | client/src/main/java/com/alibaba/nacos/client/naming/cache/NamingFuzzyWatchContext.java:185-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. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigFuzzyWatchContext.java:267` it begins part-way through the construct above it, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:262— client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:262-273 | client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:329-341 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java:262` it begins part-way through the construct above it, so those exact lines 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) client/src/main/java/com/alibaba/nacos/client/security/SecurityProxy.java:121— client/src/main/java/com/alibaba/nacos/client/security/SecurityProxy.java:121-132 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/remote/ClientHttpProxy.java:344-356 — 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 `client/src/main/java/com/alibaba/nacos/client/security/SecurityProxy.java:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:602— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:602-614 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:657-668 — both copies are in the same file, so extract the 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:602` it begins part-way through the construct above it, so those exact lines 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1223— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1223-1234 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1368-1379 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1246— config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1246-1257 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1283-1294 — both copies are in the same file, so extract the 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:165— config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:165-177 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:236-247 — both copies are in the same file, so extract the 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigRowMapperInjector.java:165` it begins part-way through the construct above it, so those exact lines 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) example/src/main/java/com/alibaba/nacos/example/AgentSpecExample.java:134— example/src/main/java/com/alibaba/nacos/example/AgentSpecExample.java:134-145 | example/src/main/java/com/alibaba/nacos/example/SkillExample.java:123-134 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (12 lines × 2) example/src/main/java/com/alibaba/nacos/example/NamingFuzzyWatchExample.java:71— example/src/main/java/com/alibaba/nacos/example/NamingFuzzyWatchExample.java:71-82 | example/src/main/java/com/alibaba/nacos/example/NamingFuzzyWatchExample.java:88-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `example/src/main/java/com/alibaba/nacos/example/NamingFuzzyWatchExample.java:71` it does not close everything it opens, so those exact lines 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) istio/src/main/java/com/alibaba/nacos/istio/mcp/McpConnection.java:40— istio/src/main/java/com/alibaba/nacos/istio/mcp/McpConnection.java:40-51 | istio/src/main/java/com/alibaba/nacos/istio/xds/DeltaConnection.java:44-55 — 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 `istio/src/main/java/com/alibaba/nacos/istio/mcp/McpConnection.java:40` it does not close everything it opens, so those exact lines 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) naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/v2/DistroClientTransportAgent.java:72— naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/v2/DistroClientTransportAgent.java:72-83 | naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/v2/DistroClientTransportAgent.java:122-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/v2/DistroClientTransportAgent.java:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:429— plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:429-440 | plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillSpectorPipelineService.java:494-505 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:429` it begins part-way through the construct above it, so those exact lines 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) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:199— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:199-210 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:257-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 `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:199` it does not close everything it opens, so those exact lines 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) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/HistoryConfigInfoMapperByOracle.java:74— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/HistoryConfigInfoMapperByOracle.java:74-85 | plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/HistoryConfigInfoMapper.java:139-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/HistoryConfigInfoMapperByOracle.java:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Medium: weak-ssl-context common/src/main/java/com/alibaba/nacos/common/tls/TlsHelper.java:60— An insecure SSL context was detected. TLS versions 1.0, 1.1, and all SSL versions are considered weak encryption and are deprecated. Use SSLContext.getInstance("TLSv1.2") for the best security. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: use-of-md5 common/src/main/java/com/alibaba/nacos/common/utils/MD5Utils.java:44— Detected MD5 hash algorithm which is considered insecure. MD5 is not collision resistant and is therefore not suitable as a cryptographic signature. Use HMAC instead. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
Medium: spring-sqli config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigOpsControllerV3.java:156— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:365— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: unrestricted-request-mapping console/src/main/java/com/alibaba/nacos/console/controller/v3/naming/ConsoleInstanceController.java:79— Detected a method annotated with 'RequestMapping' that does not specify the HTTP method. CSRF protections are not enabled for GET, HEAD, TRACE, or OPTIONS, and by default all HTTP methods are allowed when the HTTP method is not explicitly specified. This means that a method that performs state changes could be vulnerable to CSRF attacks. To mitigate, add the 'method' field and specify the HTTP method (such as 'RequestMethod.POST'). This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli core/src/main/java/com/alibaba/nacos/core/namespace/repository/ExternalNamespacePersistServiceImpl.java:177— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli persistence/src/main/java/com/alibaba/nacos/persistence/repository/extrnal/ExternalStoragePaginationHelperImpl.java:98— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli persistence/src/main/java/com/alibaba/nacos/persistence/repository/extrnal/ExternalStoragePaginationHelperImpl.java:108— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: tainted-sql-string plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/controller/v3/RoleControllerV3.java:91— User data flows into this manually-constructed SQL string. User data can be safely inserted into SQL strings using prepared statements or an object-relational mapper (ORM). Manually-constructed SQL strings is a possible indicator of SQL injection, which could let an attacker steal or manipulate data from the database. Instead, use prepared statements (`connection.PreparedStatement`) or a safe library.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:76— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:104— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:119— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:147— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:172— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:199— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:223— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:233— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: spring-sqli plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:250— Detected a string argument from a public method contract in a raw SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
FileTooLong: js/codemirror.js console/src/main/resources/static/console-ui/public/js/codemirror.js:0— FileTooLong — 6348 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). 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: js/codemirror.js console/src/main/resources/static/legacy/js/codemirror.js:0— FileTooLong — 6348 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). 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: NewSkill/NewSkill.js console-ui/src/pages/AI/NewSkill/NewSkill.js:0— FileTooLong — 2885 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). 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: SkillDetail/SkillDetail.js console-ui/src/pages/AI/SkillDetail/SkillDetail.js:0— FileTooLong — 1792 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 98% of them inside a single declaration: SkillDetail (51-2467). 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: skills/SkillOperationServiceImpl.java ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:0— FileTooLong — 1198 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SkillOperationServiceImpl (99-1889). 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: extrnal/ExternalConfigInfoPersistServiceImpl.java config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:0— FileTooLong — 1084 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ExternalConfigInfoPersistServiceImpl (104-1410). 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: agentspecs/AgentSpecOperationServiceImpl.java ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:0— FileTooLong — 975 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AgentSpecOperationServiceImpl (86-1568). 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: embedded/EmbeddedConfigInfoPersistServiceImpl.java config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:0— FileTooLong — 953 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: EmbeddedConfigInfoPersistServiceImpl (98-1253). 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: impl/ClientWorker.java client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:0— FileTooLong — 922 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: ClientWorker (116-1514). 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: resource/AiResourceManager.java ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:0— FileTooLong — 921 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AiResourceManager (71-1522). 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: prompt/PromptOperationServiceImpl.java ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:0— FileTooLong — 790 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: PromptOperationServiceImpl (83-1127). 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: service/McpServerOperationService.java ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java:0— FileTooLong — 611 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: McpServerOperationService (86-888). 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: v3/ConfigControllerV3.java config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:0— FileTooLong — 596 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: ConfigControllerV3 (116-815). 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: client/RpcClient.java common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:0— FileTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: RpcClient (69-1082). 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: utils/SkillZipParser.java ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:0— FileTooLong — 533 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SkillZipParser (53-995). 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: naming/NacosNamingService.java client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java:0— FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: NacosNamingService (74-759). 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: skill/SkillWellKnownImportService.java plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/skill/SkillWellKnownImportService.java:0— FileTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: SkillWellKnownImportService (67-801). 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: naming/NacosNamingMaintainerServiceImpl.java maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/naming/NacosNamingMaintainerServiceImpl.java:0— FileTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: NacosNamingMaintainerServiceImpl (64-647). 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.
Hotspot: console-ui-next/src/pages/promptDetail/index.tsx console-ui-next/src/pages/promptDetail/index.tsx— console-ui-next/src/pages/promptDetail/index.tsx changed 5 times in last 90 days, max complexity 108. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: console-ui-next/src/pages/skillDetail/index.tsx console-ui-next/src/pages/skillDetail/index.tsx— console-ui-next/src/pages/skillDetail/index.tsx changed 5 times in last 90 days, max complexity 98. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: console-ui-next/src/pages/agentSpecDetail/index.tsx console-ui-next/src/pages/agentSpecDetail/index.tsx— console-ui-next/src/pages/agentSpecDetail/index.tsx changed 4 times in last 90 days, max complexity 91. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: console-ui/src/pages/AI/SkillDetail/SkillDetail.js console-ui/src/pages/AI/SkillDetail/SkillDetail.js— console-ui/src/pages/AI/SkillDetail/SkillDetail.js changed 3 times in last 90 days, max complexity 81. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java— ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java changed 8 times in last 90 days, max complexity 23. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: console-ui-next/src/pages/mcpServerDetail/index.tsx console-ui-next/src/pages/mcpServerDetail/index.tsx— console-ui-next/src/pages/mcpServerDetail/index.tsx changed 2 times in last 90 days, max complexity 60. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: console-ui-next/src/pages/newMcpServer/index.tsx console-ui-next/src/pages/newMcpServer/index.tsx— console-ui-next/src/pages/newMcpServer/index.tsx changed 3 times in last 90 days, max complexity 39. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: console/src/main/resources/static/next/js/vendor-icons.js console/src/main/resources/static/next/js/vendor-icons.js— console/src/main/resources/static/next/js/vendor-icons.js changed 4 times in last 90 days, max complexity 28. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java— ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java changed 6 times in last 90 days, max complexity 17. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java changed 5 times in last 90 days, max complexity 20. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Duplicated block (7 lines × 3) client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:196— client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:196-203 | client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:225-231 | client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:256-263 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:199— config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:199-205 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:224-230 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/GroupCapacityPersistService.java:248-254 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:178— config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:178-185 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:203-210 | config/src/main/java/com/alibaba/nacos/config/server/service/capacity/TenantCapacityPersistService.java:228-234 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/dump/processor/DumpAllProcessor.java:98— config/src/main/java/com/alibaba/nacos/config/server/service/dump/processor/DumpAllProcessor.java:98-104 | config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java:117-123 | config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeGrayConfigWorker.java:118-124 — 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:713— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:713-719 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:762-768 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:392-398 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:106— config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:106-112 | config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:132-139 | config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:158-164 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/sql/EmbeddedStorageContextUtils.java:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:292— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:292-298 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/PromptMaintainerServiceImpl.java:212-218 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:302-308 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (7 lines × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:166— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:166-172 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:193-200 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:263-270 — 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 `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:166` it begins part-way through the construct above it, so those 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) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:170— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:170-177 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:186-193 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:204-210 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentRequestUtil.java:142— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentRequestUtil.java:142-148 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiGrpcClient.java:657-662 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:232-238 — 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 `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentRequestUtil.java:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) client/src/main/java/com/alibaba/nacos/client/redo/service/AbstractRedoService.java:154— client/src/main/java/com/alibaba/nacos/client/redo/service/AbstractRedoService.java:154-159 | client/src/main/java/com/alibaba/nacos/client/redo/service/AbstractRedoService.java:171-176 | client/src/main/java/com/alibaba/nacos/client/redo/service/AbstractRedoService.java:189-194 — 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 `client/src/main/java/com/alibaba/nacos/client/redo/service/AbstractRedoService.java:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:146— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:146-151 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:271-276 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:327-332 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:248— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:248-253 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:234-242 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:286-294 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:351— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:351-356 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:720-725 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:331-336 — 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) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:83— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:83-89 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:140-146 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:158-163 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:93— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:93-98 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:114-119 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:134-139 — 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 `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:235— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:235-240 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:366-371 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:387-392 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) naming/src/main/java/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.java:164— naming/src/main/java/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.java:164-169 | naming/src/main/java/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.java:324-329 | naming/src/main/java/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.java:350-355 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:379— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:379-386 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:671-678 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:681-688 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:493— console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:493-500 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:510-517 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:540-547 — 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 `console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:493` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:291— lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:291-298 | lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:497-504 | lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:522-529 — 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 `lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:238— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:238-245 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:297-304 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:365-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 `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:246— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:246-253 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:307-314 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:375-382 — 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 `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:246` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:442— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:442-449 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/naming/NacosNamingMaintainerServiceImpl.java:114-121 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/naming/NacosNamingMaintainerServiceImpl.java:302-309 — 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 `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:442` it begins part-way through the construct above it, so those 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 × 3) naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/HealthCheckCommonV2.java:110— naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/HealthCheckCommonV2.java:110-117 | naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/HealthCheckCommonV2.java:161-169 | naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/HealthCheckCommonV2.java:213-220 — 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 `naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/HealthCheckCommonV2.java:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigInfoMapper.java:268— plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigInfoMapper.java:268-275 | plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigInfoMapper.java:477-484 | plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigInfoMapper.java:500-507 — 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.
D38 · OSV Dependency Vulnerabilities· Medium CVE · ×7
Medium CVE: [GHSA redacted] console-ui/package-lock.json— @babel/runtime 7.9.0: [GHSA redacted] — this repo already declares @babel/runtime ^7.28.2 directly, at or above the fixed 7.26.10; the vulnerable 7.9.0 is a second copy resolved for a dependency that requires an older range. Upgrade those dependents, or pin @babel/runtime with an `overrides` entry so only one copy resolves.
Medium CVE: [GHSA redacted] console-ui-next/package-lock.json— dompurify 3.2.7: [GHSA redacted] — dompurify is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin dompurify to 3.4.0 with an `overrides` entry). This is 1 of 16 advisories with a published fix this scan raises against dompurify 3.2.7, and their fixed versions do not agree — anything below 3.4.12 still leaves at least one of them open. Take this package to 3.4.12 or later: that is the floor for the package, not this row's target alone. This one row stands for the 17 advisories this scan raises against dompurify 3.2.7: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
Medium CVE: [GHSA redacted] console-ui/package-lock.json— micromatch 3.1.10: [GHSA redacted] — micromatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 4.0.8 is a MAJOR ahead of the resolved 3.1.10, so an `overrides` pin would force a breaking version under a dependent written against 3.1.10; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
Medium CVE: [GHSA redacted] console-ui/package-lock.json— qs 6.14.2: [GHSA redacted] — this repo declares qs ^6.8.2, a range that ALREADY admits the fixed 6.15.2, so there is no manifest edit to make here. Re-resolve the lock so qs moves onto 6.15.2 or later; if the flagged 6.14.2 comes back, a dependency is pinning it — upgrade that dependent, or pin qs with an `overrides` entry so only one copy resolves.
Medium CVE: [GHSA redacted] console-ui/package-lock.json— uuid 3.4.0: [GHSA redacted] — uuid is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 11.1.1 is a MAJOR ahead of the resolved 3.4.0, so an `overrides` pin would force a breaking version under a dependent written against 3.4.0; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
Medium CVE: [GHSA redacted] console-ui/package-lock.json— uuid 8.3.2: [GHSA redacted] — uuid is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 11.1.1 is a MAJOR ahead of the resolved 8.3.2, so an `overrides` pin would force a breaking version under a dependent written against 8.3.2; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead).
Medium CVE: [GHSA redacted] console-ui/package-lock.json— webpack-dev-server 3.11.3: [GHSA redacted] — upgrade to 5.2.1. This is 1 of 6 advisories with a published fix this scan raises against webpack-dev-server 3.11.3, and their fixed versions do not agree — anything below 5.2.6 still leaves at least one of them open. Take this package to 5.2.6 or later: that is the floor for the package, not this row's target alone. This one row stands for the 6 advisories this scan raises against webpack-dev-server 3.11.3: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
Duplicated block (9 lines × 3) ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/service/NacosSkillsRegistryService.java:412— ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/service/NacosSkillsRegistryService.java:412-420 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/skill/SkillWellKnownImportService.java:508-516 | plugin-default-impl/nacos-default-ai-importer-plugin/src/main/java/com/alibaba/nacos/plugin/ai/importer/defaultimpl/skill/SkillsShImportService.java:436-444 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java:85— client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java:85-93 | config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java:66-74 | config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java:61-69 — before extracting anything, compare `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java` and `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:333— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:333-341 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:417-426 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:474-482 — 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 `client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalPermissionPersistServiceImpl.java:135— plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalPermissionPersistServiceImpl.java:135-143 | plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalRolePersistServiceImpl.java:195-203 | plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalUserPersistServiceImpl.java:172-180 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (9 lines × 3) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-base/src/main/java/com/alibaba/nacos/plugin/datasource/impl/base/BaseConfigInfoMapper.java:195— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-base/src/main/java/com/alibaba/nacos/plugin/datasource/impl/base/BaseConfigInfoMapper.java:195-203 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:173-181 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/ConfigInfoMapperByOracle.java:186-194 — 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 `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-base/src/main/java/com/alibaba/nacos/plugin/datasource/impl/base/BaseConfigInfoMapper.java:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java:85— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java:85-93 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysql.java:68-76 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/GroupCapacityMapperByOracle.java:67-75 — 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 `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java:114— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java:114-122 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySql.java:114-122 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/TenantCapacityMapperByOracle.java:113-121 — 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 `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java:114` it begins part-way through the construct above it, so those 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) common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:562— common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:562-574 | common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:594-607 — both copies are in the same file, so extract the 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 `common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:562` it begins part-way through the construct above it, so those 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) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:684— config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:684-697 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:745-757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:684` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) core/src/main/java/com/alibaba/nacos/core/namespace/repository/EmbeddedNamespacePersistServiceImpl.java:87— core/src/main/java/com/alibaba/nacos/core/namespace/repository/EmbeddedNamespacePersistServiceImpl.java:87-99 | core/src/main/java/com/alibaba/nacos/core/namespace/repository/EmbeddedNamespacePersistServiceImpl.java:127-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 `core/src/main/java/com/alibaba/nacos/core/namespace/repository/EmbeddedNamespacePersistServiceImpl.java:87` it begins part-way through the construct above it, so those exact lines 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) istio/src/main/java/com/alibaba/nacos/istio/xds/NacosXdsService.java:103— istio/src/main/java/com/alibaba/nacos/istio/xds/NacosXdsService.java:103-115 | istio/src/main/java/com/alibaba/nacos/istio/xds/NacosXdsService.java:334-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `istio/src/main/java/com/alibaba/nacos/istio/xds/NacosXdsService.java:103` it begins part-way through the construct above it, so those exact lines 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) lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:193— lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:193-205 | lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:323-336 — both copies are in the same file, so extract the 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 `lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/embedded/AuthEmbeddedPaginationHelperImpl.java:198— plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/embedded/AuthEmbeddedPaginationHelperImpl.java:198-210 | plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/extrnal/AuthExternalPaginationHelperImpl.java:211-223 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/embedded/AuthEmbeddedPaginationHelperImpl.java:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
(anonymous) (cyclomatic 18) console-ui/src/pages/AI/McpDetail/ShowTools.js:65— (anonymous) has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 18) console/src/main/resources/static/legacy/js/codemirror.js:3132— (anonymous) has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 18) console/src/main/resources/static/legacy/js/codemirror.js:4049— (anonymous) has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:3132— (anonymous) has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:4049— (anonymous) has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Duplicated block (6 lines × 4) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:86— config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:86-92 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:123-129 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalHistoryConfigInfoPersistServiceImpl.java:77-83 | core/src/main/java/com/alibaba/nacos/core/namespace/repository/ExternalNamespacePersistServiceImpl.java:63-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (6 lines × 4) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:96— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/A2aMaintainerServiceImpl.java:96-101 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:68-74 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerServiceImpl.java:126-132 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/PromptMaintainerServiceImpl.java:405-411 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. 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 × 4) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:64— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:64-69 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:158-164 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:255-261 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/config/NacosConfigMaintainerServiceImpl.java:275-280 — 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. 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 × 4) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:91— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:91-96 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:174-180 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:190-196 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:208-213 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:146— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:146-151 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:263-268 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:281-286 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:296-301 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/core/AbstractCoreMaintainerService.java:146` it begins part-way through the construct above it, so those 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.
(anonymous) (cognitive 20) console-ui/src/pages/AI/McpDetail/ShowTools.js:65— (anonymous) has cognitive complexity 20 (threshold 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.
(anonymous) (cognitive 20) console-ui/src/pages/AI/AgentDetail/AgentDetail.js:237— (anonymous) has cognitive complexity 20 (threshold 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.
(anonymous) (cognitive 20) console/src/main/resources/static/legacy/js/codemirror.js:4049— (anonymous) has cognitive complexity 20 (threshold 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.
(anonymous) (cognitive 20) console/src/main/resources/static/console-ui/public/js/codemirror.js:4049— (anonymous) has cognitive complexity 20 (threshold 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.
(anonymous) (cognitive 19) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:431— (anonymous) has cognitive complexity 19 (threshold 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.
(anonymous) (cognitive 19) console-ui/src/pages/AI/NewSkill/NewSkill.js:1156— (anonymous) has cognitive complexity 19 (threshold 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.
(anonymous) (cognitive 19) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:245— (anonymous) has cognitive complexity 19 (threshold 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.
(anonymous) (cognitive 19) console-ui/src/pages/AI/McpDetail/ShowTools.js:555— (anonymous) has cognitive complexity 19 (threshold 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.
(anonymous) (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:3132— (anonymous) has cognitive complexity 17 (threshold 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.
(anonymous) (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:8046— (anonymous) has cognitive complexity 17 (threshold 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.
(anonymous) (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:3132— (anonymous) has cognitive complexity 17 (threshold 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.
(anonymous) (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:8046— (anonymous) has cognitive complexity 17 (threshold 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.
(anonymous) (cognitive 16) console-ui/src/utils/request.js:98— (anonymous) has cognitive complexity 16 (threshold 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.
(anonymous) (cognitive 16) console-ui/src/pages/AI/McpDetail/CreateTools/SchemaEditor.js:453— (anonymous) has cognitive complexity 16 (threshold 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.
(anonymous) (cognitive 16) console/src/main/resources/static/legacy/js/codemirror.js:6863— (anonymous) has cognitive complexity 16 (threshold 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.
(anonymous) (cognitive 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:6863— (anonymous) has cognitive complexity 16 (threshold 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.
Duplicated block (14 lines × 2) ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:252— ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:252-265 | ai/src/main/java/com/alibaba/nacos/ai/config/SkillDataBootstrapInitializer.java:237-250 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:252` it begins part-way through the construct above it, so those 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) ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:347— ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:347-360 | ai/src/main/java/com/alibaba/nacos/ai/config/SkillDataBootstrapInitializer.java:270-283 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:347` it begins part-way through the construct above it, so those 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) config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java:81— config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java:81-94 | config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java:76-89 — before extracting anything, compare `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java` and `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) copilot/src/main/java/com/alibaba/nacos/copilot/service/PromptDebugServiceImpl.java:78— copilot/src/main/java/com/alibaba/nacos/copilot/service/PromptDebugServiceImpl.java:78-91 | copilot/src/main/java/com/alibaba/nacos/copilot/service/PromptOptimizationServiceImpl.java:77-90 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (10 lines × 3) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:122— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:122-131 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:185-194 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:221-230 — 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 `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/model/form/ConfigForm.java:82— config/src/main/java/com/alibaba/nacos/config/server/model/form/ConfigForm.java:82-91 | naming/src/main/java/com/alibaba/nacos/naming/push/v2/hook/PushResult.java:54-63 | plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/config/OidcAuthPluginConfig.java:112-121 — 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. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
Duplicated block (10 lines × 3) config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRocksDbDiskService.java:110— config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRocksDbDiskService.java:110-119 | config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java:106-115 | config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java:101-110 — before extracting anything, compare `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java` and `config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRocksDbDiskService.java:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:396— plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:396-405 | plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:415-424 | plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillSpectorPipelineService.java:480-489 — 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 `plugin-default-impl/nacos-default-ai-pipeline-plugin/src/main/java/com/alibaba/nacos/plugin/ai/pipeline/spi/impl/SkillScannerPipelineService.java:396` it begins part-way through the construct above it, so those 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 × 4) client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:244— client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:244-251 | client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:280-287 | client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:304-311 | client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:425-432 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java: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. 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 × 4) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:576— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:576-583 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1097-1104 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:658-665 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1206-1213 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:576` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) naming/src/main/java/com/alibaba/nacos/naming/paramcheck/NamingDefaultHttpParamExtractor.java:46— naming/src/main/java/com/alibaba/nacos/naming/paramcheck/NamingDefaultHttpParamExtractor.java:46-53 | naming/src/main/java/com/alibaba/nacos/naming/paramcheck/NamingInstanceBeatHttpParamExtractor.java:42-49 | naming/src/main/java/com/alibaba/nacos/naming/paramcheck/NamingInstanceListHttpParamExtractor.java:40-47 | naming/src/main/java/com/alibaba/nacos/naming/paramcheck/NamingInstanceMetadataBatchHttpParamExtractor.java:45-52 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (8 lines × 4) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/AiResourceVersionMapperByDerby.java:37— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/AiResourceVersionMapperByDerby.java:37-44 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/AiResourceVersionMapperByMySql.java:40-47 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/AiResourceVersionMapperByOracle.java:37-44 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-postgresql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/postgresql/AiResourceVersionMapperByPostgresql.java:39-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/AiResourceVersionMapperByDerby.java:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
(anonymous) (cyclomatic 39) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1483— (anonymous) has cyclomatic complexity 39 (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.
(anonymous) (cyclomatic 39) console-ui/src/pages/AI/NewAgent/NewAgent.js:161— (anonymous) has cyclomatic complexity 39 (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.
(anonymous) (cyclomatic 39) console-ui/src/pages/AI/McpDetail/CreateTools/index.js:229— (anonymous) has cyclomatic complexity 39 (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.
(anonymous) (cyclomatic 20) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:431— (anonymous) has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 20) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:1807— (anonymous) has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 20) console-ui/src/pages/AI/McpDetail/McpDetail.js:965— (anonymous) has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Duplicated block (12 lines × 4) console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:221— console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:221-232 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:329-340 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:438-449 | console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:543-554 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-base/src/main/java/com/alibaba/nacos/plugin/datasource/impl/base/BaseConfigInfoMapper.java:141— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-base/src/main/java/com/alibaba/nacos/plugin/datasource/impl/base/BaseConfigInfoMapper.java:141-152 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:116-128 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/ConfigInfoMapperByOracle.java:127-139 | plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigInfoMapper.java:192-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-base/src/main/java/com/alibaba/nacos/plugin/datasource/impl/base/BaseConfigInfoMapper.java:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java:153— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java:153-164 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:134-145 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/ConfigInfoMapperByOracle.java:145-156 | plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigInfoMapper.java:210-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 4) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:264— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:264-274 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:295-305 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:329-339 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:473-483 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:74— client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:74-84 | client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:94-104 | client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java:64-74 | client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java:87-97 — 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 `client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1130— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1130-1140 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1166-1176 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1244-1254 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1281-1291 — 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 `config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:121— ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:121-131 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:208-218 | ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:277-287 — 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 `ai/src/main/java/com/alibaba/nacos/ai/utils/AgentSpecZipParser.java:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java:88— persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java:88-98 | persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java:115-125 | persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java:167-177 — 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 `persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:284— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:284-294 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/ConfigInfoMapperByOracle.java:308-319 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/ConfigTagsRelationMapperByOracle.java:77-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 4) ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:60— ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:60-67 | ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourceVersionPersistServiceImpl.java:61-68 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedHistoryConfigInfoPersistServiceImpl.java:79-86 | core/src/main/java/com/alibaba/nacos/core/namespace/repository/EmbeddedNamespacePersistServiceImpl.java:66-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/service/repository/EmbeddedAiResourcePersistServiceImpl.java:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/AiResourceInjector.java:49— client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/AiResourceInjector.java:49-55 | client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/ConfigResourceInjector.java:48-55 | client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/LockResourceInjector.java:42-49 | client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/NamingResourceInjector.java:56-64 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/injector/AiResourceInjector.java: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.
Duplicated block (7 lines × 4) maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:72— maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/AgentSpecMaintainerServiceImpl.java:72-78 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/PromptMaintainerServiceImpl.java:112-118 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/PromptMaintainerServiceImpl.java:361-367 | maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/SkillMaintainerServiceImpl.java:59-65 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. 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.
(anonymous) (cyclomatic 61) console/src/main/resources/static/legacy/js/codemirror.js:990— (anonymous) has cyclomatic complexity 61 (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.
(anonymous) (cyclomatic 61) console/src/main/resources/static/console-ui/public/js/codemirror.js:990— (anonymous) has cyclomatic complexity 61 (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.
insertLineContent (cyclomatic 53) console/src/main/resources/static/legacy/js/codemirror.js:2081— insertLineContent has cyclomatic complexity 53 (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.
insertLineContent (cyclomatic 53) console/src/main/resources/static/console-ui/public/js/codemirror.js:2081— insertLineContent has cyclomatic complexity 53 (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.
(anonymous) (cyclomatic 41) console/src/main/resources/static/legacy/js/codemirror.js:27— (anonymous) has cyclomatic complexity 41 (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.
(anonymous) (cyclomatic 41) console/src/main/resources/static/console-ui/public/js/codemirror.js:27— (anonymous) has cyclomatic complexity 41 (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.
parse (cyclomatic 37) console/src/main/resources/static/legacy/js/codemirror.lib.json-lint.js:73— parse has cyclomatic complexity 37 (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.
parse (cyclomatic 37) console/src/main/resources/static/console-ui/public/js/codemirror.lib.json-lint.js:73— parse has cyclomatic complexity 37 (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.
measureCharInner (cyclomatic 35) console/src/main/resources/static/legacy/js/codemirror.js:2639— measureCharInner has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
measureCharInner (cyclomatic 35) console/src/main/resources/static/console-ui/public/js/codemirror.js:2639— measureCharInner has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
markText (cyclomatic 33) console/src/main/resources/static/legacy/js/codemirror.js:5860— markText has cyclomatic complexity 33 (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.
markText (cyclomatic 33) console/src/main/resources/static/console-ui/public/js/codemirror.js:5860— markText has cyclomatic complexity 33 (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.
stretchSpansOverChange (cyclomatic 32) console/src/main/resources/static/legacy/js/codemirror.js:607— stretchSpansOverChange has cyclomatic complexity 32 (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.
stretchSpansOverChange (cyclomatic 32) console/src/main/resources/static/console-ui/public/js/codemirror.js:607— stretchSpansOverChange has cyclomatic complexity 32 (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.
pollContent (cyclomatic 32) console/src/main/resources/static/legacy/js/codemirror.js:8739— pollContent has cyclomatic complexity 32 (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.
pollContent (cyclomatic 32) console/src/main/resources/static/console-ui/public/js/codemirror.js:8739— pollContent has cyclomatic complexity 32 (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.
clear (cyclomatic 30) console/src/main/resources/static/legacy/js/codemirror.js:5747— clear has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
clear (cyclomatic 30) console/src/main/resources/static/console-ui/public/js/codemirror.js:5747— clear has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
skipAtomicInner (cyclomatic 29) console/src/main/resources/static/legacy/js/codemirror.js:5087— skipAtomicInner has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
skipAtomicInner (cyclomatic 29) console/src/main/resources/static/console-ui/public/js/codemirror.js:5087— skipAtomicInner has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buildToken (cyclomatic 27) console/src/main/resources/static/legacy/js/codemirror.js:1966— buildToken has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buildToken (cyclomatic 27) console/src/main/resources/static/console-ui/public/js/codemirror.js:1966— buildToken has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
updateDisplayIfNeeded (cyclomatic 27) console/src/main/resources/static/legacy/js/codemirror.js:4156— updateDisplayIfNeeded has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
updateDisplayIfNeeded (cyclomatic 27) console/src/main/resources/static/console-ui/public/js/codemirror.js:4156— updateDisplayIfNeeded has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
applyTextInput (cyclomatic 26) console/src/main/resources/static/legacy/js/codemirror.js:7859— applyTextInput has cyclomatic complexity 26 (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.
applyTextInput (cyclomatic 26) console/src/main/resources/static/console-ui/public/js/codemirror.js:7859— applyTextInput has cyclomatic complexity 26 (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.
showPrimarySelection (cyclomatic 26) console/src/main/resources/static/legacy/js/codemirror.js:8600— showPrimarySelection has cyclomatic complexity 26 (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.
showPrimarySelection (cyclomatic 26) console/src/main/resources/static/console-ui/public/js/codemirror.js:8600— showPrimarySelection has cyclomatic complexity 26 (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.
moveVisually (cyclomatic 25) console/src/main/resources/static/legacy/js/codemirror.js:1158— moveVisually has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
moveVisually (cyclomatic 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:1158— moveVisually has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buildLineContent (cyclomatic 25) console/src/main/resources/static/legacy/js/codemirror.js:1899— buildLineContent has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buildLineContent (cyclomatic 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:1899— buildLineContent has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
regChange (cyclomatic 25) console/src/main/resources/static/legacy/js/codemirror.js:3893— regChange has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
regChange (cyclomatic 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:3893— regChange has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onScrollWheel (cyclomatic 25) console/src/main/resources/static/legacy/js/codemirror.js:4394— onScrollWheel has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onScrollWheel (cyclomatic 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:4394— onScrollWheel has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
findPosH (cyclomatic 25) console/src/main/resources/static/legacy/js/codemirror.js:8422— findPosH has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
findPosH (cyclomatic 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:8422— findPosH has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
coordsCharInner (cyclomatic 23) console/src/main/resources/static/legacy/js/codemirror.js:2890— coordsCharInner has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
coordsCharInner (cyclomatic 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:2890— coordsCharInner has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
indentLine (cyclomatic 23) console/src/main/resources/static/legacy/js/codemirror.js:7791— indentLine has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
indentLine (cyclomatic 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:7791— indentLine has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
nodeAndOffsetInLineMap (cyclomatic 22) console/src/main/resources/static/legacy/js/codemirror.js:2591— nodeAndOffsetInLineMap has cyclomatic complexity 22 (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.
nodeAndOffsetInLineMap (cyclomatic 22) console/src/main/resources/static/console-ui/public/js/codemirror.js:2591— nodeAndOffsetInLineMap has cyclomatic complexity 22 (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.
poll (cyclomatic 22) console/src/main/resources/static/legacy/js/codemirror.js:9214— poll has cyclomatic complexity 22 (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.
poll (cyclomatic 22) console/src/main/resources/static/console-ui/public/js/codemirror.js:9214— poll has cyclomatic complexity 22 (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.
makeChangeFromHistory (cyclomatic 20) console/src/main/resources/static/legacy/js/codemirror.js:5216— makeChangeFromHistory has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
makeChangeFromHistory (cyclomatic 20) console/src/main/resources/static/console-ui/public/js/codemirror.js:5216— makeChangeFromHistory has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
conflictingCollapsedRange (cyclomatic 19) console/src/main/resources/static/legacy/js/codemirror.js:760— conflictingCollapsedRange has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
conflictingCollapsedRange (cyclomatic 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:760— conflictingCollapsedRange has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
calculateScrollPos (cyclomatic 19) console/src/main/resources/static/legacy/js/codemirror.js:3406— calculateScrollPos has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
calculateScrollPos (cyclomatic 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:3406— calculateScrollPos has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onDrop (cyclomatic 19) console/src/main/resources/static/legacy/js/codemirror.js:6431— onDrop has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onDrop (cyclomatic 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:6431— onDrop has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onMouseDown (cyclomatic 19) console/src/main/resources/static/legacy/js/codemirror.js:7106— onMouseDown has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onMouseDown (cyclomatic 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:7106— onMouseDown has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CodeMirror$1 (cyclomatic 19) console/src/main/resources/static/legacy/js/codemirror.js:7600— CodeMirror$1 has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CodeMirror$1 (cyclomatic 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:7600— CodeMirror$1 has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
endOperation_finish (cyclomatic 18) console/src/main/resources/static/legacy/js/codemirror.js:3813— endOperation_finish has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
endOperation_finish (cyclomatic 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:3813— endOperation_finish has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
locateNodeInLineView (cyclomatic 18) console/src/main/resources/static/legacy/js/codemirror.js:8955— locateNodeInLineView has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
locateNodeInLineView (cyclomatic 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:8955— locateNodeInLineView has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity· next (cyclomatic 16) · ×2
next (cyclomatic 16) console/src/main/resources/static/legacy/js/codemirror.lib.json-lint.js:314— next has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
next (cyclomatic 16) console/src/main/resources/static/console-ui/public/js/codemirror.lib.json-lint.js:314— next has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
updateLineGutter (cyclomatic 16) console/src/main/resources/static/legacy/js/codemirror.js:2330— updateLineGutter has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
updateLineGutter (cyclomatic 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:2330— updateLineGutter has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
addChangeToHistory (cyclomatic 16) console/src/main/resources/static/legacy/js/codemirror.js:4780— addChangeToHistory has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
addChangeToHistory (cyclomatic 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:4780— addChangeToHistory has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onKeyPress (cyclomatic 16) console/src/main/resources/static/legacy/js/codemirror.js:7057— onKeyPress has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onKeyPress (cyclomatic 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:7057— onKeyPress has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
insertLineContent (cognitive 135) console/src/main/resources/static/legacy/js/codemirror.js:2081— insertLineContent has cognitive complexity 135 (threshold 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.
insertLineContent (cognitive 135) console/src/main/resources/static/console-ui/public/js/codemirror.js:2081— insertLineContent has cognitive complexity 135 (threshold 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.
(anonymous) (cognitive 101) console/src/main/resources/static/legacy/js/codemirror.js:990— (anonymous) has cognitive complexity 101 (threshold 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.
(anonymous) (cognitive 101) console/src/main/resources/static/console-ui/public/js/codemirror.js:990— (anonymous) has cognitive complexity 101 (threshold 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.
skipAtomicInner (cognitive 99) console/src/main/resources/static/legacy/js/codemirror.js:5087— skipAtomicInner has cognitive complexity 99 (threshold 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.
skipAtomicInner (cognitive 99) console/src/main/resources/static/console-ui/public/js/codemirror.js:5087— skipAtomicInner has cognitive complexity 99 (threshold 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.
parse (cognitive 77) console/src/main/resources/static/legacy/js/codemirror.lib.json-lint.js:73— parse has cognitive complexity 77 (threshold 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.
parse (cognitive 77) console/src/main/resources/static/console-ui/public/js/codemirror.lib.json-lint.js:73— parse has cognitive complexity 77 (threshold 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.
stretchSpansOverChange (cognitive 63) console/src/main/resources/static/legacy/js/codemirror.js:607— stretchSpansOverChange has cognitive complexity 63 (threshold 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.
stretchSpansOverChange (cognitive 63) console/src/main/resources/static/console-ui/public/js/codemirror.js:607— stretchSpansOverChange has cognitive complexity 63 (threshold 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.
measureCharInner (cognitive 46) console/src/main/resources/static/legacy/js/codemirror.js:2639— measureCharInner has cognitive complexity 46 (threshold 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.
measureCharInner (cognitive 46) console/src/main/resources/static/console-ui/public/js/codemirror.js:2639— measureCharInner has cognitive complexity 46 (threshold 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.
coordsCharInner (cognitive 43) console/src/main/resources/static/legacy/js/codemirror.js:2890— coordsCharInner has cognitive complexity 43 (threshold 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.
coordsCharInner (cognitive 43) console/src/main/resources/static/console-ui/public/js/codemirror.js:2890— coordsCharInner has cognitive complexity 43 (threshold 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.
findPosH (cognitive 43) console/src/main/resources/static/legacy/js/codemirror.js:8422— findPosH has cognitive complexity 43 (threshold 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.
findPosH (cognitive 43) console/src/main/resources/static/console-ui/public/js/codemirror.js:8422— findPosH has cognitive complexity 43 (threshold 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.
buildToken (cognitive 40) console/src/main/resources/static/legacy/js/codemirror.js:1966— buildToken has cognitive complexity 40 (threshold 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.
buildToken (cognitive 40) console/src/main/resources/static/console-ui/public/js/codemirror.js:1966— buildToken has cognitive complexity 40 (threshold 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.
(anonymous) (cognitive 39) console/src/main/resources/static/legacy/js/codemirror.js:27— (anonymous) has cognitive complexity 39 (threshold 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.
(anonymous) (cognitive 39) console/src/main/resources/static/console-ui/public/js/codemirror.js:27— (anonymous) has cognitive complexity 39 (threshold 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.
nodeAndOffsetInLineMap (cognitive 38) console/src/main/resources/static/legacy/js/codemirror.js:2591— nodeAndOffsetInLineMap has cognitive complexity 38 (threshold 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.
nodeAndOffsetInLineMap (cognitive 38) console/src/main/resources/static/console-ui/public/js/codemirror.js:2591— nodeAndOffsetInLineMap has cognitive complexity 38 (threshold 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.
clear (cognitive 38) console/src/main/resources/static/legacy/js/codemirror.js:5747— clear has cognitive complexity 38 (threshold 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.
clear (cognitive 38) console/src/main/resources/static/console-ui/public/js/codemirror.js:5747— clear has cognitive complexity 38 (threshold 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.
markText (cognitive 38) console/src/main/resources/static/legacy/js/codemirror.js:5860— markText has cognitive complexity 38 (threshold 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.
markText (cognitive 38) console/src/main/resources/static/console-ui/public/js/codemirror.js:5860— markText has cognitive complexity 38 (threshold 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.
buildLineContent (cognitive 36) console/src/main/resources/static/legacy/js/codemirror.js:1899— buildLineContent has cognitive complexity 36 (threshold 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.
buildLineContent (cognitive 36) console/src/main/resources/static/console-ui/public/js/codemirror.js:1899— buildLineContent has cognitive complexity 36 (threshold 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.
applyTextInput (cognitive 36) console/src/main/resources/static/legacy/js/codemirror.js:7859— applyTextInput has cognitive complexity 36 (threshold 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.
applyTextInput (cognitive 36) console/src/main/resources/static/console-ui/public/js/codemirror.js:7859— applyTextInput has cognitive complexity 36 (threshold 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.
(anonymous) (cognitive 35) console-ui/src/pages/AI/McpDetail/ShowTools.js:838— (anonymous) has cognitive complexity 35 (threshold 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.
(anonymous) (cognitive 35) console-ui/src/pages/AI/McpDetail/McpDetail.js:190— (anonymous) has cognitive complexity 35 (threshold 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.
(anonymous) (cognitive 34) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1483— (anonymous) has cognitive complexity 34 (threshold 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.
(anonymous) (cognitive 34) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:1807— (anonymous) has cognitive complexity 34 (threshold 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.
regChange (cognitive 33) console/src/main/resources/static/legacy/js/codemirror.js:3893— regChange has cognitive complexity 33 (threshold 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.
regChange (cognitive 33) console/src/main/resources/static/console-ui/public/js/codemirror.js:3893— regChange has cognitive complexity 33 (threshold 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.
onScrollWheel (cognitive 33) console/src/main/resources/static/legacy/js/codemirror.js:4394— onScrollWheel has cognitive complexity 33 (threshold 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.
onScrollWheel (cognitive 33) console/src/main/resources/static/console-ui/public/js/codemirror.js:4394— onScrollWheel has cognitive complexity 33 (threshold 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.
pollContent (cognitive 33) console/src/main/resources/static/legacy/js/codemirror.js:8739— pollContent has cognitive complexity 33 (threshold 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.
pollContent (cognitive 33) console/src/main/resources/static/console-ui/public/js/codemirror.js:8739— pollContent has cognitive complexity 33 (threshold 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.
indentLine (cognitive 32) console/src/main/resources/static/legacy/js/codemirror.js:7791— indentLine has cognitive complexity 32 (threshold 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.
indentLine (cognitive 32) console/src/main/resources/static/console-ui/public/js/codemirror.js:7791— indentLine has cognitive complexity 32 (threshold 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.
moveVisually (cognitive 31) console/src/main/resources/static/legacy/js/codemirror.js:1158— moveVisually has cognitive complexity 31 (threshold 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.
moveVisually (cognitive 31) console/src/main/resources/static/console-ui/public/js/codemirror.js:1158— moveVisually has cognitive complexity 31 (threshold 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.
endOfLine (cognitive 30) console/src/main/resources/static/legacy/js/codemirror.js:1131— endOfLine has cognitive complexity 30 (threshold 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.
endOfLine (cognitive 30) console/src/main/resources/static/console-ui/public/js/codemirror.js:1131— endOfLine has cognitive complexity 30 (threshold 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.
conflictingCollapsedRange (cognitive 29) console/src/main/resources/static/legacy/js/codemirror.js:760— conflictingCollapsedRange has cognitive complexity 29 (threshold 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.
conflictingCollapsedRange (cognitive 29) console/src/main/resources/static/console-ui/public/js/codemirror.js:760— conflictingCollapsedRange has cognitive complexity 29 (threshold 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.
markedSpansAfter (cognitive 27) console/src/main/resources/static/legacy/js/codemirror.js:588— markedSpansAfter has cognitive complexity 27 (threshold 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.
markedSpansAfter (cognitive 27) console/src/main/resources/static/console-ui/public/js/codemirror.js:588— markedSpansAfter has cognitive complexity 27 (threshold 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.
showPrimarySelection (cognitive 27) console/src/main/resources/static/legacy/js/codemirror.js:8600— showPrimarySelection has cognitive complexity 27 (threshold 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.
showPrimarySelection (cognitive 27) console/src/main/resources/static/console-ui/public/js/codemirror.js:8600— showPrimarySelection has cognitive complexity 27 (threshold 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.
runMode (cognitive 26) console/src/main/resources/static/legacy/js/codemirror.js:1771— runMode has cognitive complexity 26 (threshold 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.
runMode (cognitive 26) console/src/main/resources/static/console-ui/public/js/codemirror.js:1771— runMode has cognitive complexity 26 (threshold 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.
copyHistoryArray (cognitive 26) console/src/main/resources/static/legacy/js/codemirror.js:4924— copyHistoryArray has cognitive complexity 26 (threshold 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.
copyHistoryArray (cognitive 26) console/src/main/resources/static/console-ui/public/js/codemirror.js:4924— copyHistoryArray has cognitive complexity 26 (threshold 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.
makeChangeFromHistory (cognitive 26) console/src/main/resources/static/legacy/js/codemirror.js:5216— makeChangeFromHistory has cognitive complexity 26 (threshold 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.
makeChangeFromHistory (cognitive 26) console/src/main/resources/static/console-ui/public/js/codemirror.js:5216— makeChangeFromHistory has cognitive complexity 26 (threshold 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.
updateLineGutter (cognitive 25) console/src/main/resources/static/legacy/js/codemirror.js:2330— updateLineGutter has cognitive complexity 25 (threshold 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.
updateLineGutter (cognitive 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:2330— updateLineGutter has cognitive complexity 25 (threshold 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.
alignHorizontally (cognitive 25) console/src/main/resources/static/legacy/js/codemirror.js:3300— alignHorizontally has cognitive complexity 25 (threshold 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.
alignHorizontally (cognitive 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:3300— alignHorizontally has cognitive complexity 25 (threshold 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.
scrollPosIntoView (cognitive 25) console/src/main/resources/static/legacy/js/codemirror.js:3362— scrollPosIntoView has cognitive complexity 25 (threshold 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.
scrollPosIntoView (cognitive 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:3362— scrollPosIntoView has cognitive complexity 25 (threshold 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.
locateNodeInLineView (cognitive 25) console/src/main/resources/static/legacy/js/codemirror.js:8955— locateNodeInLineView has cognitive complexity 25 (threshold 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.
locateNodeInLineView (cognitive 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:8955— locateNodeInLineView has cognitive complexity 25 (threshold 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.
find (cognitive 25) console/src/main/resources/static/legacy/js/codemirror.js:8976— find has cognitive complexity 25 (threshold 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.
find (cognitive 25) console/src/main/resources/static/console-ui/public/js/codemirror.js:8976— find has cognitive complexity 25 (threshold 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· next (cognitive 24) · ×2
next (cognitive 24) console/src/main/resources/static/legacy/js/codemirror.lib.json-lint.js:314— next has cognitive complexity 24 (threshold 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.
next (cognitive 24) console/src/main/resources/static/console-ui/public/js/codemirror.lib.json-lint.js:314— next has cognitive complexity 24 (threshold 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.
(anonymous) (cognitive 23) console-ui/src/pages/AI/NewSkill/NewSkill.js:1279— (anonymous) has cognitive complexity 23 (threshold 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.
(anonymous) (cognitive 23) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:1932— (anonymous) has cognitive complexity 23 (threshold 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.
markedSpansBefore (cognitive 23) console/src/main/resources/static/legacy/js/codemirror.js:577— markedSpansBefore has cognitive complexity 23 (threshold 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.
markedSpansBefore (cognitive 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:577— markedSpansBefore has cognitive complexity 23 (threshold 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.
calculateScrollPos (cognitive 23) console/src/main/resources/static/legacy/js/codemirror.js:3406— calculateScrollPos has cognitive complexity 23 (threshold 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.
calculateScrollPos (cognitive 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:3406— calculateScrollPos has cognitive complexity 23 (threshold 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.
endOperation_finish (cognitive 23) console/src/main/resources/static/legacy/js/codemirror.js:3813— endOperation_finish has cognitive complexity 23 (threshold 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.
endOperation_finish (cognitive 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:3813— endOperation_finish has cognitive complexity 23 (threshold 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.
normalizeKeyMap (cognitive 23) console/src/main/resources/static/legacy/js/codemirror.js:6662— normalizeKeyMap has cognitive complexity 23 (threshold 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.
normalizeKeyMap (cognitive 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:6662— normalizeKeyMap has cognitive complexity 23 (threshold 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.
onMouseDown (cognitive 23) console/src/main/resources/static/legacy/js/codemirror.js:7106— onMouseDown has cognitive complexity 23 (threshold 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.
onMouseDown (cognitive 23) console/src/main/resources/static/console-ui/public/js/codemirror.js:7106— onMouseDown has cognitive complexity 23 (threshold 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.
onDrop (cognitive 22) console/src/main/resources/static/legacy/js/codemirror.js:6431— onDrop has cognitive complexity 22 (threshold 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.
onDrop (cognitive 22) console/src/main/resources/static/console-ui/public/js/codemirror.js:6431— onDrop has cognitive complexity 22 (threshold 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.
triggerElectric (cognitive 22) console/src/main/resources/static/legacy/js/codemirror.js:7917— triggerElectric has cognitive complexity 22 (threshold 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.
triggerElectric (cognitive 22) console/src/main/resources/static/console-ui/public/js/codemirror.js:7917— triggerElectric has cognitive complexity 22 (threshold 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.
find (cognitive 20) console/src/main/resources/static/legacy/js/codemirror.js:5796— find has cognitive complexity 20 (threshold 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.
find (cognitive 20) console/src/main/resources/static/console-ui/public/js/codemirror.js:5796— find has cognitive complexity 20 (threshold 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.
configureMouse (cognitive 20) console/src/main/resources/static/legacy/js/codemirror.js:7163— configureMouse has cognitive complexity 20 (threshold 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.
configureMouse (cognitive 20) console/src/main/resources/static/console-ui/public/js/codemirror.js:7163— configureMouse has cognitive complexity 20 (threshold 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.
getBidiPartAt (cognitive 19) console/src/main/resources/static/legacy/js/codemirror.js:926— getBidiPartAt has cognitive complexity 19 (threshold 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.
getBidiPartAt (cognitive 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:926— getBidiPartAt has cognitive complexity 19 (threshold 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.
updateHeightsInViewport (cognitive 19) console/src/main/resources/static/legacy/js/codemirror.js:3242— updateHeightsInViewport has cognitive complexity 19 (threshold 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.
updateHeightsInViewport (cognitive 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:3242— updateHeightsInViewport has cognitive complexity 19 (threshold 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.
mergeOldSpans (cognitive 19) console/src/main/resources/static/legacy/js/codemirror.js:4900— mergeOldSpans has cognitive complexity 19 (threshold 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.
mergeOldSpans (cognitive 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:4900— mergeOldSpans has cognitive complexity 19 (threshold 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.
CodeMirror$1 (cognitive 19) console/src/main/resources/static/legacy/js/codemirror.js:7600— CodeMirror$1 has cognitive complexity 19 (threshold 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.
CodeMirror$1 (cognitive 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:7600— CodeMirror$1 has cognitive complexity 19 (threshold 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· walk (cognitive 19) · ×2
walk (cognitive 19) console/src/main/resources/static/legacy/js/codemirror.js:8904— walk has cognitive complexity 19 (threshold 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.
walk (cognitive 19) console/src/main/resources/static/console-ui/public/js/codemirror.js:8904— walk has cognitive complexity 19 (threshold 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.
removeReadOnlyRanges (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:680— removeReadOnlyRanges has cognitive complexity 18 (threshold 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.
removeReadOnlyRanges (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:680— removeReadOnlyRanges has cognitive complexity 18 (threshold 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.
update (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:3551— update has cognitive complexity 18 (threshold 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.
update (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:3551— update has cognitive complexity 18 (threshold 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.
viewCuttingPoint (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:3978— viewCuttingPoint has cognitive complexity 18 (threshold 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.
viewCuttingPoint (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:3978— viewCuttingPoint has cognitive complexity 18 (threshold 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.
updateDisplayIfNeeded (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:4156— updateDisplayIfNeeded has cognitive complexity 18 (threshold 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.
updateDisplayIfNeeded (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:4156— updateDisplayIfNeeded has cognitive complexity 18 (threshold 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.
patchDisplay (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:4275— patchDisplay has cognitive complexity 18 (threshold 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.
patchDisplay (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:4275— patchDisplay has cognitive complexity 18 (threshold 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.
makeChange (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:5176— makeChange has cognitive complexity 18 (threshold 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.
makeChange (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:5176— makeChange has cognitive complexity 18 (threshold 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.
poll (cognitive 18) console/src/main/resources/static/legacy/js/codemirror.js:9214— poll has cognitive complexity 18 (threshold 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.
poll (cognitive 18) console/src/main/resources/static/console-ui/public/js/codemirror.js:9214— poll has cognitive complexity 18 (threshold 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.
lineIsHidden (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:827— lineIsHidden has cognitive complexity 17 (threshold 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.
lineIsHidden (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:827— lineIsHidden has cognitive complexity 17 (threshold 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.
intoCoordSystem (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:2741— intoCoordSystem has cognitive complexity 17 (threshold 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.
intoCoordSystem (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:2741— intoCoordSystem has cognitive complexity 17 (threshold 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.
rebaseHistArray (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:5421— rebaseHistArray has cognitive complexity 17 (threshold 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.
rebaseHistArray (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:5421— rebaseHistArray has cognitive complexity 17 (threshold 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.
leftButtonSelect (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:7242— leftButtonSelect has cognitive complexity 17 (threshold 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.
leftButtonSelect (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:7242— leftButtonSelect has cognitive complexity 17 (threshold 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.
getHelpers (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:8105— getHelpers has cognitive complexity 17 (threshold 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.
getHelpers (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:8105— getHelpers has cognitive complexity 17 (threshold 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.
reset (cognitive 17) console/src/main/resources/static/legacy/js/codemirror.js:9144— reset has cognitive complexity 17 (threshold 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.
reset (cognitive 17) console/src/main/resources/static/console-ui/public/js/codemirror.js:9144— reset has cognitive complexity 17 (threshold 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.
success (cognitive 16) console-ui/src/pages/AI/PromptDetail/PromptDetail.js:185— success has cognitive complexity 16 (threshold 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.
success (cognitive 16) console-ui/src/pages/AI/NewSkill/NewSkill.js:396— success has cognitive complexity 16 (threshold 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.
postUpdateDisplay (cognitive 16) console/src/main/resources/static/legacy/js/codemirror.js:4228— postUpdateDisplay has cognitive complexity 16 (threshold 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.
postUpdateDisplay (cognitive 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:4228— postUpdateDisplay has cognitive complexity 16 (threshold 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.
addChangeToHistory (cognitive 16) console/src/main/resources/static/legacy/js/codemirror.js:4780— addChangeToHistory has cognitive complexity 16 (threshold 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.
addChangeToHistory (cognitive 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:4780— addChangeToHistory has cognitive complexity 16 (threshold 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.
makeChangeSingleDocInEditor (cognitive 16) console/src/main/resources/static/legacy/js/codemirror.js:5338— makeChangeSingleDocInEditor has cognitive complexity 16 (threshold 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.
makeChangeSingleDocInEditor (cognitive 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:5338— makeChangeSingleDocInEditor has cognitive complexity 16 (threshold 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.
findWordAt (cognitive 16) console/src/main/resources/static/legacy/js/codemirror.js:8296— findWordAt has cognitive complexity 16 (threshold 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.
findWordAt (cognitive 16) console/src/main/resources/static/console-ui/public/js/codemirror.js:8296— findWordAt has cognitive complexity 16 (threshold 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.
Medium IaC: CKV_DOCKER_3 console/src/main/resources/static/legacy/js/vs/basic-languages/src/dockerfile.js:1— Ensure that a user for the container has been created
Medium IaC: CKV_DOCKER_3 console/src/main/resources/static/console-ui/public/js/vs/basic-languages/src/dockerfile.js:1— Ensure that a user for the container has been created
Duplicated block (17 lines × 2) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1126— client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1126-1142 | client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1219-1236 — both copies are in the same file, so extract the 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 `client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1126` it begins part-way through the construct above it, so those exact lines 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) api/src/main/java/com/alibaba/nacos/api/ai/model/a2a/AgentEndpoint.java:175— api/src/main/java/com/alibaba/nacos/api/ai/model/a2a/AgentEndpoint.java:175-192 | config/src/main/java/com/alibaba/nacos/config/server/model/ConfigAdvanceInfo.java:132-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. 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) ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:147— ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:147-163 | ai/src/main/java/com/alibaba/nacos/ai/config/SkillDataBootstrapInitializer.java:139-154 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ai/src/main/java/com/alibaba/nacos/ai/config/AgentSpecDataBootstrapInitializer.java:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) config/src/main/java/com/alibaba/nacos/config/server/service/ConfigCacheService.java:293— config/src/main/java/com/alibaba/nacos/config/server/service/ConfigCacheService.java:293-308 | config/src/main/java/com/alibaba/nacos/config/server/service/ConfigCacheService.java:347-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `config/src/main/java/com/alibaba/nacos/config/server/service/ConfigCacheService.java:293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 4) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:280— config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:280-289 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoGrayPersistServiceImpl.java:336-345 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:266-275 | config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoGrayPersistServiceImpl.java:319-328 — 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.
Duplicated block (10 lines × 4) plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/AiResourceMapperByDerby.java:37— plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-derby/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/AiResourceMapperByDerby.java:37-47 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/AiResourceMapperByMySql.java:38-47 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-oracle/src/main/java/com/alibaba/nacos/plugin/datasource/impl/oracle/AiResourceMapperByOracle.java:35-45 | plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-postgresql/src/main/java/com/alibaba/nacos/plugin/datasource/impl/postgresql/AiResourceMapperByPostgresql.java:37-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 4) client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:251— client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:251-259 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:282-290 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:313-321 | client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:457-465 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `client/src/main/java/com/alibaba/nacos/client/ai/remote/AiHttpClientProxy.java:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java:66— plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java:66-74 | plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java:122-130 | plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalPermissionPersistServiceImpl.java:76-86 | plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalPermissionPersistServiceImpl.java:148-158 — 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 `plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (5 lines × 3) ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1267— ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1267-1271 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1284-1288 | ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1299-1303 — 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 `ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) core/src/main/java/com/alibaba/nacos/core/plugin/PluginStateSnapshotOperation.java:125— core/src/main/java/com/alibaba/nacos/core/plugin/PluginStateSnapshotOperation.java:125-132 | lock/src/main/java/com/alibaba/nacos/lock/persistence/NacosLockSnapshotOperation.java:142-146 | naming/src/main/java/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.java:355-359 — 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 `core/src/main/java/com/alibaba/nacos/core/plugin/PluginStateSnapshotOperation.java:125` it does not close everything it opens, so those 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.
render (cyclomatic 81) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:1825— render has cyclomatic complexity 81 (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.
SkillOptimizationServiceImpl.buildConversationMessages (cyclomatic 50) copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillOptimizationServiceImpl.java:141— SkillOptimizationServiceImpl.buildConversationMessages 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.
render (cyclomatic 50) console-ui/src/pages/AI/McpDetail/McpDetail.js:1024— render has cyclomatic complexity 50 (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.
renderInputSection (cyclomatic 48) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1119— renderInputSection has cyclomatic complexity 48 (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.
SwitchManager.update (cyclomatic 47) naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java:109— SwitchManager.update has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 44) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:556— (anonymous) has cyclomatic complexity 44 (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.
convertPackageToMcpConfig (cyclomatic 43) console-ui/src/pages/AI/McpDetail/McpDetail.js:414— convertPackageToMcpConfig has cyclomatic complexity 43 (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.
renderFileTree (cyclomatic 41) console-ui/src/pages/AI/NewSkill/NewSkill.js:2908— renderFileTree has cyclomatic complexity 41 (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.
convertOperation (cyclomatic 41) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:73— convertOperation has cyclomatic complexity 41 (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.
(anonymous) (cyclomatic 40) console-ui/src/pages/AI/services/OpenApiService.js:163— (anonymous) has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
render (cyclomatic 37) console-ui/src/pages/AI/NewSkill/NewSkill.js:3271— render has cyclomatic complexity 37 (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.
renderFileTree (cyclomatic 36) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:1495— renderFileTree has cyclomatic complexity 36 (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.
renderPackageDetails (cyclomatic 35) console-ui/src/pages/AI/McpDetail/McpDetail.js:630— renderPackageDetails has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
openVisible (cyclomatic 33) console-ui/src/pages/AI/McpDetail/CreateTools/index.js:49— openVisible has cyclomatic complexity 33 (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.
SchemaEditor (cyclomatic 33) console-ui/src/pages/AI/McpDetail/CreateTools/SchemaEditor.js:10— SchemaEditor has cyclomatic complexity 33 (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.
(anonymous) (cyclomatic 32) console-ui/src/pages/AI/McpDetail/ShowTools.js:838— (anonymous) has cyclomatic complexity 32 (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.
ShowTools (cyclomatic 31) console-ui/src/pages/AI/McpDetail/ShowTools.js:19— ShowTools has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
render (cyclomatic 30) console-ui/src/pages/AI/PromptOptimizeDialog/PromptOptimizeDialog.js:331— render has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
initEditedData (cyclomatic 30) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:107— initEditedData has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AnnotationsEditor (cyclomatic 30) console-ui/src/pages/AI/McpDetail/CreateTools/AnnotationsEditor.js:14— AnnotationsEditor has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity· N (cyclomatic 28) · ×1
N (cyclomatic 28) console/src/main/resources/static/next/js/vendor-icons.js:1— N has cyclomatic complexity 28 (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.
success (cyclomatic 27) console-ui/src/pages/AI/NewAgent/NewAgent.js:82— success has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 26) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:1932— (anonymous) has cyclomatic complexity 26 (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.
RpcClient.start (cyclomatic 25) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:246— RpcClient.start 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.
render (cyclomatic 25) console-ui/src/pages/AI/NewPrompt/NewPrompt.js:228— render has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 25) console-ui/src/pages/AI/McpDetail/McpDetail.js:190— (anonymous) has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
validateProperties (cyclomatic 24) console-ui/src/utils/validateContent.js:154— validateProperties has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 24) console-ui/src/pages/AI/McpDetail/ShowTools.js:555— (anonymous) has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SkillZipParser.parseMultipleSkillsFromZip (cyclomatic 23) ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:274— SkillZipParser.parseMultipleSkillsFromZip 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.
ParamUtils.checkParam (cyclomatic 23) config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java:148— ParamUtils.checkParam 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.
isPureJsonContent (cyclomatic 23) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:889— isPureJsonContent has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
renderCollapsibleSection (cyclomatic 23) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:977— renderCollapsibleSection has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
success (cyclomatic 23) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:145— success has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleOptimizeSuccess (cyclomatic 23) console-ui/src/pages/AI/NewSkill/NewSkill.js:2244— handleOptimizeSuccess has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleCustomService (cyclomatic 22) console-ui/src/globalLib.js:430— handleCustomService has cyclomatic complexity 22 (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.
renderOptimizedPreview (cyclomatic 22) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1382— renderOptimizedPreview has cyclomatic complexity 22 (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.
renderCollapsibleSection (cyclomatic 22) console-ui/src/pages/AI/NewSkill/NewSkill.js:1651— renderCollapsibleSection has cyclomatic complexity 22 (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.
parseOptimizedSkillFromContent (cyclomatic 21) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:562— parseOptimizedSkillFromContent 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.
success (cyclomatic 21) console-ui/src/pages/AI/NewSkill/NewSkill.js:221— success 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.
renderGeneratedSkill (cyclomatic 21) console-ui/src/pages/AI/NewSkill/NewSkill.js:1837— renderGeneratedSkill 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.
constructor (cyclomatic 21) console-ui/src/pages/AI/McpManagement/McpManagement.js:71— constructor 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.
(anonymous) (cyclomatic 21) console-ui/src/pages/AI/AgentDetail/AgentDetail.js:237— (anonymous) 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.
RpcClient.reconnect (cyclomatic 20) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:488— RpcClient.reconnect 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.
EmbeddedConfigInfoPersistServiceImpl.batchInsertOrUpdate (cyclomatic 20) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:371— EmbeddedConfigInfoPersistServiceImpl.batchInsertOrUpdate 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.
render (cyclomatic 20) console-ui/src/pages/PluginManagement/PluginList/PluginDetail.js:222— render has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
processImportAndCloneResult (cyclomatic 20) console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js:980— processImportAndCloneResult has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleApply (cyclomatic 20) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:746— handleApply has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
success (cyclomatic 20) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:341— success has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AdvancedConfig (cyclomatic 20) console-ui/src/pages/AI/McpDetail/CreateTools/AdvancedConfig.js:12— AdvancedConfig has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
validateTemplateFormat (cyclomatic 20) console-ui/src/pages/AI/McpDetail/CreateTools/AdvancedConfig.js:44— validateTemplateFormat has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SkillGenerationServiceImpl.buildUserMessage (cyclomatic 19) copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillGenerationServiceImpl.java:114— SkillGenerationServiceImpl.buildUserMessage 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.
Request (cyclomatic 19) console-ui/src/globalLib.js:493— Request has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
constructor (cyclomatic 19) console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js:83— constructor has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleOptimize (cyclomatic 19) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:276— handleOptimize has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
createResponseTemplate (cyclomatic 19) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:341— createResponseTemplate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
processSchemaProperties (cyclomatic 19) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:419— processSchemaProperties has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
processArgument (cyclomatic 19) console-ui/src/pages/AI/McpDetail/McpDetail.js:559— processArgument has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
rawDataToFiledValue (cyclomatic 19) console-ui/src/pages/AI/McpDetail/CreateTools/utils.js:41— rawDataToFiledValue has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ConfigRpcTransportClient.checkListenCache (cyclomatic 18) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1145— ConfigRpcTransportClient.checkListenCache 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.
NamingFuzzyWatchNotifyRequestHandler.requestReply (cyclomatic 18) client/src/main/java/com/alibaba/nacos/client/naming/remote/gprc/NamingFuzzyWatchNotifyRequestHandler.java:54— NamingFuzzyWatchNotifyRequestHandler.requestReply 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.
ConfigCloneService.cloneConfig (cyclomatic 18) config/src/main/java/com/alibaba/nacos/config/server/service/ConfigCloneService.java:79— ConfigCloneService.cloneConfig 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.
GrpcBiStreamRequestAcceptor.streamObserverOnNext (cyclomatic 18) core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcBiStreamRequestAcceptor.java:141— GrpcBiStreamRequestAcceptor.streamObserverOnNext 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.
Base64Decode.decode (cyclomatic 18) plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/utils/Base64Decode.java:52— Base64Decode.decode 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.
validateProperty (cyclomatic 18) console-ui/src/utils/validateContent.js:23— validateProperty has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
render (cyclomatic 18) console-ui/src/pages/ConfigurationManagement/ConfigEditor/NewConfigEditor.js:471— render has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleExport (cyclomatic 18) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:1360— handleExport has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PromptOperationServiceImpl.listPrompts (cyclomatic 17) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:536— PromptOperationServiceImpl.listPrompts 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.
SkillUtils.syncToLocalCore (cyclomatic 17) api/src/main/java/com/alibaba/nacos/api/ai/model/skills/SkillUtils.java:384— SkillUtils.syncToLocalCore 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.
ConfigEncryptionFilter.doFilter (cyclomatic 17) client/src/main/java/com/alibaba/nacos/client/config/filter/impl/ConfigEncryptionFilter.java:46— ConfigEncryptionFilter.doFilter 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.
LockGrpcClient.lock (cyclomatic 17) client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:137— LockGrpcClient.lock 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.
Builder.fromProperties (cyclomatic 17) common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/DefaultGrpcClientConfig.java:269— Builder.fromProperties 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.
DumpAllProcessor.process (cyclomatic 17) config/src/main/java/com/alibaba/nacos/config/server/service/dump/processor/DumpAllProcessor.java:55— DumpAllProcessor.process 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.
saveConfig (cyclomatic 17) console-ui/src/pages/SettingCenter/CopilotConfig.js:75— saveConfig has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 17) console-ui/src/pages/AI/NewSkill/NewSkill.js:1156— (anonymous) has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleSSEMessage (cyclomatic 17) console-ui/src/pages/AI/NewSkill/NewSkill.js:1241— handleSSEMessage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onChange (cyclomatic 17) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:1361— onChange has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Base64.encode (cyclomatic 16) common/src/main/java/com/alibaba/nacos/common/codec/Base64.java:220— Base64.encode 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.
DefaultParamChecker.checkParamInfoFormat (cyclomatic 16) common/src/main/java/com/alibaba/nacos/common/paramcheck/DefaultParamChecker.java:126— DefaultParamChecker.checkParamInfoFormat 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.
RpcClient.request (cyclomatic 16) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:660— RpcClient.request 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.
ConfigInfoBase.equals (cyclomatic 16) config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoBase.java:175— ConfigInfoBase.equals 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.
ExternalConfigInfoPersistServiceImpl.batchInsertOrUpdate (cyclomatic 16) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:454— ExternalConfigInfoPersistServiceImpl.batchInsertOrUpdate 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.
JwtTokenValidator.validateClaims (cyclomatic 16) plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/token/JwtTokenValidator.java:202— JwtTokenValidator.validateClaims 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.
render (cyclomatic 16) console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js:1216— render has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
handleSSEMessage (cyclomatic 16) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:649— handleSSEMessage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
onload (cyclomatic 16) console-ui/src/pages/AI/SkillManagement/SkillManagement.js:552— onload has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
findFileInTree (cyclomatic 16) console-ui/src/pages/AI/NewSkill/NewSkill.js:299— findFileInTree has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
convertOperation (cognitive 180) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:73— convertOperation has cognitive complexity 180 (threshold 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.
SkillOptimizationServiceImpl.buildConversationMessages (cognitive 116) copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillOptimizationServiceImpl.java:141— SkillOptimizationServiceImpl.buildConversationMessages has cognitive complexity 116 (threshold 15). Drivers by points: if/else 95, boolean chains 12, loops 9 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render (cognitive 76) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:1825— render has cognitive complexity 76 (threshold 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.
SwitchManager.update (cognitive 70) naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java:109— SwitchManager.update has cognitive complexity 70 (threshold 15). Drivers by points: if/else 65, loops 3, boolean chains 1, error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 63) console-ui/src/pages/AI/services/OpenApiService.js:163— (anonymous) has cognitive complexity 63 (threshold 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.
ParamUtils.checkParam (cognitive 61) config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java:148— ParamUtils.checkParam has cognitive complexity 61 (threshold 15). Drivers by points: if/else 51, boolean chains 5, loops 5 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 61) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:556— (anonymous) has cognitive complexity 61 (threshold 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.
RpcClient.start (cognitive 59) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:246— RpcClient.start has cognitive complexity 59 (threshold 15). Drivers by points: if/else 45, error handling 6, loops 6, boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convertPackageToMcpConfig (cognitive 55) console-ui/src/pages/AI/McpDetail/McpDetail.js:414— convertPackageToMcpConfig has cognitive complexity 55 (threshold 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.
render (cognitive 52) console-ui/src/pages/AI/McpDetail/McpDetail.js:1024— render has cognitive complexity 52 (threshold 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.
initEditedData (cognitive 51) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:107— initEditedData has cognitive complexity 51 (threshold 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.
renderInputSection (cognitive 49) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1119— renderInputSection has cognitive complexity 49 (threshold 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.
parseOptimizedSkillFromContent (cognitive 48) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:562— parseOptimizedSkillFromContent has cognitive complexity 48 (threshold 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.
SkillGenerationServiceImpl.buildUserMessage (cognitive 46) copilot/src/main/java/com/alibaba/nacos/copilot/service/SkillGenerationServiceImpl.java:114— SkillGenerationServiceImpl.buildUserMessage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 39, loops 4, boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 46) console-ui/src/pages/AI/McpDetail/CreateTools/index.js:229— (anonymous) has cognitive complexity 46 (threshold 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.
CollectionUtils.get (cognitive 45) common/src/main/java/com/alibaba/nacos/common/utils/CollectionUtils.java:78— CollectionUtils.get has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25, loops 12, error handling 8 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderFileTree (cognitive 44) console-ui/src/pages/AI/NewSkill/NewSkill.js:2908— renderFileTree has cognitive complexity 44 (threshold 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.
(anonymous) (cognitive 44) console-ui/src/pages/AI/NewAgent/NewAgent.js:161— (anonymous) has cognitive complexity 44 (threshold 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.
validateProperties (cognitive 42) console-ui/src/utils/validateContent.js:154— validateProperties has cognitive complexity 42 (threshold 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.
NamingFuzzyWatchNotifyRequestHandler.requestReply (cognitive 41) client/src/main/java/com/alibaba/nacos/client/naming/remote/gprc/NamingFuzzyWatchNotifyRequestHandler.java:54— NamingFuzzyWatchNotifyRequestHandler.requestReply has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23, loops 12, boolean chains 3, match/switch 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbeddedConfigInfoPersistServiceImpl.batchInsertOrUpdate (cognitive 39) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:371— EmbeddedConfigInfoPersistServiceImpl.batchInsertOrUpdate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26, loops 5, error handling 4, boolean chains 2, ternaries 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.
renderFileTree (cognitive 39) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:1495— renderFileTree has cognitive complexity 39 (threshold 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.
SkillZipParser.parseResources (cognitive 38) ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:646— SkillZipParser.parseResources has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23, loops 12, boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleCustomService (cognitive 38) console-ui/src/globalLib.js:430— handleCustomService has cognitive complexity 38 (threshold 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.
ConfigRpcTransportClient.checkListenCache (cognitive 37) client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java:1145— ConfigRpcTransportClient.checkListenCache has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18, loops 12, error handling 6, 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.
openVisible (cognitive 37) console-ui/src/pages/AI/McpDetail/CreateTools/index.js:49— openVisible has cognitive complexity 37 (threshold 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.
GrpcBiStreamRequestAcceptor.streamObserverOnNext (cognitive 35) core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcBiStreamRequestAcceptor.java:141— GrpcBiStreamRequestAcceptor.streamObserverOnNext has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21, error handling 7, boolean chains 4, ternaries 3 (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.
RpcClient.reconnect (cognitive 34) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:488— RpcClient.reconnect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19, ternaries 6, error handling 5, boolean chains 3, 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.
DumpAllProcessor.process (cognitive 34) config/src/main/java/com/alibaba/nacos/config/server/service/dump/processor/DumpAllProcessor.java:55— DumpAllProcessor.process has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27, loops 4, boolean chains 2, error handling 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.
render (cognitive 34) console-ui/src/pages/AI/NewSkill/NewSkill.js:3271— render has cognitive complexity 34 (threshold 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.
PromptOperationServiceImpl.listPrompts (cognitive 33) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:536— PromptOperationServiceImpl.listPrompts has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 21, if/else 8, boolean chains 2, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillUtils.syncToLocalCore (cognitive 32) api/src/main/java/com/alibaba/nacos/api/ai/model/skills/SkillUtils.java:384— SkillUtils.syncToLocalCore has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, error handling 4, boolean chains 3, ternaries 3, loops 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.
processImportAndCloneResult (cognitive 32) console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js:980— processImportAndCloneResult has cognitive complexity 32 (threshold 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.
success (cognitive 32) console-ui/src/pages/AI/NewAgent/NewAgent.js:82— success has cognitive complexity 32 (threshold 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.
processSchemaProperties (cognitive 32) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:419— processSchemaProperties has cognitive complexity 32 (threshold 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.
RpcClient.request (cognitive 31) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:660— RpcClient.request has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19, error handling 6, boolean chains 3, ternaries 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
findFileInTree (cognitive 31) console-ui/src/pages/AI/NewSkill/NewSkill.js:299— findFileInTree has cognitive complexity 31 (threshold 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.
processArgument (cognitive 31) console-ui/src/pages/AI/McpDetail/McpDetail.js:559— processArgument has cognitive complexity 31 (threshold 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.
renderPackageDetails (cognitive 31) console-ui/src/pages/AI/McpDetail/McpDetail.js:630— renderPackageDetails has cognitive complexity 31 (threshold 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.
SkillZipParser.parseMultipleSkillsFromZip (cognitive 30) ai/src/main/java/com/alibaba/nacos/ai/utils/SkillZipParser.java:274— SkillZipParser.parseMultipleSkillsFromZip has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, loops 6, error handling 4, 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.
Base64.encode (cognitive 30) common/src/main/java/com/alibaba/nacos/common/codec/Base64.java:220— Base64.encode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, boolean chains 3, loops 2, match/switch 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.
(anonymous) (cognitive 30) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:105— (anonymous) has cognitive complexity 30 (threshold 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.
createResponseTemplate (cognitive 30) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:341— createResponseTemplate has cognitive complexity 30 (threshold 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.
YmlChangeParser.buildFlattenedMap (cognitive 29) client/src/main/java/com/alibaba/nacos/client/config/impl/YmlChangeParser.java:90— YmlChangeParser.buildFlattenedMap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 7, ternaries 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InetUtils.findFirstNonLoopbackAddress (cognitive 29) sys/src/main/java/com/alibaba/nacos/sys/utils/InetUtils.java:196— InetUtils.findFirstNonLoopbackAddress has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15, loops 5, ternaries 5, boolean chains 2, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleOptimizeSuccess (cognitive 29) console-ui/src/pages/AI/NewSkill/NewSkill.js:2244— handleOptimizeSuccess has cognitive complexity 29 (threshold 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.
rawDataToFiledValue (cognitive 29) console-ui/src/pages/AI/McpDetail/CreateTools/utils.js:41— rawDataToFiledValue has cognitive complexity 29 (threshold 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.
AnnotationsEditor (cognitive 29) console-ui/src/pages/AI/McpDetail/CreateTools/AnnotationsEditor.js:14— AnnotationsEditor has cognitive complexity 29 (threshold 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.
EnvUtil.setSelfEnv (cognitive 28) client/src/main/java/com/alibaba/nacos/client/utils/EnvUtil.java:41— EnvUtil.setSelfEnv has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (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.
ConfigInfoBase.compareTo (cognitive 28) config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoBase.java:117— ConfigInfoBase.compareTo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (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.
1.onNext (cognitive 28) console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/ConsoleCopilotController.java:164— 1.onNext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10, ternaries 8, boolean chains 4, error handling 3, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockGrpcClient.lock (cognitive 27) client/src/main/java/com/alibaba/nacos/client/lock/remote/grpc/LockGrpcClient.java:137— LockGrpcClient.lock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, error handling 2, boolean chains 1, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExternalConfigInfoPersistServiceImpl.batchInsertOrUpdate (cognitive 27) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:454— ExternalConfigInfoPersistServiceImpl.batchInsertOrUpdate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, loops 5, error handling 4, boolean chains 2, ternaries 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
isPureJsonContent (cognitive 27) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:889— isPureJsonContent has cognitive complexity 27 (threshold 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.
render (cognitive 27) console-ui/src/pages/AI/PromptOptimizeDialog/PromptOptimizeDialog.js:331— render has cognitive complexity 27 (threshold 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.
onChange (cognitive 27) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:1361— onChange has cognitive complexity 27 (threshold 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.
ExternalConfigInfoPersistServiceImpl.findAllConfigInfo4Export (cognitive 26) config/src/main/java/com/alibaba/nacos/config/server/service/repository/extrnal/ExternalConfigInfoPersistServiceImpl.java:1322— ExternalConfigInfoPersistServiceImpl.findAllConfigInfo4Export has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 1, error handling 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopilotHttpParamExtractor.extractParam (cognitive 26) console/src/main/java/com/alibaba/nacos/console/controller/v3/ai/CopilotHttpParamExtractor.java:43— CopilotHttpParamExtractor.extractParam has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, error handling 6, loops 2, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServiceEntryXdsGenerator.deltaGenerate (cognitive 26) istio/src/main/java/com/alibaba/nacos/istio/xds/ServiceEntryXdsGenerator.java:96— ServiceEntryXdsGenerator.deltaGenerate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 5 (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.
success (cognitive 26) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:145— success has cognitive complexity 26 (threshold 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.
extractPackageNameFromArgs (cognitive 26) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:363— extractPackageNameFromArgs has cognitive complexity 26 (threshold 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.
validateTemplateFormat (cognitive 26) console-ui/src/pages/AI/McpDetail/CreateTools/AdvancedConfig.js:44— validateTemplateFormat has cognitive complexity 26 (threshold 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.
AgentRequestUtil.normalizeSupportedInterfaces (cognitive 25) ai/src/main/java/com/alibaba/nacos/ai/utils/AgentRequestUtil.java:185— AgentRequestUtil.normalizeSupportedInterfaces has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 5 (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.
CollectionUtils.size (cognitive 25) common/src/main/java/com/alibaba/nacos/common/utils/CollectionUtils.java:144— CollectionUtils.size has cognitive complexity 25 (threshold 15). Drivers by points: loops 11, error handling 7, if/else 7 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DumpChangeGrayConfigWorker.run (cognitive 25) config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeGrayConfigWorker.java:60— DumpChangeGrayConfigWorker.run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, loops 6, boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbeddedConfigInfoPersistServiceImpl.findAllConfigInfo4Export (cognitive 25) config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java:1179— EmbeddedConfigInfoPersistServiceImpl.findAllConfigInfo4Export has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NacosRuntimeConnectionEjector.ejectOverLimitConnection (cognitive 25) core/src/main/java/com/alibaba/nacos/core/remote/NacosRuntimeConnectionEjector.java:151— NacosRuntimeConnectionEjector.ejectOverLimitConnection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 3, error handling 2, 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.
EdsGenerator.deltaGenerate (cognitive 25) istio/src/main/java/com/alibaba/nacos/istio/xds/EdsGenerator.java:93— EdsGenerator.deltaGenerate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 4 (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.
JwtTokenValidator.validateClaims (cognitive 25) plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/token/JwtTokenValidator.java:202— JwtTokenValidator.validateClaims has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 5, ternaries 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
success (cognitive 25) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:341— success has cognitive complexity 25 (threshold 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.
SchemaEditor (cognitive 25) console-ui/src/pages/AI/McpDetail/CreateTools/SchemaEditor.js:10— SchemaEditor has cognitive complexity 25 (threshold 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.
(anonymous) (cognitive 25) console-ui/src/pages/AI/McpDetail/CreateTools/SchemaEditor.js:644— (anonymous) has cognitive complexity 25 (threshold 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.
N (cognitive 25) console/src/main/resources/static/next/js/vendor-icons.js:1— N has cognitive complexity 25 (threshold 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.
render (cognitive 24) console-ui/src/pages/AI/NewPrompt/NewPrompt.js:228— render has cognitive complexity 24 (threshold 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.
createRequestTemplate (cognitive 24) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:283— createRequestTemplate has cognitive complexity 24 (threshold 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.
NetUtils.findFirstNonLoopbackAddress (cognitive 23) api/src/main/java/com/alibaba/nacos/api/utils/NetUtils.java:71— NetUtils.findFirstNonLoopbackAddress has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, loops 4, ternaries 4, boolean chains 2, error handling 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.
MultiTagMatchGrayRule.match (cognitive 23) config/src/main/java/com/alibaba/nacos/config/server/model/gray/multitag/MultiTagMatchGrayRule.java:113— MultiTagMatchGrayRule.match has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerMethodsCache.initClassMethod (cognitive 23) core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java:169— ControllerMethodsCache.initClassMethod has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, loops 11 (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.
NacosRuntimeConnectionEjector.ejectOutdatedConnection (cognitive 23) core/src/main/java/com/alibaba/nacos/core/remote/NacosRuntimeConnectionEjector.java:59— NacosRuntimeConnectionEjector.ejectOutdatedConnection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, error handling 7, loops 5 (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.
validateProperty (cognitive 23) console-ui/src/utils/validateContent.js:23— validateProperty has cognitive complexity 23 (threshold 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.
computeDiff (cognitive 23) console-ui/src/pages/AI/PromptOptimizeDialog/PromptOptimizeDialog.js:229— computeDiff has cognitive complexity 23 (threshold 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.
NacosMcpRegistryService.listMcpServerByNamespaceList (cognitive 22) ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/service/NacosMcpRegistryService.java:118— NacosMcpRegistryService.listMcpServerByNamespaceList has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 3, ternaries 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupKey.parseKey (cognitive 22) client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java:75— GroupKey.parseKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, 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.
FailoverSwitchRefresher.run (cognitive 22) client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java:96— FailoverSwitchRefresher.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 4, boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamingHttpClientProxy.reqApi (cognitive 22) client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java:378— NamingHttpClientProxy.reqApi has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, error handling 6, loops 4, 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.
DumpChangeConfigWorker.run (cognitive 22) config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java:68— DumpChangeConfigWorker.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigCloneService.cloneConfig (cognitive 22) config/src/main/java/com/alibaba/nacos/config/server/service/ConfigCloneService.java:79— ConfigCloneService.cloneConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8, ternaries 7, boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MD5Util.getClientMd5Map (cognitive 22) config/src/main/java/com/alibaba/nacos/config/server/utils/MD5Util.java:112— MD5Util.getClientMd5Map has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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.
Base64Decode.decode (cognitive 22) plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/utils/Base64Decode.java:52— Base64Decode.decode has cognitive complexity 22 (threshold 15). Drivers by points: loops 7, ternaries 6, if/else 5, boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderOptimizedPreview (cognitive 22) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:1382— renderOptimizedPreview has cognitive complexity 22 (threshold 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.
extractPackageName (cognitive 22) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:450— extractPackageName has cognitive complexity 22 (threshold 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.
extractToolsFromOpenAPI (cognitive 22) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:6— extractToolsFromOpenAPI has cognitive complexity 22 (threshold 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.
allOfHandle (cognitive 22) console-ui/src/pages/AI/McpDetail/Swagger2Tools.js:254— allOfHandle has cognitive complexity 22 (threshold 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.
GroupKey.parseKey (cognitive 21) config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java:56— GroupKey.parseKey has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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.
GroupKey2.parseKey (cognitive 21) config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java:51— GroupKey2.parseKey has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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.
RemoteRequestAuthFilter.filter (cognitive 21) core/src/main/java/com/alibaba/nacos/core/auth/RemoteRequestAuthFilter.java:68— RemoteRequestAuthFilter.filter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 2, error handling 2, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestHandlerRegistry.onApplicationEvent (cognitive 21) core/src/main/java/com/alibaba/nacos/core/remote/RequestHandlerRegistry.java:76— RequestHandlerRegistry.onApplicationEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, error handling 4, loops 3, 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.
NamingFuzzyWatchContextService.syncServiceContext (cognitive 21) naming/src/main/java/com/alibaba/nacos/naming/core/v2/index/NamingFuzzyWatchContextService.java:164— NamingFuzzyWatchContextService.syncServiceContext has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleOptimize (cognitive 21) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:276— handleOptimize has cognitive complexity 21 (threshold 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.
extractPackageVersionFromArgs (cognitive 21) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:396— extractPackageVersionFromArgs has cognitive complexity 21 (threshold 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.
extractPackageVersion (cognitive 21) console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js:479— extractPackageVersion has cognitive complexity 21 (threshold 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.
AgentSpecOperationServiceImpl.listAgentSpecs (cognitive 20) ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java:300— AgentSpecOperationServiceImpl.listAgentSpecs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, ternaries 3, loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigEncryptionFilter.doFilter (cognitive 20) client/src/main/java/com/alibaba/nacos/client/config/filter/impl/ConfigEncryptionFilter.java:46— ConfigEncryptionFilter.doFilter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 8 (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.
NamingFuzzyWatchServiceListHolder.doExecuteNamingFuzzyWatch (cognitive 20) client/src/main/java/com/alibaba/nacos/client/naming/cache/NamingFuzzyWatchServiceListHolder.java:283— NamingFuzzyWatchServiceListHolder.doExecuteNamingFuzzyWatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, error handling 6, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Base64.decode (cognitive 20) common/src/main/java/com/alibaba/nacos/common/codec/Base64.java:318— Base64.decode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigFuzzyWatchContextService.syncGroupKeyContext (cognitive 20) config/src/main/java/com/alibaba/nacos/config/server/service/ConfigFuzzyWatchContextService.java:125— ConfigFuzzyWatchContextService.syncGroupKeyContext has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolveRefs (cognitive 20) console-ui/src/pages/AI/services/OpenApiService.js:6— resolveRefs has cognitive complexity 20 (threshold 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.
renderCollapsibleSection (cognitive 20) console-ui/src/pages/AI/SkillManagement/SkillOptimizeDialog.js:977— renderCollapsibleSection has cognitive complexity 20 (threshold 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.
onload (cognitive 20) console-ui/src/pages/AI/SkillManagement/SkillManagement.js:552— onload has cognitive complexity 20 (threshold 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.
renderGeneratedSkill (cognitive 20) console-ui/src/pages/AI/NewSkill/NewSkill.js:1837— renderGeneratedSkill has cognitive complexity 20 (threshold 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.
constructor (cognitive 20) console-ui/src/pages/AI/McpManagement/McpManagement.js:71— constructor has cognitive complexity 20 (threshold 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.
ShowTools (cognitive 20) console-ui/src/pages/AI/McpDetail/ShowTools.js:19— ShowTools has cognitive complexity 20 (threshold 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.
AiResourceManager.resolveLatestOnlineVersion (cognitive 19) ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:1117— AiResourceManager.resolveLatestOnlineVersion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 4, 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.
SkillOperationServiceImpl.createDraft (cognitive 19) ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:1045— SkillOperationServiceImpl.createDraft has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, ternaries 8 (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.
CredentialWatcher.loadPropertyPath (cognitive 19) client-basic/src/main/java/com/alibaba/nacos/client/auth/ram/identify/CredentialWatcher.java:205— CredentialWatcher.loadPropertyPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, ternaries 4, 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.
NacosLock.tryLock (cognitive 19) client/src/main/java/com/alibaba/nacos/client/lock/NacosLock.java:240— NacosLock.tryLock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, error handling 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskCache.parseServiceInfoFromCache (cognitive 19) client/src/main/java/com/alibaba/nacos/client/naming/cache/DiskCache.java:124— DiskCache.parseServiceInfoFromCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, error handling 5, boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RpcClient.asyncRequest (cognitive 19) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:738— RpcClient.asyncRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, error handling 6, boolean chains 2, ternaries 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RpcClient.requestFuture (cognitive 19) common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java:790— RpcClient.requestFuture has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, error handling 6, boolean chains 2, ternaries 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigInfoBase.equals (cognitive 19) config/src/main/java/com/alibaba/nacos/config/server/model/ConfigInfoBase.java:175— ConfigInfoBase.equals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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.
LockRequestHandler.handle (cognitive 19) lock/src/main/java/com/alibaba/nacos/lock/remote/rpc/handler/LockRequestHandler.java:56— LockRequestHandler.handle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleExport (cognitive 19) console-ui/src/pages/AI/SkillDetail/SkillDetail.js:1360— handleExport has cognitive complexity 19 (threshold 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.
success (cognitive 19) console-ui/src/pages/AI/NewSkill/NewSkill.js:221— success has cognitive complexity 19 (threshold 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.
renderCollapsibleSection (cognitive 19) console-ui/src/pages/AI/NewSkill/NewSkill.js:1651— renderCollapsibleSection has cognitive complexity 19 (threshold 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.
AdvancedConfig (cognitive 19) console-ui/src/pages/AI/McpDetail/CreateTools/AdvancedConfig.js:12— AdvancedConfig has cognitive complexity 19 (threshold 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.
PromptOperationServiceImpl.createDraft (cognitive 18) ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:118— PromptOperationServiceImpl.createDraft has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10, if/else 8 (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.
ServerHttpAgent.httpDelete (cognitive 18) client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:183— ServerHttpAgent.httpDelete has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, error handling 6, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.