Public report — cat, published 6 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 06-08-2026 @ 13:59 UTC Public
Code Health Audit

Dianping/cat

45% Weak
CriticalWeakAdequateStrongExemplary
upper third — near Adequate

Small · 6,477 LoC · 4 projects · rebuild ~0.2 person-years · weakest lens: Code Health (38%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

44/47dimensions tool-verifieddeterministic · confidence 1.0 · 3 LLM-assisted, advisory
388findings with an exact file:lineof 413 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
47/108dimensions across the health lenses6477 LoC · 4 projects — 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.

dianping/cat carries serious gaps (45%). 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 Architecture (97%) — the structure is clean and changes stay contained.

The area that most needs attention is Code Health (38%) — changes there are slower and more error-prone. Readiness (41%) is the next concern — 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.

Leadership focus, highest impact first: TypeScript for the frontend (Type Safety); Break down the listed branch-heavy functions (Cyclomatic Complexity); each oversized file along the responsibilities already in it (Large Files).

For scale: Small (~6,477 production lines); rebuilding it from scratch would take roughly ~0.2 person-years (~1 engineer). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (97%); 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 headline Width 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.
Code Health 38% · 47% weightReadiness 41% · 26% weightMaturity 45% · 14% weightSecurity 68% · 8% weightArchitecture 97% · 4% weight

Raise Code Health 38 → 70 (the Healthy floor) ⇒ headline 45 → ~51.

Code composition — where the lines go
Business logic 12%Plumbing 16%Tests 71%
Rebuild cost & value ~ Modeled — €9,600–€49,000
Cost to rebuild€9,600–€49,000 (0.1–0.3 person-years (161–514 h), ~1 engineer)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 45% quality) — the last 20% of quality is most of the work
Size & shapeSmall · 36% boilerplate · 21% straight-line · 43% branching logic
Dead frontend code~4978 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 ~0.2 person-years of build effort (about ~€29,000 to rebuild). Its weakest lens is Code Health at 38% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.2) — library/CLI, CQRS, high decision density × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source. 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
Resolve the 3 Largest orphaned file finding(s) in Knowledge Freshness — start with worker-xquery.js, ace.js, jquery-ui.js.
+4.5 pts · Low effort · Knowledge Freshness
2
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with cat.pem.
+4.0 pts · Low effort · Secret Scanning
3
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
+8.0 pts · Medium effort · Type Safety

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Small asset (~0.2 person-years to rebuild), and its weakest lens is Code Health at 38%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Small, ~0.2 person-years rebuild (6,477 LoC) · weakest lens: Code Health 38%
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch Cat Cat Cat.Net Net CatCore CatCore

Architecture — module dependency matrix

253 modules, 718 dependencies — 16 dependency cycles, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

(global)…ng.cat.config.content…ping.cat.message.tree…ping.cat.report.graphcom.dianping.cat.task…t.component.lifecycle…ing.cat.config.server…m.dianping.cat.helper….dianping.cat.message…ianping.cat.component…m.dianping.cat.report…port.alert.spi.config….dianping.cat.service…em.page.router.config…t.alarm.spi.decorator…at.alarm.spi.receiver….cat.message.internal…ianping.cat.alarm.spi…nping.cat.message.spi…dianping.cat.analysis…ing.cat.configuration…t.page.business.graphcom.dianping.cat…ing.cat.consumer.dump…ng.cat.consumer.event….cat.consumer.storage….consumer.transaction…ng.cat.report.service…m.dianping.cat.statuscom.dianping.cat.mvc…report.alert.business…eport.alert.heartbeat…page.dependency.graph…nping.cat.report.task…eport.page.dependency…t.report.page.problem…t.report.page.storage…t.report.task.current…eport.alert.exception…page.config.processor(global)1…ng.cat.config.content2…ping.cat.message.tree3…ping.cat.report.graph4com.dianping.cat.task5…t.component.lifecycle6…ing.cat.config.server7…m.dianping.cat.helper8….dianping.cat.message9…ianping.cat.component10…m.dianping.cat.report11…port.alert.spi.config12….dianping.cat.service13…em.page.router.config14…t.alarm.spi.decorator15…at.alarm.spi.receiver16….cat.message.internal17…ianping.cat.alarm.spi18…nping.cat.message.spi19…dianping.cat.analysis20…ing.cat.configuration21…t.page.business.graph22com.dianping.cat23…ing.cat.consumer.dump24…ng.cat.consumer.event25….cat.consumer.storage26….consumer.transaction27…ng.cat.report.service28…m.dianping.cat.status29com.dianping.cat.mvc30…report.alert.business31…eport.alert.heartbeat32…page.dependency.graph33…nping.cat.report.task34…eport.page.dependency35…t.report.page.problem36…t.report.page.storage37…t.report.task.current38…eport.alert.exception39…page.config.processor4012123313211112111121115719211121211121101313111141113211311212111112111312118411112131131112121211121112111312232211113121311111131321111111+213 more modules (most-connected shown)

At a glance — Code Health · 38% · Weak · gated by R1, R2, R3

At a glance — Architecture · 97% · Exemplary

At a glance — Maturity · 45% · Weak · gated by D34, M2

At a glance — Readiness · 41% · Weak · gated by R8, P3

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

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2021 — Injection50High / Critical
A05:2021 — Security Misconfiguration22High / Critical
A06:2021 — Vulnerable & Outdated Components9High / Critical
A02:2021 — Cryptographic Failures6High / Critical

Roadmap

First, adopt TypeScript for the frontend by adding a typecheck step and converting the highest-traffic modules to improve type safety. Next, reduce cyclomatic complexity by breaking down branch-heavy functions to ensure they remain simple and maintainable. Then, split the largest files into smaller, focused modules to improve code organization and readability. Finally, implement static application security testing in the CI pipeline to catch security regressions early.

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

Do thisHelpsEffortDimension
Resolve the 3 Largest orphaned file finding(s) in Knowledge Freshness — start with worker-xquery.js, ace.js, jquery-ui.js.+4.5 ptsLowKnowledge Freshness
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with cat.pem.+4.0 ptsLowSecret Scanning
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+8.0 ptsMediumType Safety
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.+8.0 ptsMediumCyclomatic Complexity
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+8.0 ptsMediumLarge Files
Thread a CancellationToken through async methods so work stops promptly on cancellation.+7.9 ptsMediumCancellation propagation
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+6.7 ptsMediumSecurity & performance tooling
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+6.7 ptsMediumDependency Hygiene

File quality

Per-file score 0–10 — a quality signature. Of 190 files carrying findings, judged against the Production bar: 1% slop · 50% mixed · 49% near-clean.

FileScoreBandWorst signal
helm/templates/statefulset-cat-server.yaml1.9SlopIaC & Container Security: High IaC: KSV-0014
helm/templates/statefulset-cat-mysql.yaml2.2SlopIaC & Container Security: High IaC: KSV-0014
lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java4.3MixedStatic Analysis (SAST): High: saxparserfactory-disallow-doctype-decl-missing
cat-home/src/main/resources/chrome/cat.pem4.4MixedSecret Scanning: Leaked secret: private-key
.github/workflows/build.yml5.1MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
lib/c/src/ccat/aggregator_metric.c5.1MixedStatic Analysis (SAST): High: insecure-use-string-copy-fn
lib/c/src/lib/cat_anet.c5.1MixedStatic Analysis (SAST): High: insecure-use-string-copy-fn
lib/c/src/lib/cat_clog.c5.1MixedStatic Analysis (SAST): High: insecure-use-strcat-fn
lib/erlang/c_src/src/ccat/message_aggregator_metric.c5.1MixedStatic Analysis (SAST): High: insecure-use-string-copy-fn
lib/erlang/c_src/src/lib/cat_anet.c5.1MixedStatic Analysis (SAST): High: insecure-use-string-copy-fn
lib/erlang/c_src/src/lib/cat_clog.c5.1MixedStatic Analysis (SAST): High: insecure-use-strcat-fn
docker/Dockerfile5.1MixedIaC & Container Security: High IaC: DS-0002
.github/workflows/maven-build.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/maven-deploy.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
lib/c/src/lib/cat_json.c5.8MixedStatic Analysis (SAST): High: insecure-use-string-copy-fn
lib/erlang/c_src/src/lib/cat_json.c5.8MixedStatic Analysis (SAST): High: insecure-use-string-copy-fn
cat-home/src/main/java/com/dianping/cat/report/ReportContext.java6.4MixedStatic Analysis (SAST): Medium: httpservlet-path-traversal
cat-home/src/main/java/com/dianping/cat/report/view/DomainFilter.java6.7MixedStatic Analysis (SAST): Medium: http-response-splitting
lib/csharp/src/CatClient/Message/Spi/Codec/PlainTextMessageCodec.cs6.7MixedExplicit Debt: CommentedOutCode
cat-home/src/main/webapp/assets/js/uncompressed/jquery.sparkline.js6.9MixedStatic Analysis (SAST): Medium: unsanitized-method

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. 44 of 47 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.7 — 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 — 47 dimensions across the health lenses
D4D5D13D14D15D17D19D21D24D26D28D29D30D31D33D34D35D36D37D40D41AX10AX3AX5AX6GD1IC1M1M2M3M4P1P3P4P6R1R10R2R3R6R7R8R9S1X1X2X3

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019fd75f-6bc4-7672-96bd-67d6e9a320b3.

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

Run transparency — what happened this run

A clean run — every tool resolved and ran, and every applicable dimension was measured at full confidence. No scanner was unavailable, no analysis timed out or crashed, and nothing fell back to a degraded estimate.

When something does degrade — a missing scanner, a shallow clone, an LLM hiccup — it is named here explicitly and its exact cause recorded in diagnostics.md, never absorbed silently into the score.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • 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.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality 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.
  • D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and the advisory database — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen.
  • 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.
  • 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.
  • D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
  • D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: 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".
  • 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 (4): D19, D21, D24, 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.

Dimensions

D4 · Code Duplication8.8 / 10Strong✓ Tool-verified

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.

Maturity: DocumentedVerifiedPrevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Verified

294 duplicated block group(s) detected.

Duplicated block (9 lines × 2) · ×38cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/ProjectDecorator.java:45
Duplicated block (10 lines × 2) · ×28cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/RuleFTLDecorator.java:38
Duplicated block (11 lines × 2) · ×26lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:123
Duplicated block (7 lines × 2) · ×24cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/MailSender.java:70
Duplicated block (12 lines × 2) · ×20cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:206

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

What to do

  1. Resolve the 38 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with NativeMessageCodec.java (5), Handler.java (3), Files.java (2). — One of this dimension's main actionable groups (38 warning-level).
  2. Resolve the 28 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with DefaultSaxParser.java (2), PlainTextMessageCodec.java (2), BusinessAlert.java (2). — One of this dimension's main actionable groups (28 warning-level).
  3. Resolve the 26 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with PlainTextMessageCodec.java (5), NativeMessageCodec.java (2), EventAnalyzer.java (2). — One of this dimension's main actionable groups (26 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

4 projects, 0 dependency cycle(s), 0 unstable depended-on project(s).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

Leaked secret: private-keycat-home/src/main/resources/chrome/cat.pem:1

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with cat.pem. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 3 packages use a banned license.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt9.5 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Prevented

11 deducted debt markers + 0 dead symbols across 6392 LoC (0.2/KLoC) → score 9.5.

CommentedOutCode · ×6lib/csharp/src/CatClient/Message/Spi/Codec/PlainTextMessageCodec.cs:545
TodoComment · ×5lib/csharp/src/CatClient/Configuration/LocalClientConfig.cs:28

✓ On the Gold path — maintain.

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

D19 · Documentation Quality / 10Strong◐ Sampled · advisory

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.

Maturity: DocumentedVerifiedPrevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

CAT文档质量很高,包含32个README文件(其中4个是架构/设计文档),覆盖了从产品简介、实时处理优势、监控模型到多语言客户端API的完整结构。XML-doc覆盖率低(9%)但文档内容详实:每个模块都有独立的README,并且在读取范围内所有标题都出现,说明内容完整。文档质量主要体现在清晰度和全面性上——从介绍到具体实现细节均有覆盖,是优秀的实时监控平台文档范本。 The Cat client documentation is strong for its target platforms (Linux glibc/musl, OSX, Alpine, CentOS 6/7, Ubuntu LTS) and builds (C/C++ compilation with CMake, Googletest test framework, Docker integration), but it falls short of the ideal quality due to a thin API reference/doc site and sparse cross-platform guidance. The READMEs are well written for each platform, covering OS testing, build commands, installation, initialization, and one or two examples per file; the architecture docs (e.g., Spring MVC URL rewriting, AOP annotation monitoring) are present but not fully fleshed out in the visible text. Coverage is low: only API documentation exists among the 36 documents listed.

Low XML-doc coverage: Cat · ×2lib/csharp/src/CatClient/Cat.csproj
The 'Documentation' section links only to the API doc (./docs/api.md), but no other Cat reference or usage guide exists in the visible text.lib/cpp/README.md

What to do

  1. Resolve the 2 Low XML-doc coverage finding(s) in Documentation Quality — start with Cat.csproj, CatCore.csproj. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 The 'Documentation' section links only to the API doc (./docs/api.md),… 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.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 200 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D24 · Comment Value / 10Exemplary◐ Sampled · advisory

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

42 valuable / 0 redundant across 200 sampled comments.

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md.

D26 · Project Cohesion10.0 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 4 projects flagged as possibly oversized/incoherent.

✓ On the Gold path — maintain.

Detailed fixes: d26_recommendation.md.

D28 · Secrets (history)5.0 / 10Adequate✓ Tool-verified

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.

Maturity: DocumentedVerifiedPrevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

Secret: private-key · ×4cat-home/src/main/resources/onelogin.saml.properties:50detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

What to do

  1. Resolve the 4 Secret finding(s) in Secrets (history) — start with server.xml (2), onelogin.saml.properties, cat.pem. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

67 finding(s): 0 critical, 38 high, 9 medium, 20 low.

High: github-actions-mutable-action-tag · ×38.github/workflows/build.yml:27detected by semgrep finding
Medium: httpservlet-path-traversal · ×9cat-home/src/main/java/com/dianping/cat/report/ReportContext.java:49detected by semgrep finding
Low: cookie-missing-httponly · ×3cat-home/src/main/java/com/dianping/cat/report/view/DomainFilter.java:91detected by semgrep finding

What to do

  1. Resolve the 38 High finding(s) in Static Analysis (SAST) — start with cat_anet.c (6), cat_clog.c (6), cat_json.c (4). — One of this dimension's main actionable groups (38 issue-level).
  2. Resolve the 9 Medium finding(s) in Static Analysis (SAST) — start with jquery.sparkline.js (2), ReportContext.java, DomainFilter.java. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 3 Low finding(s) in Static Analysis (SAST) — start with DomainFilter.java (3). — One of this dimension's main actionable groups (3 recommendation-level).

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

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

What it measures: Whether any dependencies have known published vulnerabilities (CVEs), direct or transitive.

Method: NuGet CVE scan via dotnet list package --vulnerable including transitive; severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer. Exhaustive, deterministic; degrades when absent.

Maturity: DocumentedVerifiedPrevented · effective 6.1 / 10 · rule-coverage 100% · ceiling Documented

9 vulnerable package(s): 0 critical, 5 high, 4 medium, 0 low.

High CVE: Microsoft.NETCore.App 2.1.0 · ×5detected by dotnet list package --vulnerable
Medium CVE: Microsoft.NETCore.App 2.1.0 · ×4detected by dotnet list package --vulnerable

What to do

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

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

D31 · IaC & Container Security7.8 / 10Strong✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Documented

22 finding(s): 0 critical, 3 high, 9 medium, 10 low.

High IaC: DS-0002 · ×3docker/Dockerfiledetected by trivy finding
Medium IaC: KSV-0001 · ×9helm/templates/statefulset-cat-mysql.yamldetected by trivy finding
Low IaC: KSV-0003 · ×10helm/templates/statefulset-cat-mysql.yamldetected by trivy finding

What to do

  1. Resolve the 3 High IaC finding(s) in IaC & Container Security — start with Dockerfile, statefulset-cat-mysql.yaml, statefulset-cat-server.yaml. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 10 Low IaC finding(s) in IaC & Container Security — start with statefulset-cat-mysql.yaml (5), statefulset-cat-server.yaml (5). — One of this dimension's main actionable groups (10 recommendation-level).
  3. Resolve the 9 Medium IaC finding(s) in IaC & Container Security — start with statefulset-cat-server.yaml (4), statefulset-cat-mysql.yaml (3), dockerfile.js. — One of this dimension's main actionable groups (9 warning-level).

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

D33 · JS/npm Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether JavaScript/npm dependencies have known published vulnerabilities (CVEs) — the npm ecosystem's biggest risk.

Method: JS/npm CVE scan via trivy fs --scanners vuln over JS manifests (package.json/yarn.lock/pnpm-lock/bun.lockb); 0-10 tight normalizer. NotApplicable without JS manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable JS/npm dependencies.

✓ On the Gold path — maintain.

Detailed fixes: d33_recommendation.md.

D34 · Knowledge Freshness0.0 / 10Critical✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

894 of 894 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is cat-home/src/main/webapp/assets/js/editor/worker-xquery.js.

Largest orphaned file · ×3cat-home/src/main/webapp/assets/js/editor/worker-xquery.js
Dormant codebase

What to do

  1. Resolve the 3 Largest orphaned file finding(s) in Knowledge Freshness — start with worker-xquery.js, ace.js, jquery-ui.js. — One of this dimension's main actionable groups (3 recommendation-level).
  2. Resolve the 1 Dormant codebase finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

Unpinned build actions
Workflow token permissions not restricted
No build provenance
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Workflow token permissions not restricted finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

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

No network policy

What to do

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

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

D41 · Kernel & Syscall Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

0/2 syscall-confinement controls present (seccomp, AppArmor/SELinux).

No seccomp profile
No AppArmor/SELinux confinement

What to do

  1. Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.2 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified.

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

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

What to do

  • The domain core is a small share of production code — check that business logic isn't leaking into the application/infrastructure layers (a thin domain is the anemic-domain smell).
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

Method: Roslyn scan: public interface member counts; fat-interface threshold (over 15 members) flagged per type. Deterministic, type-level.

  • `IPerformanceMetricProvider` declares 24 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IPerformanceMetricProvider.cs:14

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×15) — DefaultTransaction.cs:20, ChannelBuffer.cs:163, TcpMessageSender.cs:72, …

What to do

  • Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

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 4 of 4 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no `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.
  • No C4/PlantUML/Mermaid diagram or architecture.md — the high-level shape isn't documented.

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).
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

  • Only 1/4 projects share a common root namespace — the code's module identity is inconsistent.

What to do

  • Adopt a consistent root-namespace convention (a shared prefix, e.g. Acme.*); short project-file/directory names are fine as long as the RootNamespace is uniform.
M4 · Documentation accuracy9.0 / 10Exemplary◐ Sampled · advisory

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.

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

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

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

P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step.

What to do

  • Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

R1 · Type Safety0.0 / 10Critical✓ 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.

  • 0 typed · 551 plain JS — the untyped files are cat-home/src/main/resources/chrome/cat/cat.js, cat-home/src/main/webapp/assets/js/ace/ace.ajax-content.js, cat-home/src/main/webapp/assets/js/ace/ace.auto-container.js, cat-home/src/main/webapp/assets/js/ace/ace.auto-padding.js, cat-home/src/main/webapp/assets/js/ace/ace.autohide-sidebar.js, cat-home/src/main/webapp/assets/js/ace/ace.js (+545 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication9.6 / 10Exemplary✓ Tool-verified

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.

  • cat-home/src/main/webapp/assets/js/editor/mode-coldfusion.js:2150 · cat-home/src/main/webapp/assets/js/editor/mode-curly.js:2150 · cat-home/src/main/webapp/assets/js/editor/mode-django.js:2150 · cat-home/src/main/webapp/assets/js/editor/mode-ejs.js:2150 · +4 more site(s) not listed — the 8 copies are spread across 8 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. — mode-coldfusion.js:2150
  • cat-home/src/main/webapp/assets/js/editor/mode-ejs.js:2474 · cat-home/src/main/webapp/assets/js/editor/mode-haml.js:38 · cat-home/src/main/webapp/assets/js/editor/mode-html_ruby.js:878 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — mode-ejs.js:2474
  • cat-home/src/main/webapp/assets/js/editor/mode-groovy.js:1053 · cat-home/src/main/webapp/assets/js/editor/mode-java.js:1051 · cat-home/src/main/webapp/assets/js/editor/mode-jsp.js:865 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — mode-groovy.js:1053
  • cat-home/src/main/webapp/assets/js/editor/mode-coldfusion.js:59 · cat-home/src/main/webapp/assets/js/editor/mode-curly.js:59 · cat-home/src/main/webapp/assets/js/editor/mode-django.js:59 · cat-home/src/main/webapp/assets/js/editor/mode-ejs.js:203 · +11 more site(s) not listed — the 15 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. — mode-coldfusion.js:59
  • cat-home/src/main/webapp/assets/js/editor/mode-coldfusion.js:2093 · cat-home/src/main/webapp/assets/js/editor/mode-curly.js:2093 · cat-home/src/main/webapp/assets/js/editor/mode-django.js:2093 · cat-home/src/main/webapp/assets/js/editor/mode-ejs.js:2093 · +4 more site(s) not listed — the 8 copies are spread across 8 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. — mode-coldfusion.js:2093
  • cat-home/src/main/webapp/assets/js/editor/mode-coffee.js:12 · cat-home/src/main/webapp/assets/js/editor/mode-jade.js:1530 — 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. — mode-coffee.js:12
  • cat-home/src/main/webapp/assets/js/editor/mode-jade.js:1320 · cat-home/src/main/webapp/assets/js/editor/mode-less.js:31 — 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. — mode-jade.js:1320
  • cat-home/src/main/webapp/assets/js/editor/mode-c_cpp.js:59 · cat-home/src/main/webapp/assets/js/editor/mode-dart.js:59 · cat-home/src/main/webapp/assets/js/editor/mode-glsl.js:59 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — mode-c_cpp.js:59

What to do

  • Extract the duplicated blocks into shared functions/components.
R2 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×8) — worker-xquery.js:8939, worker-xquery.js:7669, worker-xquery.js:33723, …

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files2.1 / 10Critical✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • 108 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: cat-home/src/main/webapp/assets/js/editor/ace.js (16127), cat-home/src/main/webapp/assets/js/uncompressed/jquery-ui.js (13833), cat-home/src/main/webapp/assets/js/editor/worker-html.js (10575), cat-home/src/main/webapp/assets/js/editor/worker-javascript.js (10159), cat-home/src/main/webapp/assets/js/editor/worker-css.js (7493), cat-home/src/main/webapp/assets/js/editor/worker-coffee.js (6789) (+102 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R6 · Tooling6.7 / 10Adequate✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • test ✓ · lint ✓ · typecheck ✗

What to do

  • Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
R7 · Dead Code9.7 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 509 application, 0 tooling and 1 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 (509 application, 0 tooling, 1 test roots considered) (×7) — intro.js, startopo.js, netgraph.js, …

What to do

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

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — ext-beautify.js:3, dropzone.js:270, dropzone.js:232
  • Declared in lib/node.js/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.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

S1 · Cryptographic Hygiene8.0 / 10Strong✓ Tool-verified

Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. Deterministic.

  • MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. — MD5Util.cs:13

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage.

  • Only 0/4 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
  • No CancellationToken parameter — this work can't be stopped early once started. (×4) — DBUtil.cs:57, DBUtil.cs:130, TransactionUtil.cs:11, …

What to do

  • Thread a CancellationToken through async methods so work stops promptly on cancellation.
X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health38%Weak — gated by R1, R2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture97%ExemplaryStrongest area.
Maturity45%Weak — gated by D34, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness41%Weak — gated by R8, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security68%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 61 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC7 A11y enforcement — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • 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 — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D1 Cyclomatic Complexity — Most of this repository's production source (.go, .js, .py) had no cyclomatic complexity computed for it, so cyclomatic complexity was not measured — whatever else this pass did read is not this repository's complexity. Not scored: no method bodies were exposed for those file kinds by any language model this pass could load. This is a gap in the analysis run, not a finding about this repository.
  • D10 Test Quality — ~16176 lines of test source are present (.java, .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 measured — no test run produced results
  • D12 Dependency Hygiene — Dependency hygiene not measured — no packages were read
  • D16 Bus Factor — dormant codebase — no living knowledge left to concentrate
  • D18 Solution Shape — D18 scores the shape of a C#/VB .NET solution, but this repository's production source is mostly .erl, .go, .hrl, .java, .py, .scala, which the C#/VB workspace does not load — the projects that loaded are an immaterial minority, so solution shape was not assessed for this repository. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D2 Cognitive Complexity — Most of this repository's production source (.go, .js, .py) had no cognitive complexity computed for it, so cognitive complexity was not measured — whatever else this pass did read is not this repository's complexity. Not scored: no method bodies were exposed for those file kinds by any language model this pass could load. This is a gap in the analysis run, not a finding about this repository.
  • 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 — At only 118k LoC the codebase is small despite four projects and no bounded contexts declared, so boundaries are not yet needed.
  • D25 ADR Conformance — no ADRs to check
  • 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.
  • D3 God Classes — Most of this repository's production source (.go, .js, .py) was not read by god-class detection, so class size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's class size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D38 OSV Dependency Vulnerabilities — Scanner failed to run — not a clean result
  • D39 IL Efficiency — The target did not build, so no IL was available to measure.
  • D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is mostly .erl, .go, .hrl, .java, .py, .scala, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — analyzer environment
  • D9 Test Distribution — Tests outside the analyzed solution
  • DM1 Domain Modelling — applicable but not scored (2 of 2 signals for this style — below the bar we score at): 2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 5 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this check looks for (27 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 none of the 3 signals this check looks for
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — no EF Core usage detected
  • 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 is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF2 Allocation hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF3 Async & latency hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R4 Test Coverage — 1 test file(s) reach none of 550 production file(s) via imports — exercised outside the JS import graph (integration/bundled), not import-reachable
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D33 (JS/npm Dependency Vulnerabilities)
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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 — no NRT-eligible projects
  • X6 Hand-rolled structured-format parsing — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.
  • X7 Silent fallback defaults — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.

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.

Issue — 51 finding(s)
D29 · Static Analysis (SAST) · High · ×38
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:27 — 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@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:29 — 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: docker/setup-qemu-action@<40-character SHA>`. This step references `docker/setup-qemu-action@v1`; resolve the SHA it points at today with `gh api repos/docker/setup-qemu-action/commits/v1 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:31 — 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: docker/setup-buildx-action@<40-character SHA>`. This step references `docker/setup-buildx-action@v1`; resolve the SHA it points at today with `gh api repos/docker/setup-buildx-action/commits/v1 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/maven-build.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/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/maven-build.yml:28 — 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@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/maven-deploy.yml:19 — 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@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/maven-deploy.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/setup-java@<40-character SHA>`. This step references `actions/setup-java@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v3 --jq .sha`.
  • High: saxparserfactory-disallow-doctype-decl-missing cat-client/src/main/java/com/dianping/cat/configuration/model/transform/DefaultXmlParser.java:52 — DOCTYPE declarations are enabled for this SAXParserFactory. This is vulnerable to XML external entity attacks. Disable this by setting the feature `http://apache.org/xml/features/disallow-doctype-decl` to true. Alternatively, allow DOCTYPE declarations and only prohibit external entities declarations. This can be done by setting the features `http://xml.org/sax/features/external-general-entities` and `http://xml.org/sax/features/external-parameter-entities` to false. NOTE - The previous links are not meant to be clicked. They are the literal config key values that are supposed to be used to disable these features. For more information, see https://semgrep.dev/docs/cheat-sheets/java-xxe/#3a-documentbuilderfactory. 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.
  • High: saxparserfactory-disallow-doctype-decl-missing cat-client/src/main/java/com/dianping/cat/status/model/transform/DefaultXmlParser.java:66 — DOCTYPE declarations are enabled for this SAXParserFactory. This is vulnerable to XML external entity attacks. Disable this by setting the feature `http://apache.org/xml/features/disallow-doctype-decl` to true. Alternatively, allow DOCTYPE declarations and only prohibit external entities declarations. This can be done by setting the features `http://xml.org/sax/features/external-general-entities` and `http://xml.org/sax/features/external-parameter-entities` to false. NOTE - The previous links are not meant to be clicked. They are the literal config key values that are supposed to be used to disable these features. For more information, see https://semgrep.dev/docs/cheat-sheets/java-xxe/#3a-documentbuilderfactory. 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.
  • High: insecure-use-string-copy-fn lib/c/src/ccat/aggregator_metric.c:101 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/c/src/ccat/aggregator_metric.c:102 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/c/src/ccat/aggregator_metric.c:103 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/ccat/server_connection_manager.c:73 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/lib/cat_anet.c:268 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/lib/cat_anet.c:461 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/lib/cat_anet.c:699 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/c/src/lib/cat_clog.c:85 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/c/src/lib/cat_clog.c:91 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/c/src/lib/cat_clog.c:93 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/lib/cat_json.c:320 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/lib/cat_json.c:833 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/c/src/lib/cat_network_util.c:138 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-string-copy-fn lib/erlang/c_src/src/ccat/message_aggregator_metric.c:101 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/erlang/c_src/src/ccat/message_aggregator_metric.c:102 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • High: insecure-use-strcat-fn lib/erlang/c_src/src/ccat/message_aggregator_metric.c:103 — Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead to buffer overflow vulns. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. 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.
  • + 13 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×5
  • High CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a High advisory. https://github.com/advisories/[GHSA redacted]
  • High CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a High advisory. https://github.com/advisories/[GHSA redacted]
  • High CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a High advisory. https://github.com/advisories/[GHSA redacted]
  • High CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a High advisory. https://github.com/advisories/[GHSA redacted]
  • High CVE: Newtonsoft.Json 11.0.2 — Newtonsoft.Json 11.0.2 (transitive) has a High advisory. https://github.com/advisories/[GHSA redacted]
D28 · Secrets (history) · Secret · ×4
  • Secret: private-key cat-home/src/main/resources/onelogin.saml.properties:50 — matched rule 'private-key'
  • Secret: private-key cat-home/src/main/resources/chrome/cat.pem:1 — matched rule 'private-key'
  • Secret: generic-api-key script/server.xml:20 — matched rule 'generic-api-key'
  • Secret: generic-api-key cat-maven-plugin/src/main/resources/com/dianping/cat/plugin/server.xml:20 — matched rule 'generic-api-key'
D31 · IaC & Container Security · High IaC · ×3
  • High IaC: DS-0002 docker/Dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN adduser -S -D app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
  • High IaC: KSV-0014 helm/templates/statefulset-cat-mysql.yaml — Root file system is not read-only
  • High IaC: KSV-0014 helm/templates/statefulset-cat-server.yaml — Root file system is not read-only
D13 · Secret Scanning · Leaked secret · ×1
  • Leaked secret: private-key cat-home/src/main/resources/chrome/cat.pem:1 — private-key detected. Treat the value as compromised: it is readable by everyone who has ever had the repository, and deleting the line does not un-publish it. In order — (1) REVOKE it at whatever issued it and issue a replacement, which is the only step that actually closes the exposure; (2) load the replacement at run time from your platform's secret store or the process environment instead of from the tree, so no future value is committable; (3) remove the file or line and add its path to the repository's ignore rules, so it cannot come back; (4) if the value was ever live, purge it from the history as well, since a clone taken before the deletion still carries it. If this is instead a FIXTURE — key material generated for tests and valid nowhere — then the exposure is nil and the fix is to make that legible: generate it in test setup, or keep it under a test-data path, so a reader (and this scan) can tell it from the real thing.
Warning — 335 finding(s)
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×38
  • Duplicated block (9 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/ProjectDecorator.java:45 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/ProjectDecorator.java:45-55 | cat-home/src/main/java/com/dianping/cat/report/page/business/graph/BusinessGraphCreator.java:153-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/ProjectDecorator.java:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:119 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:119-127 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:213-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:230 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:230-238 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxParser.java:169-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 `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:101 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:101-109 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultXmlBuilder.java:103-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.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 (9 lines × 2) lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:185 — lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:185-193 | cat-core/src/main/java/com/dianping/cat/message/tree/MessageId.java:190-198 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:185` it does not close everything it opens, so those exact lines 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:173 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:173-181 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:171-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:173` it begins part-way through the construct above it, so those 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:238 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:238-246 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:236-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 `cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:265 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:265-273 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:263-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:322 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:322-330 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:329-337 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:355 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:355-363 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:362-370 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:355` it begins part-way through the construct above it, so those 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) lib/java/src/main/java/com/dianping/cat/status/datasource/c3p0/C3P0InfoCollector.java:78 — lib/java/src/main/java/com/dianping/cat/status/datasource/c3p0/C3P0InfoCollector.java:78-86 | lib/java/src/main/java/com/dianping/cat/status/datasource/druid/DruidInfoCollector.java:152-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `lib/java/src/main/java/com/dianping/cat/status/datasource/c3p0/C3P0InfoCollector.java:78` it does not close everything it opens, so those exact lines 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) cat-client/src/main/java/com/dianping/cat/support/servlet/CatFilter.java:169 — cat-client/src/main/java/com/dianping/cat/support/servlet/CatFilter.java:169-177 | lib/java/src/main/java/com/dianping/cat/servlet/CatFilter.java:212-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Files.java:62 — cat-client/src/main/java/com/dianping/cat/support/Files.java:62-70 | lib/java/src/main/java/com/dianping/cat/util/Files.java:79-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/support/Files.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.
  • Duplicated block (9 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Files.java:102 — cat-client/src/main/java/com/dianping/cat/support/Files.java:102-110 | lib/java/src/main/java/com/dianping/cat/util/Files.java:119-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/support/Files.java:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-client/src/main/java/com/dianping/cat/support/Splitters.java:114 — cat-client/src/main/java/com/dianping/cat/support/Splitters.java:114-122 | lib/java/src/main/java/com/dianping/cat/util/Splitters.java:52-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/support/Splitters.java:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java:138 — cat-consumer/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java:138-146 | cat-consumer/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java:165-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:226 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:226-234 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:352-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.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 (9 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:277 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:277-285 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:314-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:193 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:193-201 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:228-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.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 (9 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:188 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:188-196 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionAlert.java:195-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 `cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:384 — cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:384-392 | cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:401-409 — both copies are in the same file, so extract the block into 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) cat-home/src/main/java/com/dianping/cat/report/page/business/graph/BusinessGraphCreator.java:382 — cat-home/src/main/java/com/dianping/cat/report/page/business/graph/BusinessGraphCreator.java:382-390 | cat-home/src/main/java/com/dianping/cat/report/page/business/graph/BusinessGraphCreator.java:418-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/business/graph/BusinessGraphCreator.java:382` it begins part-way through the construct above it, so those 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) cat-home/src/main/java/com/dianping/cat/report/page/business/service/BusinessReportService.java:66 — cat-home/src/main/java/com/dianping/cat/report/page/business/service/BusinessReportService.java:66-75 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/service/JarReportService.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 `cat-home/src/main/java/com/dianping/cat/report/page/business/service/BusinessReportService.java:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/cross/display/HostInfo.java:155 — cat-home/src/main/java/com/dianping/cat/report/page/cross/display/HostInfo.java:155-163 | cat-home/src/main/java/com/dianping/cat/report/page/cross/display/MethodInfo.java:176-184 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/cross/display/HostInfo.java:155` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/cross/display/NameDetailInfo.java:121 — cat-home/src/main/java/com/dianping/cat/report/page/cross/display/NameDetailInfo.java:121-129 | cat-home/src/main/java/com/dianping/cat/report/page/cross/display/TypeDetailInfo.java:132-140 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/cross/display/NameDetailInfo.java:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×28
  • Duplicated block (10 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/RuleFTLDecorator.java:38 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/RuleFTLDecorator.java:38-47 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/decorator/ServerRuleFTLDecorator.java:38-47 — 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 (10 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:325 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:325-334 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:378-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:325` it does not close everything it opens, so those exact lines 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) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:151 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:151-160 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxParser.java:129-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.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.
  • Duplicated block (10 lines × 2) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:200 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:200-209 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxParser.java:145-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:434 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:434-443 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:442-451 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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. 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:122 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:122-131 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:117-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.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 × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:140 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:140-149 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:135-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:140` it does not close everything it opens, so those exact lines 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) cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:279 — cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:279-289 | cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:305-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.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 (10 lines × 2) cat-core/src/main/java/com/dianping/cat/message/storage/MessageBlockReader.java:56 — cat-core/src/main/java/com/dianping/cat/message/storage/MessageBlockReader.java:56-65 | cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/MessageBlockReader.java:61-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) cat-core/src/main/java/com/dianping/cat/message/MessageTreeFormat.java:107 — cat-core/src/main/java/com/dianping/cat/message/MessageTreeFormat.java:107-116 | lib/java/src/main/java/com/dianping/cat/util/UrlParser.java:29-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/MessageTreeFormat.java:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:39 — lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:39-48 | lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:135-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:39` it does not close everything it opens, so those exact lines 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) lib/java/src/main/java/com/dianping/cat/status/datasource/DatabaseParserHelper.java:57 — lib/java/src/main/java/com/dianping/cat/status/datasource/DatabaseParserHelper.java:57-66 | cat-consumer/src/main/java/com/dianping/cat/consumer/DatabaseParser.java:55-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) cat-client/src/main/java/com/dianping/cat/support/log4j/CatAppender.java:46 — cat-client/src/main/java/com/dianping/cat/support/log4j/CatAppender.java:46-55 | lib/java/src/main/java/com/dianping/cat/log4j/CatAppender.java:45-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:202 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:202-211 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:330-339 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:202` it does not close everything it opens, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/storage/builder/StorageRPCBuilder.java:41 — cat-consumer/src/main/java/com/dianping/cat/consumer/storage/builder/StorageRPCBuilder.java:41-50 | cat-consumer/src/main/java/com/dianping/cat/consumer/storage/builder/StorageSQLBuilder.java:47-56 — 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/storage/builder/StorageRPCBuilder.java:41` it does not close everything it opens, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:146 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:146-155 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:256-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 `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.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 (10 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.java:160 — cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.java:160-169 | cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.java:173-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 `cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.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 (10 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.java:304 — cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.java:304-313 | cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:369-378 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessAlert.java:304` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:133 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:133-142 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionAlert.java:140-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:133` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventDecorator.java:57 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventDecorator.java:57-66 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionDecorator.java:57-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:222 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:222-231 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:222-231 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:222` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/AllNameMerger.java:85 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/AllNameMerger.java:85-94 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/AllNameMerger.java:94-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/AllNameMerger.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.
  • Duplicated block (10 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:246 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:246-255 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/TransactionTrendGraphBuilder.java:272-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:246` it begins part-way through the construct above it, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:199 — cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:199-208 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:213-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java:229 — cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java:229-238 | cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java:291-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×26
  • Duplicated block (11 lines × 2) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:123 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:123-133 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultXmlBuilder.java:125-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:195 — lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:195-205 | cat-core/src/main/java/com/dianping/cat/message/tree/MessageId.java:200-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:195` it begins part-way through the construct above it, so those exact lines 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:61 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:61-71 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:53-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.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. 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:134 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:134-144 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:128-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:69 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:69-79 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:50-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:292 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:292-302 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:287-297 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:367 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:367-377 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:362-372 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:367` it begins part-way through the construct above it, so those 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:395 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:395-405 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:386-396 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:395` it begins part-way through the construct above it, so those 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:627 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:627-637 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:605-615 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:627` it begins part-way through the construct above it, so those 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) cat-consumer/src/main/java/com/dianping/cat/consumer/config/AllReportConfigManager.java:87 — cat-consumer/src/main/java/com/dianping/cat/consumer/config/AllReportConfigManager.java:87-97 | cat-home/src/main/java/com/dianping/cat/system/page/router/config/RouterConfigManager.java:124-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/config/AllReportConfigManager.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:113 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:113-123 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:235-245 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:129 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:129-139 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:251-261 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-home/src/main/java/com/dianping/cat/report/alert/exception/AlertExceptionBuilder.java:95 — cat-home/src/main/java/com/dianping/cat/report/alert/exception/AlertExceptionBuilder.java:95-105 | cat-home/src/main/java/com/dianping/cat/report/alert/exception/AlertExceptionBuilder.java:115-125 — both copies are in the same file, so extract the block into 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) cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:128 — cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:128-138 | cat-home/src/main/java/com/dianping/cat/report/page/heartbeat/HistoryGraphs.java:94-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. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/cross/display/TypeDetailInfo.java:134 — cat-home/src/main/java/com/dianping/cat/report/page/cross/display/TypeDetailInfo.java:134-144 | cat-home/src/main/java/com/dianping/cat/report/page/cross/display/TypeDetailInfo.java:149-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/cross/display/TypeDetailInfo.java:134` it begins part-way through the construct above it, so those 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:102 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:102-112 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/LineGraphBuilder.java:117-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:325 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:325-335 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:325-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 `cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:325` it begins part-way through the construct above it, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:343 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:343-353 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:343-353 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-home/src/main/java/com/dianping/cat/report/page/event/service/EventReportService.java:68 — cat-home/src/main/java/com/dianping/cat/report/page/event/service/EventReportService.java:68-78 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/service/TransactionReportService.java:69-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/event/service/EventReportService.java:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportDailyGraphCreator.java:84 — cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportDailyGraphCreator.java:84-94 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportDailyGraphCreator.java:90-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportDailyGraphCreator.java:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportDailyGraphCreator.java:111 — cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportDailyGraphCreator.java:111-121 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportDailyGraphCreator.java:117-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportDailyGraphCreator.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 (11 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/state/StateDisplay.java:143 — cat-home/src/main/java/com/dianping/cat/report/page/state/StateDisplay.java:143-153 | cat-home/src/main/java/com/dianping/cat/report/page/state/StateHistoryGraphVisitor.java:79-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. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/state/StateDisplay.java:143` it begins part-way through the construct above it, so those 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) cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:288 — cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:288-299 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:302-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucket.java:227 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucket.java:227-237 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsIndex.java:194-204 — 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 (11 lines × 2) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsFileBuilder.java:37 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsFileBuilder.java:37-47 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalFileBuilder.java:37-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsFileBuilder.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. 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.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×24
  • Duplicated block (7 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/MailSender.java:70 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/MailSender.java:70-77 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/SmsSender.java:66-72 — 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 `cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/MailSender.java:70` it begins part-way through the construct above it, so those 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) cat-client/src/main/java/com/dianping/cat/component/DefaultComponentContext.java:87 — cat-client/src/main/java/com/dianping/cat/component/DefaultComponentContext.java:87-93 | cat-client/src/main/java/com/dianping/cat/component/DefaultComponentContext.java:100-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/component/DefaultComponentContext.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/java/src/main/java/com/dianping/cat/message/io/ChannelManager.java:62 — lib/java/src/main/java/com/dianping/cat/message/io/ChannelManager.java:62-68 | lib/java/src/main/java/com/dianping/cat/message/io/TcpSocketSender.java:74-80 — 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:308 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:308-314 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:303-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-consumer/src/main/java/com/dianping/cat/consumer/dump/LocalMessageBucketManager.java:130 — cat-consumer/src/main/java/com/dianping/cat/consumer/dump/LocalMessageBucketManager.java:130-136 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/clean/LogviewProcessor.java:96-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/dump/LocalMessageBucketManager.java:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/problem/DefaultProblemHandler.java:51 — cat-consumer/src/main/java/com/dianping/cat/consumer/problem/DefaultProblemHandler.java:51-57 | cat-consumer/src/main/java/com/dianping/cat/consumer/problem/DefaultProblemHandler.java:95-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/problem/DefaultProblemHandler.java:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/storage/StorageDelegate.java:87 — cat-consumer/src/main/java/com/dianping/cat/consumer/storage/StorageDelegate.java:87-93 | cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportService.java:59-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:444 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:444-450 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:582-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:444` it begins part-way through the construct above it, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:178 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:178-184 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:213-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionStatisticsComputer.java:178` it does not close everything it opens, so those exact lines 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) cat-core/src/main/java/com/dianping/cat/helper/TimeHelper.java:57 — cat-core/src/main/java/com/dianping/cat/helper/TimeHelper.java:57-63 | cat-core/src/main/java/com/dianping/cat/helper/TimeHelper.java:187-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) cat-core/src/main/java/com/dianping/cat/helper/TimeHelper.java:124 — cat-core/src/main/java/com/dianping/cat/helper/TimeHelper.java:124-130 | cat-core/src/main/java/com/dianping/cat/helper/TimeHelper.java:155-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:102 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:102-108 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionAlert.java:106-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:151 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:151-157 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionAlert.java:158-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.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.
  • Duplicated block (7 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:165 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:165-171 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionAlert.java:172-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. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.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. 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) cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:188 — cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:188-194 | cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:216-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:188` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/cross/display/NameComparator.java:43 — cat-home/src/main/java/com/dianping/cat/report/page/cross/display/NameComparator.java:43-49 | cat-home/src/main/java/com/dianping/cat/report/page/cross/display/TypeComparator.java:57-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 `cat-home/src/main/java/com/dianping/cat/report/page/cross/display/NameComparator.java:43` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:119 — cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:119-125 | cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:153-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:119` it begins part-way through the construct above it, so those 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:73 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:73-79 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/LineGraphBuilder.java:70-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 (7 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:141 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:141-147 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/LineGraphBuilder.java:142-148 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphManager.java:106 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphManager.java:106-112 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphManager.java:142-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphManager.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 (7 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:103 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:103-109 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:103-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 `cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.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 (7 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/state/StateDistirbutionVisitor.java:68 — cat-home/src/main/java/com/dianping/cat/report/page/state/StateDistirbutionVisitor.java:68-74 | cat-home/src/main/java/com/dianping/cat/report/page/state/StateDistirbutionVisitor.java:102-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/state/StateDistirbutionVisitor.java:68` it does not close everything it opens, so those 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) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsIndex.java:285 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsIndex.java:285-291 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalIndex.java:473-479 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:313 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:313-319 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalIndex.java:215-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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×20
  • Duplicated block (12 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:206 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:206-217 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:204-215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:452 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:452-463 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:460-471 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:152 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:152-163 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:147-158 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 (12 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:276 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:276-287 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:271-282 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:276` it begins part-way through the construct above it, so those exact lines 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:609 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:609-620 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:587-598 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:609` it begins part-way through the construct above it, so those 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) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:97 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:97-108 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:266-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java:97` it begins part-way through the construct above it, so those 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) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportCountFilter.java:127 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportCountFilter.java:127-138 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportCountFilter.java:156-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportCountFilter.java:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportMerger.java:150 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportMerger.java:150-161 | cat-consumer/src/main/java/com/dianping/cat/consumer/problem/ProblemReportMerger.java:164-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportMerger.java:150` it begins part-way through the construct above it, so those 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) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:49 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:49-60 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:189-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 `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:80 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:80-91 | lib/java/src/main/java/com/dianping/cat/util/StringUtils.java:52-63 — before extracting anything, compare `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java` and `lib/java/src/main/java/com/dianping/cat/util/StringUtils.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also 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) cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:95 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:95-106 | lib/java/src/main/java/com/dianping/cat/util/StringUtils.java:67-78 — before extracting anything, compare `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java` and `lib/java/src/main/java/com/dianping/cat/util/StringUtils.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also 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) cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:110 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:110-121 | lib/java/src/main/java/com/dianping/cat/util/StringUtils.java:82-93 — before extracting anything, compare `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java` and `lib/java/src/main/java/com/dianping/cat/util/StringUtils.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also 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) cat-core/src/main/java/com/dianping/cat/analysis/AbstractMessageAnalyzer.java:59 — cat-core/src/main/java/com/dianping/cat/analysis/AbstractMessageAnalyzer.java:59-70 | cat-core/src/main/java/com/dianping/cat/analysis/AbstractMessageAnalyzer.java:75-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/analysis/AbstractMessageAnalyzer.java:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:74 — cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:74-85 | cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:102-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.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 (12 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:258 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:258-269 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:258-269 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/AllMachineMerger.java:110 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/AllMachineMerger.java:110-121 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/AllMachineMerger.java:145-156 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/AllMachineMerger.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 (12 lines × 2) cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/FileSystemManager.java:124 — cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/FileSystemManager.java:124-135 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsSystemManager.java:89-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/FileSystemManager.java:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) lib/java/src/main/java/com/dianping/cat/analyzer/EventAggregator.java:106 — lib/java/src/main/java/com/dianping/cat/analyzer/EventAggregator.java:106-117 | lib/java/src/main/java/com/dianping/cat/analyzer/TransactionAggregator.java:109-120 — 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 `lib/java/src/main/java/com/dianping/cat/analyzer/EventAggregator.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 (12 lines × 2) integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/HttpClientPluginTemplate.java:51 — integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/HttpClientPluginTemplate.java:51-62 | integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/OkHttpClientPluginTemplate.java:47-58 — 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 `integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/HttpClientPluginTemplate.java:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:380 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:380-391 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalIndex.java:278-289 — 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:380` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×19
  • Duplicated block (8 lines × 2) cat-client/src/main/java/com/dianping/cat/message/context/MessageIdFactory.java:104 — cat-client/src/main/java/com/dianping/cat/message/context/MessageIdFactory.java:104-111 | lib/java/src/main/java/com/dianping/cat/message/internal/MessageIdFactory.java:170-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 `cat-client/src/main/java/com/dianping/cat/message/context/MessageIdFactory.java:104` it does not close everything it opens, so those exact lines 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) cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMessageTreeEncoder.java:42 — cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMessageTreeEncoder.java:42-49 | cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMetricBagEncoder.java:37-44 — 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) cat-core/src/main/java/com/dianping/cat/message/codec/EscapingBufferWriter.java:28 — cat-core/src/main/java/com/dianping/cat/message/codec/EscapingBufferWriter.java:28-35 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/EscapingBufferWriter.java:26-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/EscapingBufferWriter.java:28` it does not close everything it opens, so those exact lines 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) lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:62 — lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:62-69 | lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:87-94 — both copies are in the same file, so extract the block into 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) cat-client/src/main/java/com/dianping/cat/support/Files.java:123 — cat-client/src/main/java/com/dianping/cat/support/Files.java:123-131 | cat-client/src/main/java/com/dianping/cat/support/Files.java:141-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/support/Files.java:123` it does not close everything it opens, so those 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) cat-client/src/main/java/com/dianping/cat/support/Threads.java:448 — cat-client/src/main/java/com/dianping/cat/support/Threads.java:448-455 | lib/java/src/main/java/com/dianping/cat/util/Threads.java:382-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. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/support/Threads.java:448` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) cat-core/src/main/java/com/dianping/cat/report/service/BaseRemoteModelService.java:87 — cat-core/src/main/java/com/dianping/cat/report/service/BaseRemoteModelService.java:87-94 | cat-home/src/main/java/com/dianping/cat/report/page/logview/service/RemoteLogViewService.java:55-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/report/service/BaseRemoteModelService.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessReportGroup.java:112 — cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessReportGroup.java:112-119 | cat-home/src/main/java/com/dianping/cat/report/page/business/task/BusinessPointParser.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. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessReportGroup.java:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:245 — cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:245-252 | cat-home/src/main/java/com/dianping/cat/report/alert/transaction/TransactionAlert.java:250-257 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:245` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:160 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:160-167 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/LineGraphBuilder.java:152-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphBuilder.java:116 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphBuilder.java:116-123 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphBuilder.java:131-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphBuilder.java:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:114 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:114-121 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:114-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:142 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/TopMetric.java:142-149 | cat-home/src/main/java/com/dianping/cat/report/page/top/TopMetric.java:142-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:76 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:76-83 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/TransactionTrendGraphBuilder.java:79-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/problem/GroupLevelInfo.java:113 — cat-home/src/main/java/com/dianping/cat/report/page/problem/GroupLevelInfo.java:113-121 | cat-home/src/main/java/com/dianping/cat/report/page/problem/ThreadLevelInfo.java:150-157 — 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) cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ServiceReportBuilder.java:89 — cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ServiceReportBuilder.java:89-96 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/utilization/UtilizationReportBuilder.java:122-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 `cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ServiceReportBuilder.java:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/transaction/service/TransactionReportService.java:267 — cat-home/src/main/java/com/dianping/cat/report/page/transaction/service/TransactionReportService.java:267-274 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/service/TransactionReportService.java:287-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/transaction/service/TransactionReportService.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 (8 lines × 2) cat-home/src/main/java/com/dianping/cat/system/page/router/config/RouterConfigHandler.java:268 — cat-home/src/main/java/com/dianping/cat/system/page/router/config/RouterConfigHandler.java:268-275 | cat-home/src/main/java/com/dianping/cat/system/page/router/task/RouterConfigBuilder.java:57-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/web/JettyUrlPluginTemplate.java:55 — integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/web/JettyUrlPluginTemplate.java:55-62 | integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/web/TomcatUrlPluginTemplate.java:52-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 `integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/web/JettyUrlPluginTemplate.java:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×18
  • Duplicated block (6 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:109 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:109-114 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:203-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 `cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.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. 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) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:233 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:233-238 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:266-271 — both copies are in the same file, so extract the block into 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) cat-core/src/main/java/com/dianping/cat/message/codec/HtmlMessageCodec.java:122 — cat-core/src/main/java/com/dianping/cat/message/codec/HtmlMessageCodec.java:122-127 | cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:340-345 — 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 `cat-core/src/main/java/com/dianping/cat/message/codec/HtmlMessageCodec.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 (6 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/HtmlMessageCodec.java:196 — cat-core/src/main/java/com/dianping/cat/message/codec/HtmlMessageCodec.java:196-201 | cat-core/src/main/java/com/dianping/cat/message/codec/HtmlMessageCodec.java:270-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) lib/java/src/main/java/com/dianping/cat/status/jvm/JvmInfoCollector.java:66 — lib/java/src/main/java/com/dianping/cat/status/jvm/JvmInfoCollector.java:66-71 | lib/java/src/main/java/com/dianping/cat/status/AbstractCollector.java:28-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) cat-client/src/main/java/com/dianping/cat/support/Splitters.java:46 — cat-client/src/main/java/com/dianping/cat/support/Splitters.java:46-51 | cat-client/src/main/java/com/dianping/cat/support/Splitters.java:66-71 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-client/src/main/java/com/dianping/cat/support/Splitters.java:46` it begins part-way through the construct above it, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyAnalyzer.java:215 — cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyAnalyzer.java:215-220 | cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyAnalyzer.java:238-243 — both copies are in the same file, so extract the block into 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) cat-consumer/src/main/java/com/dianping/cat/consumer/GraphTrendUtil.java:29 — cat-consumer/src/main/java/com/dianping/cat/consumer/GraphTrendUtil.java:29-34 | cat-consumer/src/main/java/com/dianping/cat/consumer/GraphTrendUtil.java:50-55 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/GraphTrendUtil.java:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:302 — cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:302-307 | cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:313-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:302` it does not close everything it opens, so those 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) cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:167 — cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:167-172 | cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:215-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:167` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:132 — cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:132-137 | cat-home/src/main/java/com/dianping/cat/report/page/cross/Handler.java:166-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. 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) cat-home/src/main/java/com/dianping/cat/report/page/event/DisplayNames.java:97 — cat-home/src/main/java/com/dianping/cat/report/page/event/DisplayNames.java:97-102 | cat-home/src/main/java/com/dianping/cat/report/page/event/DisplayTypes.java:74-79 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/DisplayNames.java:97` it begins part-way through the construct above it, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:173 — cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:173-179 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:188-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. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/problem/transform/DetailStatistics.java:226 — cat-home/src/main/java/com/dianping/cat/report/page/problem/transform/DetailStatistics.java:226-231 | cat-home/src/main/java/com/dianping/cat/report/page/problem/transform/ProblemStatistics.java:246-251 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/problem/transform/DetailStatistics.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 (6 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/HeavyReportMerger.java:59 — cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/HeavyReportMerger.java:59-64 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/HeavyReportMerger.java:70-75 — both copies are in the same file, so extract the block into 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) cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportBuilder.java:131 — cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportBuilder.java:131-136 | cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportBuilder.java:156-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllDomainMerger.java:100 — cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllDomainMerger.java:100-105 | cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllMachineMerger.java:80-85 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllDomainMerger.java:100` it begins part-way through the construct above it, so those exact lines 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) integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/HttpClientPluginTemplate.java:96 — integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/HttpClientPluginTemplate.java:96-101 | integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/OkHttpClientPluginTemplate.java:83-88 — 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 `integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/remote/http/HttpClientPluginTemplate.java:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×13
  • Duplicated block (14 lines × 2) cat-client/src/main/java/com/dianping/cat/configuration/source/EnvironmentVariableSource.java:31 — cat-client/src/main/java/com/dianping/cat/configuration/source/EnvironmentVariableSource.java:31-44 | cat-client/src/main/java/com/dianping/cat/configuration/source/SystemPropertiesSource.java:31-44 — 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 `cat-client/src/main/java/com/dianping/cat/configuration/source/EnvironmentVariableSource.java:31` it begins part-way through the construct above it, so those exact lines 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) cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMessageTreeEncoder.java:157 — cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMessageTreeEncoder.java:157-170 | cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMetricBagEncoder.java:82-95 — 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 `cat-client/src/main/java/com/dianping/cat/message/encoder/PlainTextMessageTreeEncoder.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 (14 lines × 2) lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:136 — lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:136-149 | cat-core/src/main/java/com/dianping/cat/message/tree/MessageId.java:141-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:116 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:116-129 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:110-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 `cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:116` it begins part-way through the construct above it, so those exact lines 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) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:240 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:240-253 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:235-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Files.java:163 — cat-client/src/main/java/com/dianping/cat/support/Files.java:163-176 | lib/java/src/main/java/com/dianping/cat/util/Files.java:148-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-client/src/main/java/com/dianping/cat/support/Files.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 (14 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Files.java:249 — cat-client/src/main/java/com/dianping/cat/support/Files.java:249-262 | lib/java/src/main/java/com/dianping/cat/util/Files.java:221-234 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-client/src/main/java/com/dianping/cat/support/Files.java:249` it begins part-way through the construct above it, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:203 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:203-216 | lib/java/src/main/java/com/dianping/cat/analyzer/DurationComputer.java:37-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java:203` it begins part-way through the construct above it, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/alert/exception/ExceptionAlert.java:151 — cat-home/src/main/java/com/dianping/cat/report/alert/exception/ExceptionAlert.java:151-164 | cat-home/src/main/java/com/dianping/cat/report/alert/heartbeat/HeartbeatAlert.java:389-402 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/alert/exception/ExceptionAlert.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.
  • Duplicated block (14 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/logview/service/LocalMessageService.java:113 — cat-home/src/main/java/com/dianping/cat/report/page/logview/service/LocalMessageService.java:113-127 | cat-home/src/main/java/com/dianping/cat/report/page/logview/service/LocalMessageService.java:150-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/logview/service/LocalMessageService.java:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMapping.java:100 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMapping.java:100-113 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalTokenMapping.java:114-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMapping.java:100` it does not close everything it opens, so those exact lines 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) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMapping.java:136 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMapping.java:136-149 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalTokenMapping.java:177-190 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMapping.java:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:424 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:424-437 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalIndex.java:324-337 — 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:424` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×13
  • Duplicated block (13 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/AbstractSender.java:65 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/AbstractSender.java:65-77 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/AbstractSender.java:112-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-alarm/src/main/java/com/dianping/cat/alarm/spi/sender/AbstractSender.java:65` it begins part-way through the construct above it, so those 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) cat-client/src/main/java/com/dianping/cat/component/factory/ComponentFactorySupport.java:26 — cat-client/src/main/java/com/dianping/cat/component/factory/ComponentFactorySupport.java:26-38 | cat-client/src/main/java/com/dianping/cat/component/factory/ComponentFactorySupport.java:44-56 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:169 — lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:169-181 | cat-core/src/main/java/com/dianping/cat/message/tree/MessageId.java:174-186 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:169` it begins part-way through the construct above it, so those 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) cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:80 — cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:80-92 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:74-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) cat-client/src/main/java/com/dianping/cat/support/Splitters.java:140 — cat-client/src/main/java/com/dianping/cat/support/Splitters.java:140-152 | lib/java/src/main/java/com/dianping/cat/util/Splitters.java:80-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-client/src/main/java/com/dianping/cat/support/Splitters.java:140` it does not close everything it opens, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/util/base/CharacterEncoder.java:76 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/base/CharacterEncoder.java:76-88 | cat-consumer/src/main/java/com/dianping/cat/consumer/util/base/CharacterEncoder.java:211-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/util/base/CharacterEncoder.java:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:432 — cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:432-444 | cat-home/src/main/java/com/dianping/cat/report/alert/spi/AlarmRule.java:87-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/alert/spi/config/BaseRuleConfigManager.java:432` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) cat-home/src/main/java/com/dianping/cat/report/graph/svg/DefaultGraphBuilder.java:96 — cat-home/src/main/java/com/dianping/cat/report/graph/svg/DefaultGraphBuilder.java:96-108 | cat-home/src/main/java/com/dianping/cat/report/graph/svg/DefaultGraphBuilder.java:270-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/graph/svg/DefaultGraphBuilder.java:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:119 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:119-131 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/LineGraphBuilder.java:102-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/LineGraphBuilder.java:119` it begins part-way through the construct above it, so those 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) cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportHourlyGraphCreator.java:125 — cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportHourlyGraphCreator.java:125-137 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportHourlyGraphCreator.java:146-158 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportHourlyGraphCreator.java:162 — cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportHourlyGraphCreator.java:162-174 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportHourlyGraphCreator.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.
  • Duplicated block (13 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/DistributionDetailVisitor.java:52 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/DistributionDetailVisitor.java:52-64 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/DistributionDetailVisitor.java:52-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/DistributionDetailVisitor.java:52` it begins part-way through the construct above it, so those exact lines 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) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucketManager.java:88 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucketManager.java:88-100 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsIndexManager.java:85-97 — 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucketManager.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×13
  • Duplicated block (5 lines × 2) lib/csharp/src/CatClient/Message/Spi/Codec/PlainTextMessageCodec.cs:84 — lib/csharp/src/CatClient/Message/Spi/Codec/PlainTextMessageCodec.cs:84-88 | lib/csharp/src/CatClient/Message/Spi/Codec/PlainTextMessageCodec.cs:89-93 — both copies are in the same file, so extract the block into 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) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:405 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:405-409 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:437-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:592 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:592-596 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:607-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-alarm/src/main/java/com/dianping/cat/alarm/spi/rule/RuleType.java:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 2) cat-alarm/src/main/java/com/dianping/cat/alarm/spi/spliter/DXSpliter.java:36 — cat-alarm/src/main/java/com/dianping/cat/alarm/spi/spliter/DXSpliter.java:36-40 | cat-alarm/src/main/java/com/dianping/cat/alarm/spi/spliter/WeixinSpliter.java:36-40 — 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 (5 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:107 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:107-111 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:102-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyReportMerger.java:38 — cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyReportMerger.java:38-42 | cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyReportMerger.java:48-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/dependency/DependencyReportMerger.java:38` it begins part-way through the construct above it, so those exact lines 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) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:215 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:215-219 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:341-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:267 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:267-271 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:304-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:267` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:65 — cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:65-69 | cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:93-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/alert/summary/build/AlertInfoBuilder.java:65` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/DistributionDetailVisitor.java:90 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/DistributionDetailVisitor.java:90-94 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/DistributionDetailVisitor.java:90-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/DistributionDetailVisitor.java:90` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/PieGraphChartVisitor.java:73 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/PieGraphChartVisitor.java:73-77 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/PieGraphChartVisitor.java:73-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 `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/PieGraphChartVisitor.java:73` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/state/StateHourlyGraphVisitor.java:70 — cat-home/src/main/java/com/dianping/cat/report/page/state/StateHourlyGraphVisitor.java:70-74 | cat-home/src/main/java/com/dianping/cat/report/page/state/StateHourlyGraphVisitor.java:88-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/state/StateHourlyGraphVisitor.java:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ClientReportStatistics.java:52 — cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ClientReportStatistics.java:52-56 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ClientReportStatistics.java:61-65 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D29 · Static Analysis (SAST) · Medium · ×9
  • Medium: httpservlet-path-traversal cat-home/src/main/java/com/dianping/cat/report/ReportContext.java:49 — Detected a potential path traversal. A malicious actor could control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are sanitized. You may also consider using a utility method such as org.apache.commons.io.FilenameUtils.getName(...) to only retrieve the file name from the path.
  • Medium: http-response-splitting cat-home/src/main/java/com/dianping/cat/report/view/DomainFilter.java:77 — Older Java application servers are vulnerable to HTTP response splitting, which may occur if an HTTP request can be injected with CRLF characters. This finding is reported for completeness; it is recommended to ensure your environment is not affected by testing this yourself. 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: httpservlet-path-traversal cat-home/src/main/java/com/dianping/cat/system/SystemContext.java:61 — Detected a potential path traversal. A malicious actor could control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are sanitized. You may also consider using a utility method such as org.apache.commons.io.FilenameUtils.getName(...) to only retrieve the file name from the path.
  • Medium: wildcard-postmessage-configuration cat-home/src/main/webapp/assets/js/editor/ace.js:1675 — The target origin of the window.postMessage() API is set to "*". This could allow for information disclosure due to the possibility of any origin allowed to receive the message. 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: wildcard-postmessage-configuration cat-home/src/main/webapp/assets/js/editor/worker-html.js:10730 — The target origin of the window.postMessage() API is set to "*". This could allow for information disclosure due to the possibility of any origin allowed to receive the message. 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: unsanitized-method cat-home/src/main/webapp/assets/js/uncompressed/jquery.sparkline.js:3000 — Detection of insertAdjacentHTML from non-constant definition. This can inadvertently expose users to cross-site scripting (XSS) attacks if this comes from user-provided input. If you have to use insertAdjacentHTML, consider using a sanitization library such as DOMPurify to sanitize your HTML. 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: unsanitized-method cat-home/src/main/webapp/assets/js/uncompressed/jquery.sparkline.js:3032 — Detection of insertAdjacentHTML from non-constant definition. This can inadvertently expose users to cross-site scripting (XSS) attacks if this comes from user-provided input. If you have to use insertAdjacentHTML, consider using a sanitization library such as DOMPurify to sanitize your HTML. 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: python-logger-credential-disclosure integration/cat-alert/cat-alert/sender.py:114 — Detected a python logger call with a potential hardcoded secret 'new get token -> %s' being logged. This may lead to secret credentials being exposed. Make sure that the logger is not logging sensitive information. 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-defused-xml lib/python/src/cat/utils.py:28 — The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. 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.
D31 · IaC & Container Security · Medium IaC · ×9
  • Medium IaC: KSV-0001 helm/templates/statefulset-cat-mysql.yaml — Can elevate its own privileges
  • Medium IaC: KSV-0012 helm/templates/statefulset-cat-mysql.yaml — Runs as root user One securityContext edit clears this facet's near-duplicate rules together: KSV-0012, KSV-0020, KSV-0021.
  • Medium IaC: KSV-0104 helm/templates/statefulset-cat-mysql.yaml — Seccomp policies disabled One securityContext edit clears this facet's near-duplicate rules together: KSV-0030, KSV-0104.
  • Medium IaC: KSV-0001 helm/templates/statefulset-cat-server.yaml — Can elevate its own privileges
  • Medium IaC: KSV-0012 helm/templates/statefulset-cat-server.yaml — Runs as root user One securityContext edit clears this facet's near-duplicate rules together: KSV-0012, KSV-0020, KSV-0021.
  • Medium IaC: KSV-0104 helm/templates/statefulset-cat-server.yaml — Seccomp policies disabled One securityContext edit clears this facet's near-duplicate rules together: KSV-0030, KSV-0104.
  • Medium IaC: KSV-0125 helm/templates/statefulset-cat-server.yaml — Restrict container images to trusted registries
  • Medium IaC: CKV_DOCKER_3 cat-home/src/main/webapp/assets/js/editor/snippets/dockerfile.js:1 — Ensure that a user for the container has been created
  • Medium IaC: CKV_DOCKER_3 docker/Dockerfile:1 — Ensure that a user for the container has been created
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×7
  • Duplicated block (15 lines × 2) cat-client/src/main/java/com/dianping/cat/component/factory/ComponentFactorySupport.java:208 — cat-client/src/main/java/com/dianping/cat/component/factory/ComponentFactorySupport.java:208-222 | cat-client/src/main/java/com/dianping/cat/component/DefaultComponentContext.java:208-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 (15 lines × 2) lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:50 — lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:50-64 | cat-core/src/main/java/com/dianping/cat/message/tree/MessageId.java:58-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 `lib/java/src/main/java/com/dianping/cat/message/internal/MessageId.java:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) lib/java/src/main/java/com/dianping/cat/message/spi/internal/DefaultMessageTree.java:77 — lib/java/src/main/java/com/dianping/cat/message/spi/internal/DefaultMessageTree.java:77-91 | cat-core/src/main/java/com/dianping/cat/message/spi/DefaultMessageTree.java:147-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:182 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:182-196 | lib/java/src/main/java/com/dianping/cat/util/StringUtils.java:137-151 — before extracting anything, compare `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java` and `lib/java/src/main/java/com/dianping/cat/util/StringUtils.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:206 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:206-220 | lib/java/src/main/java/com/dianping/cat/util/StringUtils.java:161-175 — before extracting anything, compare `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java` and `lib/java/src/main/java/com/dianping/cat/util/StringUtils.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucket.java:263 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucket.java:263-277 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsIndex.java:230-244 — 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsBucket.java:263` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMappingManager.java:53 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMappingManager.java:53-67 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalTokenMappingManager.java:44-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-hadoop/src/main/java/org/unidal/cat/message/storage/hdfs/HdfsTokenMappingManager.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.
D17 · Explicit Debt · CommentedOutCode · ×6
  • CommentedOutCode lib/csharp/src/CatClient/Message/Spi/Codec/PlainTextMessageCodec.cs:545 — 4 consecutive commented-code lines
  • CommentedOutCode lib/csharp/test/CatClientTest/EstimateByteSizeTest.cs:58 — 4 consecutive commented-code lines
  • CommentedOutCode lib/csharp/test/CatClientTest/PerformanceTest/MultithreadTest.cs:54 — 4 consecutive commented-code lines
  • CommentedOutCode lib/csharp/src/CatClient/Message/Spi/Internals/MessageIdFactory.cs:103 — 7 consecutive commented-code lines
  • CommentedOutCode lib/csharp/test/CatClientTest/PerfCounterReaderTest.cs:13 — 12 consecutive commented-code lines
  • CommentedOutCode lib/csharp/test/CatClientTest/PerformanceTest/EndlessTest.cs:55 — 3 consecutive commented-code lines
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×6
  • Duplicated block (17 lines × 2) lib/csharp/src/CatClient/Util/BlockingThreadSafeQueue.cs:50 — lib/csharp/src/CatClient/Util/BlockingThreadSafeQueue.cs:50-66 | lib/csharp/src/CatClient/Util/BlockingThreadSafeQueue.cs:77-93 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/csharp/src/CatClient/Util/BlockingThreadSafeQueue.cs: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 (17 lines × 2) lib/java/src/main/java/com/dianping/cat/message/internal/DefaultMessageProducer.java:243 — lib/java/src/main/java/com/dianping/cat/message/internal/DefaultMessageProducer.java:243-259 | lib/java/src/main/java/com/dianping/cat/message/internal/DefaultTransaction.java:242-258 — 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 `lib/java/src/main/java/com/dianping/cat/message/internal/DefaultMessageProducer.java:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (17 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:490 — cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:490-506 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:464-480 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/codec/PlainTextMessageCodec.java:490` it begins part-way through the construct above it, so those 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 (17 lines × 2) cat-core/src/main/java/com/dianping/cat/message/MessageTreeFormat.java:136 — cat-core/src/main/java/com/dianping/cat/message/MessageTreeFormat.java:136-152 | lib/java/src/main/java/com/dianping/cat/util/UrlParser.java:58-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/MessageTreeFormat.java:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (17 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Files.java:211 — cat-client/src/main/java/com/dianping/cat/support/Files.java:211-227 | lib/java/src/main/java/com/dianping/cat/util/Files.java:190-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-client/src/main/java/com/dianping/cat/support/Files.java:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (17 lines × 2) cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:444 — cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:444-460 | cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalIndex.java:344-360 — 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 `cat-hadoop/src/main/java/org/unidal/cat/message/storage/local/LocalBucket.java:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D17 · Explicit Debt · TodoComment · ×5
  • TodoComment lib/csharp/src/CatClient/Configuration/LocalClientConfig.cs:28 — // TODO need to try multiple servers here. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment lib/csharp/src/CatClient/Message/Internals/DefaultTransaction.cs:143 — // TODO For forked transactions, we should not include their data length into the current main thread's context. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment lib/csharp/src/CatClient/Message/Spi/Internals/DefaultMessageManager.cs:35 — // TODO implement enableLogging(Logger logger) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment lib/csharp/src/CatClient/Message/Spi/Internals/DefaultMessageManager.cs:137 — // TODO tagged transaction binding — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment lib/csharp/src/CatClient/Message/Spi/Internals/StatusUpdateTask.cs:233 — // TODO: thread dump is not available — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×5
  • Duplicated block (12 lines × 3) cat-client/src/main/java/com/dianping/cat/support/Threads.java:484 — cat-client/src/main/java/com/dianping/cat/support/Threads.java:484-495 | cat-client/src/main/java/com/dianping/cat/support/Threads.java:509-520 | cat-client/src/main/java/com/dianping/cat/support/Threads.java:534-545 — 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 `cat-client/src/main/java/com/dianping/cat/support/Threads.java:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:207 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:207-218 | cat-home/src/main/java/com/dianping/cat/report/page/problem/transform/ProblemTrendGraphBuilder.java:176-187 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/TransactionTrendGraphBuilder.java:232-243 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/event/JspViewer.java:39 — cat-home/src/main/java/com/dianping/cat/report/page/event/JspViewer.java:39-50 | cat-home/src/main/java/com/dianping/cat/report/page/problem/JspViewer.java:45-56 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/JspViewer.java:39-50 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/JspViewer.java:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) cat-home/src/main/java/com/dianping/cat/report/task/TaskHelper.java:34 — cat-home/src/main/java/com/dianping/cat/report/task/TaskHelper.java:34-45 | cat-home/src/main/java/com/dianping/cat/report/task/TaskHelper.java:59-70 | cat-home/src/main/java/com/dianping/cat/report/task/TaskHelper.java:84-95 — 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 `cat-home/src/main/java/com/dianping/cat/report/task/TaskHelper.java:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) lib/java/src/main/java/com/dianping/cat/util/Threads.java:450 — lib/java/src/main/java/com/dianping/cat/util/Threads.java:450-461 | lib/java/src/main/java/com/dianping/cat/util/Threads.java:475-486 | lib/java/src/main/java/com/dianping/cat/util/Threads.java:500-511 — 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 `lib/java/src/main/java/com/dianping/cat/util/Threads.java:450` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:216 — lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:216-226 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:232-242 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/PlainTextMessageCodec.java:251-261 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:92 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:92-102 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:127-137 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:162-172 — 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:167 — cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:167-177 | cat-home/src/main/java/com/dianping/cat/report/page/problem/task/ProblemReportBuilder.java:149-159 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportBuilder.java:180-190 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:140 — cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:140-150 | cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java:129-139 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:156-166 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/MatrixReportVisitor.java:97 — cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/MatrixReportVisitor.java:97-107 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/MatrixReportVisitor.java:111-121 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/MatrixReportVisitor.java:125-135 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/MatrixReportVisitor.java:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxMaker.java:113 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxMaker.java:113-121 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxMaker.java:30-38 | lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxMaker.java:321-329 — 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 `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxMaker.java:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cat-client/src/main/java/com/dianping/cat/support/servlet/CatFilter.java:146 — cat-client/src/main/java/com/dianping/cat/support/servlet/CatFilter.java:146-156 | lib/java/src/main/java/com/dianping/cat/servlet/CatFilter.java:189-199 | integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/web/BaseUrlPluginTemplate.java:74-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (9 lines × 3) cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessReportGroup.java:93 — cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessReportGroup.java:93-101 | cat-home/src/main/java/com/dianping/cat/report/alert/event/EventAlert.java:227-235 | cat-home/src/main/java/com/dianping/cat/report/page/metric/service/DefaultBaselineService.java:135-143 — 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 `cat-home/src/main/java/com/dianping/cat/report/alert/business/BusinessReportGroup.java:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/cache/TransactionReportVistor.java:55 — cat-home/src/main/java/com/dianping/cat/report/page/cache/TransactionReportVistor.java:55-63 | cat-home/src/main/java/com/dianping/cat/report/page/cross/display/MethodInfo.java:159-167 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/DisplayNames.java:80-88 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/cache/TransactionReportVistor.java:55` it begins part-way through the construct above it, so those 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) cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java:227 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java:227-235 | cat-home/src/main/java/com/dianping/cat/report/page/storage/Handler.java:327-335 | cat-home/src/main/java/com/dianping/cat/report/page/top/Handler.java:176-184 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java:227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×5
  • Duplicated block (7 lines × 3) cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.java:113 — cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.java:113-119 | cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:185-191 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:183-189 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateAnalyzer.java:82 — cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateAnalyzer.java:82-88 | cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateAnalyzer.java:91-97 | cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateAnalyzer.java:100-106 — 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateAnalyzer.java:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportCountFilter.java:56 — cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportCountFilter.java:56-62 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportCountFilter.java:82-88 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/DisplayNames.java:92-99 — 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 `cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportCountFilter.java:56` it does not close everything it opens, so those exact lines 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) cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:213 — cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:213-219 | cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java:209-215 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java:229-236 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/event/Handler.java:213` it does not close everything it opens, so those exact lines 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) integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/common/CommonPluginTemplate.java:49 — integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/common/CommonPluginTemplate.java:49-55 | integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/spring/SpringServicePluginTemplate.java:39-45 | integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/web/FilterPluginTemplate.java:45-51 — 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • Medium CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a Medium advisory. https://github.com/advisories/[GHSA redacted]
  • Medium CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a Medium advisory. https://github.com/advisories/[GHSA redacted]
  • Medium CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a Medium advisory. https://github.com/advisories/[GHSA redacted]
  • Medium CVE: Microsoft.NETCore.App 2.1.0 — Microsoft.NETCore.App 2.1.0 (direct) has a Medium advisory. https://github.com/advisories/[GHSA redacted]
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×4
  • Duplicated block (6 lines × 3) cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.java:142 — cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.java:142-147 | cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:250-255 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:248-253 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:59 — cat-home/src/main/java/com/dianping/cat/report/page/event/transform/EventTrendGraphBuilder.java:59-64 | cat-home/src/main/java/com/dianping/cat/report/page/problem/transform/ProblemTrendGraphBuilder.java:53-58 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/transform/TransactionTrendGraphBuilder.java:62-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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) cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllDomainMerger.java:45 — cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllDomainMerger.java:45-50 | cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllMachineMerger.java:51-56 | cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/StorageOperationFilter.java:52-57 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/storage/transform/AllDomainMerger.java:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) cat-home/src/main/java/com/dianping/cat/report/task/cmdb/ProjectUpdateTask.java:244 — cat-home/src/main/java/com/dianping/cat/report/task/cmdb/ProjectUpdateTask.java:244-249 | cat-home/src/main/java/com/dianping/cat/report/task/cmdb/ProjectUpdateTask.java:262-267 | cat-home/src/main/java/com/dianping/cat/report/task/cmdb/ProjectUpdateTask.java:291-296 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:855 — cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:855-864 | cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:884-893 | cat-home/src/main/java/com/dianping/cat/report/graph/svg/DefaultGraphBuilder.java:473-482 | cat-home/src/main/java/com/dianping/cat/report/graph/svg/DefaultGraphBuilder.java:502-511 — 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 `cat-core/src/main/java/com/dianping/cat/message/codec/WaterfallMessageCodec.java:855` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportMerger.java:132 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportMerger.java:132-141 | cat-consumer/src/main/java/com/dianping/cat/consumer/problem/ProblemReportMerger.java:146-155 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:48-57 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportMerger.java:188-197 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportMerger.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. 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 × 4) cat-home/src/main/java/com/dianping/cat/report/page/overload/task/DailyCapacityUpdater.java:69 — cat-home/src/main/java/com/dianping/cat/report/page/overload/task/DailyCapacityUpdater.java:69-78 | cat-home/src/main/java/com/dianping/cat/report/page/overload/task/HourlyCapacityUpdater.java:69-78 | cat-home/src/main/java/com/dianping/cat/report/page/overload/task/MonthlyCapacityUpdater.java:69-78 | cat-home/src/main/java/com/dianping/cat/report/page/overload/task/WeeklyCapacityUpdater.java:69-78 — 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 `cat-home/src/main/java/com/dianping/cat/report/page/overload/task/DailyCapacityUpdater.java:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:49 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:49-58 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxParser.java:50-59 | lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxParser.java:49-58 — 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 `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.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. 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 × 3) cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.java:93 — cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.java:93-102 | cat-core/src/main/java/com/dianping/cat/message/codec/NativeMessageCodec.java:490-499 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/NativeMessageCodec.java:498-507 — 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 `cat-client/src/main/java/com/dianping/cat/message/encoder/NativeMessageTreeEncoder.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.
  • Duplicated block (10 lines × 3) cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java:239 — cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java:239-248 | cat-home/src/main/java/com/dianping/cat/report/page/storage/Handler.java:346-355 | cat-home/src/main/java/com/dianping/cat/report/page/top/Handler.java:188-197 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×3
  • Duplicated block (8 lines × 3) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:67 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:67-74 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxParser.java:68-75 | lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxParser.java:67-74 — 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 `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:67` it does not close everything it opens, so those 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) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:215 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:215-222 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultSaxParser.java:160-167 | lib/java/src/main/java/com/dianping/cat/status/model/transform/DefaultSaxParser.java:361-368 — 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 `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultSaxParser.java:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateReportMerger.java:69 — cat-consumer/src/main/java/com/dianping/cat/consumer/state/StateReportMerger.java:69-76 | cat-home/src/main/java/com/dianping/cat/report/page/state/StateDisplay.java:140-147 | cat-home/src/main/java/com/dianping/cat/report/page/state/StateHistoryGraphVisitor.java:76-83 — 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.
D19 · Documentation Quality · Low XML-doc coverage · ×2
  • Low XML-doc coverage: Cat lib/csharp/src/CatClient/Cat.csproj — Cat: 9 % XML-doc coverage (36/422).
  • Low XML-doc coverage: CatCore lib/csharp/src/Cat.Net/CatCore.csproj — CatCore: 9 % XML-doc coverage (36/395).
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:59 — lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:59-77 | lib/java/src/main/java/com/dianping/cat/configuration/property/transform/DefaultXmlBuilder.java:61-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/java/src/main/java/com/dianping/cat/configuration/client/transform/DefaultXmlBuilder.java:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:149 — cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:149-167 | lib/java/src/main/java/com/dianping/cat/util/StringUtils.java:104-122 — before extracting anything, compare `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java` and `lib/java/src/main/java/com/dianping/cat/util/StringUtils.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cat-consumer/src/main/java/com/dianping/cat/consumer/util/StringUtils.java:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Threads.java:341 — cat-client/src/main/java/com/dianping/cat/support/Threads.java:341-358 | lib/java/src/main/java/com/dianping/cat/util/Threads.java:273-290 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-client/src/main/java/com/dianping/cat/support/Threads.java:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) cat-client/src/main/java/com/dianping/cat/support/Threads.java:410 — cat-client/src/main/java/com/dianping/cat/support/Threads.java:410-428 | lib/java/src/main/java/com/dianping/cat/util/Threads.java:345-362 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-client/src/main/java/com/dianping/cat/support/Threads.java:410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) cat-core/src/main/java/com/dianping/cat/message/codec/EscapingBufferWriter.java:44 — cat-core/src/main/java/com/dianping/cat/message/codec/EscapingBufferWriter.java:44-59 | lib/java/src/main/java/com/dianping/cat/message/spi/codec/EscapingBufferWriter.java:42-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cat-core/src/main/java/com/dianping/cat/message/codec/EscapingBufferWriter.java:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) cat-core/src/main/java/com/dianping/cat/message/storage/MessageBlockReader.java:83 — cat-core/src/main/java/com/dianping/cat/message/storage/MessageBlockReader.java:83-98 | cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/MessageBlockReader.java:93-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `cat-core/src/main/java/com/dianping/cat/message/storage/MessageBlockReader.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.
D4 · Code Duplication · Duplicated block (9 lines × 13) · ×2
  • Duplicated block (9 lines × 13) cat-home/src/main/java/com/dianping/cat/report/page/cross/service/CrossReportService.java:140 — cat-home/src/main/java/com/dianping/cat/report/page/cross/service/CrossReportService.java:140-148 | cat-home/src/main/java/com/dianping/cat/report/page/dependency/service/DependencyReportService.java:76-84 | cat-home/src/main/java/com/dianping/cat/report/page/event/service/EventReportService.java:168-176 | cat-home/src/main/java/com/dianping/cat/report/page/heartbeat/service/HeartbeatReportService.java:118-126 | cat-home/src/main/java/com/dianping/cat/report/page/matrix/service/MatrixReportService.java:140-148 | cat-home/src/main/java/com/dianping/cat/report/page/problem/service/ProblemReportService.java:143-151 | cat-home/src/main/java/com/dianping/cat/report/page/state/service/StateReportService.java:140-148 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/service/HeavyReportService.java:140-148 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/service/ServiceReportService.java:140-148 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/service/UtilizationReportService.java:139-147 | cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportService.java:168-176 | cat-home/src/main/java/com/dianping/cat/report/page/top/service/TopReportService.java:76-84 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/service/TransactionReportService.java:172-180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 13 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 13 times. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/cross/service/CrossReportService.java:140` it does not close everything it opens, so those exact lines 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 × 13) cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:55 — cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:55-63 | cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:66-74 | cat-home/src/main/java/com/dianping/cat/report/page/heartbeat/task/HeartbeatReportBuilder.java:50-58 | cat-home/src/main/java/com/dianping/cat/report/page/matrix/task/MatrixReportBuilder.java:56-64 | cat-home/src/main/java/com/dianping/cat/report/page/problem/task/ProblemReportBuilder.java:59-67 | cat-home/src/main/java/com/dianping/cat/report/page/state/task/StateReportBuilder.java:75-83 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/HeavyReportBuilder.java:62-70 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ClientReportBuilder.java:65-73 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ServiceReportBuilder.java:70-78 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/utilization/UtilizationReportBuilder.java:82-90 | cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportBuilder.java:63-71 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportBuilder.java:71-79 | cat-home/src/main/java/com/dianping/cat/system/page/router/task/RouterConfigBuilder.java:57-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 13 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 13 times.
D4 · Code Duplication · Duplicated block (9 lines × 10) · ×2
  • Duplicated block (9 lines × 10) cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:75 — cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:75-83 | cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:98-106 | cat-home/src/main/java/com/dianping/cat/report/page/matrix/task/MatrixReportBuilder.java:76-84 | cat-home/src/main/java/com/dianping/cat/report/page/problem/task/ProblemReportBuilder.java:87-95 | cat-home/src/main/java/com/dianping/cat/report/page/state/task/StateReportBuilder.java:100-108 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/HeavyReportBuilder.java:106-114 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ServiceReportBuilder.java:120-128 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/utilization/UtilizationReportBuilder.java:171-180 | cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportBuilder.java:95-103 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportBuilder.java:103-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 10 times.
  • Duplicated block (9 lines × 10) cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:91 — cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:91-99 | cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:121-129 | cat-home/src/main/java/com/dianping/cat/report/page/matrix/task/MatrixReportBuilder.java:92-100 | cat-home/src/main/java/com/dianping/cat/report/page/problem/task/ProblemReportBuilder.java:103-111 | cat-home/src/main/java/com/dianping/cat/report/page/state/task/StateReportBuilder.java:118-126 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/heavy/HeavyReportBuilder.java:122-130 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/service/ServiceReportBuilder.java:136-144 | cat-home/src/main/java/com/dianping/cat/report/page/statistics/task/utilization/UtilizationReportBuilder.java:188-196 | cat-home/src/main/java/com/dianping/cat/report/page/storage/task/StorageReportBuilder.java:118-126 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportBuilder.java:126-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 10 times.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportCountFilter.java:91 — cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventReportCountFilter.java:91-114 | cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportCountFilter.java:112-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (24 lines × 2) cat-home/src/main/java/com/dianping/cat/report/page/state/service/LocalStateService.java:53 — cat-home/src/main/java/com/dianping/cat/report/page/state/service/LocalStateService.java:53-76 | cat-home/src/main/java/com/dianping/cat/report/page/top/service/LocalTopService.java:53-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. 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.
D11 · Test Reliability · Test reliability not measured · ×1
  • Test reliability not measured — no test run produced results — Test reliability NOT MEASURED: the test run produced no results for any test tier, so no test ever ran and flakiness could not be exercised. The cause could not be attributed, so it is excluded from the score rather than read as an absence of tests.
D16 · Bus Factor · dormant codebase · ×1
  • dormant codebase — no living knowledge left to concentrate — All 117 significant source file(s) were last meaningfully changed so long ago that no living knowledge remains — nothing since has been substantial enough to re-establish ownership (a broad, mechanical sweep that touches many files shallowly does not count, and neither does no activity at all). There is no concentration to measure, so the bus factor is not scored. This is not a clean bill: nobody currently holds working knowledge of this code (see D34 Knowledge Freshness).
D36 · Supply-chain Provenance & Signing · Unpinned build actions · ×1
  • Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 7 floating ref(s) across 3 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
D36 · Supply-chain Provenance & Signing · Workflow token permissions not restricted · ×1
  • Workflow token permissions not restricted — No workflow declares a `permissions:` block, so every job runs with the repository's default GITHUB_TOKEN scope (3 workflow file(s) checked). On a repository whose default is read/write, a compromised action or a malicious pull request inherits write access to code, issues, releases and packages. Declare a least-privilege `permissions:` block — `permissions: {contents: read}` at the top of each workflow, widened per job only where a job genuinely writes.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:109 — cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.java:109-122 | cat-home/src/main/java/com/dianping/cat/report/page/event/task/EventReportBuilder.java:139-152 | cat-home/src/main/java/com/dianping/cat/report/page/matrix/task/MatrixReportBuilder.java:110-123 | cat-home/src/main/java/com/dianping/cat/report/page/problem/task/ProblemReportBuilder.java:121-134 | cat-home/src/main/java/com/dianping/cat/report/page/transaction/task/TransactionReportBuilder.java:150-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `cat-home/src/main/java/com/dianping/cat/report/page/cross/task/CrossReportBuilder.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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) cat-home/src/main/java/com/dianping/cat/report/page/overload/task/DailyCapacityUpdater.java:84 — cat-home/src/main/java/com/dianping/cat/report/page/overload/task/DailyCapacityUpdater.java:84-97 | cat-home/src/main/java/com/dianping/cat/report/page/overload/task/HourlyCapacityUpdater.java:86-99 | cat-home/src/main/java/com/dianping/cat/report/page/overload/task/MonthlyCapacityUpdater.java:84-97 | cat-home/src/main/java/com/dianping/cat/report/page/overload/task/WeeklyCapa...

    Downloadable artifacts

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