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

marklogic/marklogic-contentpump

Measured 16 November 2026, 14:59 UTC, at code version e3f0f72

First survey, so nothing to compare with yet Supply-chain provenance & signing: not measured

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 58.9out of 100 Adequate
CriticalWeakAdequateStrongExemplary

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

A medium codebase: 34,090 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Maturity, 49.6

Findings by how serious they are

6 critical 423 serious 199 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 14:59 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

49of 49 dimensions measured by tools.
566of 628 findings point to an exact file and line, so you can open each one in the code. The other 62 concern the repository as a whole, such as missing documentation.
49dimensions across 5 lenses, read from 34,090 lines of product code in 2 projects.
Chapters

Executive summary

marklogic/marklogic-contentpump falls short of our standard for production, in part because we found no recorded design decisions and no architecture document or diagram. It scores 58.9 out of 100 and is rated Adequate, and all six of its critical findings are security problems in the packages it uses and in the build pipeline.

Maturity, at 49.6, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 9.8 points. Declaring which values may be missing is another step, worth about 4.1 points. Raising Maturity to 70 would lift the score to about 64.6.

Four known security holes in the packages the code depends on can be used by attackers. Two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Updating the vulnerable packages and pinning each tool to an exact version would close both risks.

The product code is 34,090 lines, about €48,000 to rebuild.

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

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

If Maturity rose from 49.6 to 70, the lowest score rated Strong, the score would rise from 58.9 to about 64.6.

Code composition: what the lines of code are
Product code 76%Tests 24%
Rebuild cost: about €48,000 · Estimate
Cost to rebuild€16,000 to €79,000, for 264 to 836 hours of work, about 0.3 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 59. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 34,090 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.
Raises the score by about 9.8 points · Low effort · ADR Quality
2
Record your significant design decisions.
Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Raises the score by about 7.4 points · Medium effort · Architecture documentation
3
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced.
Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Raises the score by about 4.1 points · Medium effort · Nullable reference types

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €48,000 to build again, about 0.3 person-years of work. Its weakest lens is Maturity, at 49.6 (Weak). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 9.8 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 2,556 lines over the last 90 days, which is about 10,366 lines a year. At that pace, the extra work comes to an estimated 1.4 to 8.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

8 modules, with 13 dependencies between them. 3 loops run through 6 of the modules, marked above the diagonal.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 io2 mapreduce.functions3 dom4 mapreduce.utilities5 tree6 mapreduce7 contentpump.utilities8 contentpump
1 io
2 mapreduce.functions
3 dom9
4 mapreduce.utilities14
5 tree11
6 mapreduce176
7 contentpump.utilities112
8 contentpump3675
Uses a module listed above itPart of a loopThe module itself
1 io2 mapreduce.functions3 dom4 mapreduce.utilities5 tree6 mapreduce7 contentpump.utilities8 contentpumpio1mapreduce.functions2dom3mapreduce.utilities4tree5mapreduce6contentpump.utilities7contentpump8914111761123675

At a glance — Code Health · 54.1 · Adequate · gated by D2, X5 ·

At a glance — Architecture · 99.9 · Exemplary ·

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

At a glance — Readiness · 64.9 · Adequate · gated by P3 ·

At a glance — Security · 97.8 · Checked 4 of 10 ·

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:2025 — Software Supply Chain Failures8High / Critical
A05:2025 — Injection7High / Critical

Roadmap

Top priorities: Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED; Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them; Resolve the 116 Orphaned file finding(s) in Knowledge Freshness — start with TransformWriter.java, REDACTED, ExpandedTree.java.

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

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.+9.8 ptsLowADR Quality
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+7.4 ptsMediumArchitecture documentation
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).+4.1 ptsMediumNullable reference types
Resolve the 116 Orphaned file finding(s) in Knowledge Freshness — start with TransformWriter.java, REDACTED, ExpandedTree.java.+6.9 ptsHighKnowledge Freshness
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.+2.2 ptsMediumSecurity & performance tooling
Swallowed exception (empty catch)+1.9 ptsMediumException handling
Run the test suite in CI via an explicit runner step for your stack, and gate merges on it.+0.7 ptsMediumCI/CD gates
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+0.4 ptsLowBus Factor

File quality

Per-file score 0–10 — a quality signature. Of 89 files carrying findings, judged against the Production bar: 2% slop · 60% mixed · 38% near-clean.

FileScoreBandWorst signal
REDACTED0.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED6.0MixedCyclomatic Complexity: InternalUtilities.assignResultValue (cyclomatic 26)
src/main/java/com/marklogic/tree/CompressedTreeDecoder.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/mapreduce/test/FCheck.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/mapreduce/ForestReader.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/dom/NodeImpl.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/contentpump/RDFReader.java6.0MixedExplicit Debt: HackComment
src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/dom/DocumentTypeImpl.java6.5MixedExplicit Debt: TodoComment
src/test/java/com/marklogic/contentpump/Constants.java6.6MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/contentpump/CombineDocumentReader.java6.7MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java6.9MixedExplicit Debt: TodoComment
src/main/java/com/marklogic/contentpump/Command.java7.0MixedCyclomatic Complexity: 1.applyConfigOptions (cyclomatic 96)
src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java7.0MixedCyclomatic Complexity: DatabaseContentWriter.write (cyclomatic 52)
src/main/java/com/marklogic/contentpump/TransformWriter.java7.0MixedCyclomatic Complexity: TransformWriter.addValue (cyclomatic 46)
src/main/java/com/marklogic/contentpump/AggregateXMLReader.java7.0MixedCyclomatic Complexity: AggregateXMLReader.processStartElement (cyclomatic 44)
src/main/java/com/marklogic/tree/ExpandedTree.java7.0MixedCyclomatic Complexity: ExpandedTree.write (cyclomatic 38)
src/main/java/com/marklogic/contentpump/DatabaseContentReader.java7.0MixedCyclomatic Complexity: DatabaseContentReader.nextKeyValue (cyclomatic 34)

How the grades work

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

Critical — 6

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 423

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 199

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

Could not be resolved — 17

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 49 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 49 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D16D17D19D20D27D28D29D30D34D35D43D44AX10AX3AX4AX6GD1IC1M1M2M3P1P2P3P6X15X16X18X19X20X23X24X27X28X29X3X30X5

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, 566 of 628 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1e4df-3668-7d10-bb94-a4cb44bf8e53.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.java) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.java) and this repository declares a JVM test suite (repository root, Maven), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either — no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Maven tree, and its score reflects currency alone.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (34090 LoC, 231 module-visible types across 10 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • P1 CI/CD gates — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 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.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

54 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was CompressedTreeDecoder.decode at 99.

CompressedTreeDecoder.decode (cyclomatic 99)src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:114
1.applyConfigOptions (cyclomatic 96)src/main/java/com/marklogic/contentpump/Command.java:469
3.applyConfigOptions (cyclomatic 58)src/main/java/com/marklogic/contentpump/Command.java:1533
MarkLogicInputFormat.getSplits (cyclomatic 55)src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:293
DatabaseContentWriter.write (cyclomatic 52)src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:158

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

What to do

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

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

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

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

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

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

96 method(s) exceeded the cognitive complexity threshold of 15; the worst was CompressedTreeDecoder.decode at 166.

CompressedTreeDecoder.decode (cognitive 166)src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:114
1.applyConfigOptions (cognitive 137)src/main/java/com/marklogic/contentpump/Command.java:469
DatabaseContentWriter.write (cognitive 124)src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:158
DatabaseContentReader.nextKeyValue (cognitive 117)src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:552
MarkLogicInputFormat.getSplits (cognitive 113)src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:293

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with CompressedTreeDecoder.decode (cognitive 166), 1.applyConfigOptions (cognitive 137), DatabaseContentWriter.write (cognitive 124). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cognitive Complexity from 2.4 to about 3.1/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes7.2 / 10Strong✓ Tool-verified

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

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

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

41 god class(es) detected.

MethodTooLong: CompressedTreeDecoder.decode · ×21src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:114
ClassTooLong: Command · ×8src/main/java/com/marklogic/contentpump/Command.java:59
FileTooLong: contentpump/Command.java · ×7src/main/java/com/marklogic/contentpump/Command.java
TooManyMethods: NodeImpl · ×5src/main/java/com/marklogic/dom/NodeImpl.java:46

What to do

  1. Resolve the 21 MethodTooLong finding(s) in God Classes — start with Command.java (5), DatabaseContentReader.java (2), ExpandedTree.java (2). — One of this dimension's main actionable groups (21 warning-level).
  2. Resolve the 8 ClassTooLong finding(s) in God Classes — start with Command.java, RDFReader.java, CompressedTreeDecoder.java. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 7 FileTooLong finding(s) in God Classes — start with Command.java, RDFReader.java, CompressedTreeDecoder.java. — One of this dimension's main actionable groups (7 warning-level).

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

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

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

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

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

108 duplicated block group(s) detected. 11.1 % of the production lines (3,768 of 34,090) are in a reported copy. A further 43 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (10 lines × 2) · ×13src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:159
Duplicated block (11 lines × 2) · ×7src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:270
Duplicated block (15 lines × 2) · ×5src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:604
Duplicated block (8 lines × 2) · ×5src/main/java/com/marklogic/contentpump/Command.java:1084
Duplicated block (7 lines × 2) · ×5src/main/java/com/marklogic/contentpump/Command.java:2576

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

What to do

  1. Resolve the 13 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with Command.java (2), ArchiveRecordReader.java, DatabaseContentWriter.java. — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 7 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with DatabaseContentReader.java (2), REDACTED (2), SingleDocumentWriter.java. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 5 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with DatabaseContentReader.java, DatabaseTransformWriter.java, DelimitedTextReader.java. — One of this dimension's main actionable groups (5 warning-level).

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

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

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

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

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

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

2 production modules (Gradle+Maven), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

0 of 77 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 229 tests.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

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

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

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

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

55 outdated artifact(s) of 64 resolved by the build, graded against Maven Central. Whether any of these is DEPRECATED is not graded — Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Known CVEs in this graph are D30's question, read from the manifest there.

Outdated (compile): org.apache.hadoop:hadoop-yarn-common · ×46
Outdated (runtime): xml-apis:xml-apis · ×6
Outdated (test): com.google.guava:guava · ×2
Outdated (system): com.marklogic:marklogic-xcc

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

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 61 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 2 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. A further 1 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.

✓ 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: Documented → Verified → Prevented · 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.

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

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

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

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

1 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java. Counted over 45 of the 213 production source files in this repository: 79 are under the ~2,400-byte size floor this dimension measures over, and the remaining 89 have no attributable history left to measure.

Off-boarding risk: anonymized user #1

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.8 / 10Stronggated by 42 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×41src/test/java/com/marklogic/mapreduce/Utils.java:80
HackCommentsrc/main/java/com/marklogic/contentpump/RDFReader.java:943

What to do

  1. Resolve the 41 TodoComment finding(s) in Explicit Debt — start with FCheck.java (14), DocumentTypeImpl.java (6), Constants.java (4). — One of this dimension's main actionable groups (41 warning-level).
  2. Resolve the 1 HackComment finding(s) in Explicit Debt — start with RDFReader.java. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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

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

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

No architecture decision records were found.

No ADRs foundREDACTED:127

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability9.9 / 10Exemplary✓ Tool-verified

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

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

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

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

30 % of calls cross a namespace and 2 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)9.3 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

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

7 finding(s): 0 critical, 2 high, 0 medium, 5 low. 2 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens.

REDACTED
REDACTED

What to do

  1. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 recommendation-level).
  2. No action in Static Analysis (SAST) — all 2 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (2 issue-level, 0 of them charged here).

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

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

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

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

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

8 finding(s): 0 critical, 4 high, 4 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — 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.

D34 · Knowledge Freshness1.1 / 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: Documented → Verified → Prevented · effective 1.1 / 10 · rule-coverage 100% · ceiling Documented

119 of 134 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/main/java/com/marklogic/contentpump/Command.java. Counted over 134 of the 213 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×116src/main/java/com/marklogic/contentpump/TransformWriter.java:1
Most significant orphaned file · ×3src/main/java/com/marklogic/contentpump/Command.java:1
Concentrated knowledge decay

What to do

  1. Resolve the 116 Orphaned file finding(s) in Knowledge Freshness — start with TransformWriter.java, REDACTED, ExpandedTree.java. — One of this dimension's main actionable groups (116 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with Command.java, MarkLogicConstants.java, CompressedTreeDecoder.java. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change 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. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 63 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition10.0 / 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. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

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

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

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

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

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

GD1 · Unfinished & placeholder code10.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unreviewed-generation residue in this repository's Java: methods whose whole body only throws a "not implemented" or bare unsupported-operation exception, or returns a default value (or nothing) under a TODO/FIXME marker, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of 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.

  • `getEntities` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/main/java/com/marklogic/dom/DocumentTypeImpl.java:42
  • `getNotations` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/main/java/com/marklogic/dom/DocumentTypeImpl.java:48
  • `getPublicId` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/main/java/com/marklogic/dom/DocumentTypeImpl.java:54
  • `getSystemId` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/main/java/com/marklogic/dom/DocumentTypeImpl.java:60
  • `getInternalSubset` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/main/java/com/marklogic/dom/DocumentTypeImpl.java:66
  • `getNodeName` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/main/java/com/marklogic/dom/DocumentTypeImpl.java:72

What to do

  • Finish or delete the methods that still throw "not implemented" or return a placeholder under a TODO, and replace placeholder text before shipping.
IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

M1 · Documentation (README)7.3 / 10Strong✓ Tool-verified

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

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

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 numbered `NNNN-title` documents in any markup this check reads, 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/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

P1 · CI/CD gates6.5 / 10Adequate✓ Tool-verified

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.

  • A CI pipeline exists but no build step was matched — changes may merge without the build ever running. A build step may be invoked directly as a command, or declared as a task that a runner named in the pipeline resolves.

What to do

  • Run the test suite in CI via an explicit runner step for your stack, and gate merges on it.
  • Add an explicit build step to your CI pipeline — your stack's own build command, or, if the pipeline delegates to a task runner, a build task that runner executes in CI — so every change is built before merge.
P2 · Observability7.0 / 10Strong✓ Tool-verified

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

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

P3 · Security & performance tooling3.0 / 10Weak✓ 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 was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:4
  • `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:311

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.
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.

X15 · Unvalidated length from an untrusted reader1.5 / 10Critical✓ Tool-verified

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

  • `atomDataLen` is read from the bytes being parsed at line 306 (`readInt`), then used to size a `new byte[]` at line 308 — and nowhere in its scope is `atomDataLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `atomDataLen` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:308
  • `nodeNameNameAtomLen` is read from the bytes being parsed at line 320 (`readInt`), then used to size a `new int[]` at line 322 — and nowhere in its scope is `nodeNameNameAtomLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `nodeNameNameAtomLen` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:322
  • `numElemNodeReps` is read from the bytes being parsed at line 343 (`readInt`), then used to size a `new int[]` at line 345 — and nowhere in its scope is `numElemNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numElemNodeReps` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:345
  • `numAttrNodeReps` is read from the bytes being parsed at line 364 (`readInt`), then used to size a `new int[]` at line 366 — and nowhere in its scope is `numAttrNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numAttrNodeReps` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:366
  • `numDocNodeReps` is read from the bytes being parsed at line 388 (`readInt`), then used to size a `new int[]` at line 390 — and nowhere in its scope is `numDocNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numDocNodeReps` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:390
  • `numPINodeReps` is read from the bytes being parsed at line 399 (`readInt`), then used to size a `new int[]` at line 401 — and nowhere in its scope is `numPINodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numPINodeReps` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:401
  • `numArrayNodeReps` is read from the bytes being parsed at line 431 (`readInt`), then used to size a `new int[]` at line 433 — and nowhere in its scope is `numArrayNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numArrayNodeReps` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:433
  • `numDoubles` is read from the bytes being parsed at line 442 (`readInt`), then used to size a `new double[]` at line 444 — and nowhere in its scope is `numDoubles` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numDoubles` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/tree/ExpandedTree.java:444
  • `len` is read from the bytes being parsed at line 72 (`readInt`), then used to size a `new byte[]` at line 74 — and nowhere in its scope is `len` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/marklogic/contentpump/DatabaseDocumentWithMeta.java:74

What to do

  • Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

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

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen.

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

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling6.0 / 10Adequate✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×14) — src/main/java/com/marklogic/mapreduce/ContentWriter.java:665, src/main/java/com/marklogic/mapreduce/ContentWriter.java:906, src/main/java/com/marklogic/mapreduce/ContentWriter.java:925, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. (×3) — src/main/java/com/marklogic/mapreduce/ContentWriter.java:832, src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:390, src/main/java/com/marklogic/contentpump/TransformWriter.java:678
  • `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — src/main/java/com/marklogic/mapreduce/test/BinaryLoader.java:122, src/main/java/com/marklogic/mapreduce/examples/ContentLoader.java:138

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 0/12 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

What to do

  • Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

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 Health54.1Adequate — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99.9ExemplaryStrongest area.
Maturity49.6Weak — gated by D34, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness64.9Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security97.8Checked 4 of 10Solid.
Unscored — 2 check(s) recorded observations but carry no score

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

  • D36 Supply-chain Provenance & Signing — 1 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • X10 Duplicated predicate — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 60 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 — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — Not applicable: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .java suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (3414 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .java, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • 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 lens looks for
  • M4 Documentation accuracy — Not applicable: the 3 current-state document(s) make no claim of a kind M4 checks.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a REDACTED, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Java was read, and no request in it can be cancelled by a caller — a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Java was read, and it logs through none that an assembled message defeats: java.util.logging's level methods, log4j 1, commons-logging, JBoss Logging and Flogger take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J or log4j 2 (`org.slf4j.Logger`, `org.apache.logging.log4j.Logger`, Lombok's `@Slf4j`) would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 6 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
Serious — 423 finding(s)
D17 · Explicit Debt · TodoComment · ×41
  • TodoComment src/test/java/com/marklogic/mapreduce/Utils.java:80 — // TODO: Is it better to read into a buffer or directly from the — 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 src/main/java/com/marklogic/mapreduce/ForestReader.java:380 — // TODO: Is it better to read into a buffer or directly from the — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:544 — // TODO: Is it better to read into a buffer or directly from the — 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 src/test/java/com/marklogic/contentpump/Constants.java:93 — // TODO Auto-generated catch block — 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 src/test/java/com/marklogic/contentpump/Constants.java:107 — // TODO Auto-generated catch block — 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 src/test/java/com/marklogic/contentpump/Constants.java:116 — // TODO Auto-generated catch block — 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 src/test/java/com/marklogic/contentpump/Constants.java:124 — // TODO Auto-generated catch block — 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 src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:89 — // TODO Auto-generated catch block — 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 src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:92 — // TODO Auto-generated catch block — 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 src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:95 — // TODO Auto-generated catch block — 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 src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:83 — // TODO Auto-generated catch block — 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 src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:86 — // TODO Auto-generated catch block — 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 src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:89 — // TODO Auto-generated catch block — 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 src/test/java/com/marklogic/contentpump/TestImportBigData.java:36 — // TODO Auto-generated constructor stub — 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 src/main/java/com/marklogic/contentpump/utilities/ZipInputStream.java:35 — // TODO Auto-generated constructor stub — 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 src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:841 — // TODO: compared performance — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:354 — // TODO: if MAPREDUCE-3377 still exists, need to re-run initialize
  • TodoComment src/main/java/com/marklogic/mapreduce/NodePath.java:35 — // TODO: revisit -- is it faster to use Text or String? — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:41 — // TODO: More rigorous file checks to match stat() in C++ version? — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:42 — // TODO: Test range, platform byte ordering, bitness. Auto-detect? — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:43 — // TODO: buffers larger than int indexes? — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:44 — // TODO: less long more int; review ranges carefully; can't we assume there won't be more than 2B fragments in a forest? — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:45 — // TODO: review for proper application of unsigned comparators — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:46 — // TODO: tune buffer sizes — 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 src/main/java/com/marklogic/mapreduce/test/FCheck.java:47 — // TODO: pass files into check functions rather than directory — 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.
  • + 16 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×21
  • MethodTooLong: CompressedTreeDecoder.decode src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:114 — MethodTooLong — decode runs 519 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 419 over it, 5.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 1.applyConfigOptions src/main/java/com/marklogic/contentpump/Command.java:469 — MethodTooLong — applyConfigOptions runs 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 1.configOptions src/main/java/com/marklogic/contentpump/Command.java:62 — MethodTooLong — configOptions runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 3.configOptions src/main/java/com/marklogic/contentpump/Command.java:1238 — MethodTooLong — configOptions runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MarkLogicInputFormat.getSplits src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:293 — MethodTooLong — getSplits runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 3.applyConfigOptions src/main/java/com/marklogic/contentpump/Command.java:1533 — MethodTooLong — applyConfigOptions runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DatabaseContentWriter.write src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:158 — MethodTooLong — write runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TransformWriter.addValue src/main/java/com/marklogic/contentpump/TransformWriter.java:351 — MethodTooLong — addValue runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MarkLogicRecordReader.init src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:256 — MethodTooLong — init runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DatabaseContentReader.init src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:142 — MethodTooLong — init runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ExpandedTree.readFields src/main/java/com/marklogic/tree/ExpandedTree.java:295 — MethodTooLong — readFields runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ForestInputFormat.getSplits src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:98 — MethodTooLong — getSplits runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContentPump.runCommand src/main/java/com/marklogic/contentpump/ContentPump.java:84 — MethodTooLong — runCommand runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AggregateXMLReader.processStartElement src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:228 — MethodTooLong — processStartElement runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DatabaseContentReader.nextKeyValue src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:552 — MethodTooLong — nextKeyValue runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LocalJobRunner.run src/main/java/com/marklogic/contentpump/LocalJobRunner.java:92 — MethodTooLong — run runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContentWriter.<init> src/main/java/com/marklogic/mapreduce/ContentWriter.java:202 — MethodTooLong — <init> runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DatabaseTransformWriter.write src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:56 — MethodTooLong — write runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 2.applyConfigOptions src/main/java/com/marklogic/contentpump/Command.java:1075 — MethodTooLong — applyConfigOptions runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ExpandedTree.write src/main/java/com/marklogic/tree/ExpandedTree.java:452 — MethodTooLong — write runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContentOutputFormat.initialize src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:393 — MethodTooLong — initialize runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
X3 · Exception handling · Swallowed exception (empty catch) · ×17
  • Swallowed exception (empty catch) src/main/java/com/marklogic/mapreduce/ContentWriter.java:665 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/mapreduce/ContentWriter.java:832 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/mapreduce/ContentWriter.java:906 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/mapreduce/ContentWriter.java:925 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:420 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:461 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:303 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:605 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:674 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:691 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:262 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:390 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:107 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/MultithreadedMapper.java:207 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/ThreadManager.java:656 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/TransformWriter.java:245 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/marklogic/contentpump/TransformWriter.java:678 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×13
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:159 — src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:159-168 | src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:176-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:780 — src/main/java/com/marklogic/contentpump/Command.java:780-789 | src/main/java/com/marklogic/contentpump/Command.java:1198-1207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:1063 — src/main/java/com/marklogic/contentpump/Command.java:1063-1072 | src/main/java/com/marklogic/contentpump/Command.java:1521-1530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:1063` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:361 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:361-370 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:803-812 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:361` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:110 — src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:110-119 | src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:159-168 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java` and `src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/LocalJobRunner.java:107 — src/main/java/com/marklogic/contentpump/LocalJobRunner.java:107-116 | src/main/java/com/marklogic/contentpump/LocalJobRunner.java:128-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/LocalJobRunner.java:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/OutputArchive.java:91 — src/main/java/com/marklogic/contentpump/OutputArchive.java:91-100 | src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:87-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/OutputArchive.java:91` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/contentpump/TransformWriter.java:387 — src/main/java/com/marklogic/contentpump/TransformWriter.java:387-396 | src/main/java/com/marklogic/contentpump/TransformWriter.java:417-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 `src/main/java/com/marklogic/contentpump/TransformWriter.java:387` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java:51 — src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java:51-60 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:273-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 `src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java:51` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/dom/ElementImpl.java:330 — src/main/java/com/marklogic/dom/ElementImpl.java:330-339 | src/main/java/com/marklogic/dom/ElementImpl.java:349-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/dom/ElementImpl.java:330` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:239 — src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:239-248 | src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:254-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:239` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/mapreduce/functions/ValueMatch.java:58 — src/main/java/com/marklogic/mapreduce/functions/ValueMatch.java:58-67 | src/main/java/com/marklogic/mapreduce/functions/Values.java:55-64 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/functions/ValueMatch.java` and `src/main/java/com/marklogic/mapreduce/functions/Values.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) src/main/java/com/marklogic/io/Decoder.java:199 — src/main/java/com/marklogic/io/Decoder.java:199-208 | src/main/java/com/marklogic/io/Decoder.java:222-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×9
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:308 — `atomDataLen` is read from the bytes being parsed at line 306 (`readInt`), then used to size a `new byte[]` at line 308 — and nowhere in its scope is `atomDataLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `atomDataLen` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:322 — `nodeNameNameAtomLen` is read from the bytes being parsed at line 320 (`readInt`), then used to size a `new int[]` at line 322 — and nowhere in its scope is `nodeNameNameAtomLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `nodeNameNameAtomLen` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:345 — `numElemNodeReps` is read from the bytes being parsed at line 343 (`readInt`), then used to size a `new int[]` at line 345 — and nowhere in its scope is `numElemNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numElemNodeReps` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:366 — `numAttrNodeReps` is read from the bytes being parsed at line 364 (`readInt`), then used to size a `new int[]` at line 366 — and nowhere in its scope is `numAttrNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numAttrNodeReps` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:390 — `numDocNodeReps` is read from the bytes being parsed at line 388 (`readInt`), then used to size a `new int[]` at line 390 — and nowhere in its scope is `numDocNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numDocNodeReps` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:401 — `numPINodeReps` is read from the bytes being parsed at line 399 (`readInt`), then used to size a `new int[]` at line 401 — and nowhere in its scope is `numPINodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numPINodeReps` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:433 — `numArrayNodeReps` is read from the bytes being parsed at line 431 (`readInt`), then used to size a `new int[]` at line 433 — and nowhere in its scope is `numArrayNodeReps` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numArrayNodeReps` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/tree/ExpandedTree.java:444 — `numDoubles` is read from the bytes being parsed at line 442 (`readInt`), then used to size a `new double[]` at line 444 — and nowhere in its scope is `numDoubles` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numDoubles` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/marklogic/contentpump/DatabaseDocumentWithMeta.java:74 — `len` is read from the bytes being parsed at line 72 (`readInt`), then used to size a `new byte[]` at line 74 — and nowhere in its scope is `len` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
D3 · God Classes · ClassTooLong · ×8
  • ClassTooLong: Command src/main/java/com/marklogic/contentpump/Command.java:59 — ClassTooLong — 2248 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 1848 over it, 5.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RDFReader src/main/java/com/marklogic/contentpump/RDFReader.java:80 — ClassTooLong — 753 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 353 over it, 1.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CompressedTreeDecoder src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:38 — ClassTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 277 over it, 1.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ContentWriter src/main/java/com/marklogic/mapreduce/ContentWriter.java:59 — ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 182 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DatabaseContentReader src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:69 — ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 132 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TransformWriter src/main/java/com/marklogic/contentpump/TransformWriter.java:69 — ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 122 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ExpandedTree src/main/java/com/marklogic/tree/ExpandedTree.java:44 — ClassTooLong — 484 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 84 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ContentOutputFormat src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:82 — ClassTooLong — 431 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 31 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · FileTooLong · ×7
  • FileTooLong: contentpump/Command.java src/main/java/com/marklogic/contentpump/Command.java — FileTooLong — 2281 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Command (59-2817). The bar is 500 significant lines; this is 1781 over it, 4.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: contentpump/RDFReader.java src/main/java/com/marklogic/contentpump/RDFReader.java — FileTooLong — 806 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: RDFReader (80-1140). The bar is 500 significant lines; this is 306 over it, 1.61× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: tree/CompressedTreeDecoder.java src/main/java/com/marklogic/tree/CompressedTreeDecoder.java — FileTooLong — 688 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: CompressedTreeDecoder (38-850). The bar is 500 significant lines; this is 188 over it, 1.38× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: mapreduce/ContentWriter.java src/main/java/com/marklogic/mapreduce/ContentWriter.java — FileTooLong — 615 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: ContentWriter (59-939). The bar is 500 significant lines; this is 115 over it, 1.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: contentpump/DatabaseContentReader.java src/main/java/com/marklogic/contentpump/DatabaseContentReader.java — FileTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: DatabaseContentReader (69-801). The bar is 500 significant lines; this is 69 over it, 1.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: contentpump/TransformWriter.java src/main/java/com/marklogic/contentpump/TransformWriter.java — FileTooLong — 564 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TransformWriter (69-740). The bar is 500 significant lines; this is 64 over it, 1.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: tree/ExpandedTree.java src/main/java/com/marklogic/tree/ExpandedTree.java — FileTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: ExpandedTree (44-674). The bar is 500 significant lines; this is 3 over it, 1.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×7
  • Duplicated block (11 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:270 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:270-280 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:393-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:267` calls `setNewIntegerVariable` and `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:392` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:291 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:291-301 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:408-418 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:288` calls `debug` and `src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:405` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:168 — src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:168-178 | src/main/java/com/marklogic/mapreduce/utilities/URIUtil.java:87-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) REDACTED:164 — REDACTED:164-174 | REDACTED:223-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:176 — REDACTED:176-186 | REDACTED:235-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:176` it begins part-way through the construct above it, so those exact lines 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) src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:72 — src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:72-82 | src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:95-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:71` calls `decodeUnsigned` and `src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:94` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/main/java/com/marklogic/mapreduce/NodeOutputFormat.java:69 — src/main/java/com/marklogic/mapreduce/NodeOutputFormat.java:69-79 | src/main/java/com/marklogic/mapreduce/PropertyOutputFormat.java:77-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
GD1 · Unfinished & placeholder code · Unfinished stub · ×6
  • Unfinished stub — returns a placeholder under a TODO marker src/main/java/com/marklogic/dom/DocumentTypeImpl.java:42 — `getEntities` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
  • Unfinished stub — returns a placeholder under a TODO marker src/main/java/com/marklogic/dom/DocumentTypeImpl.java:48 — `getNotations` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
  • Unfinished stub — returns a placeholder under a TODO marker src/main/java/com/marklogic/dom/DocumentTypeImpl.java:54 — `getPublicId` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
  • Unfinished stub — returns a placeholder under a TODO marker src/main/java/com/marklogic/dom/DocumentTypeImpl.java:60 — `getSystemId` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
  • Unfinished stub — returns a placeholder under a TODO marker src/main/java/com/marklogic/dom/DocumentTypeImpl.java:66 — `getInternalSubset` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
  • Unfinished stub — returns a placeholder under a TODO marker src/main/java/com/marklogic/dom/DocumentTypeImpl.java:72 — `getNodeName` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
D3 · God Classes · TooManyMethods · ×5
  • TooManyMethods: NodeImpl src/main/java/com/marklogic/dom/NodeImpl.java:46 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DocumentImpl src/main/java/com/marklogic/dom/DocumentImpl.java:55 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RDFReader src/main/java/com/marklogic/contentpump/RDFReader.java:80 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ElementImpl src/main/java/com/marklogic/dom/ElementImpl.java:47 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DocumentMetadata src/main/java/com/marklogic/contentpump/DocumentMetadata.java:38 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×5
  • Duplicated block (15 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:604 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:604-618 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:690-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:604` it begins part-way through the construct above it, so those 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) src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:58 — src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:58-72 | src/main/java/com/marklogic/contentpump/TransformWriter.java:206-220 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java` and `src/main/java/com/marklogic/contentpump/TransformWriter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:172 — src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:172-186 | src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:220-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/main/java/com/marklogic/contentpump/RDFReader.java:717 — src/main/java/com/marklogic/contentpump/RDFReader.java:717-731 | src/main/java/com/marklogic/contentpump/RDFReader.java:757-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/RDFReader.java:717` it begins part-way through the construct above it, so those exact lines 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) src/main/java/com/marklogic/contentpump/utilities/ReflectionUtil.java:74 — src/main/java/com/marklogic/contentpump/utilities/ReflectionUtil.java:74-88 | src/main/java/com/marklogic/contentpump/utilities/ReflectionUtil.java:108-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×5
  • Duplicated block (8 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:1084 — src/main/java/com/marklogic/contentpump/Command.java:1084-1091 | src/main/java/com/marklogic/contentpump/Command.java:1806-1813 — both copies are in the same file, so extract the block into 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) src/main/java/com/marklogic/contentpump/RDFReader.java:708 — src/main/java/com/marklogic/contentpump/RDFReader.java:708-715 | src/main/java/com/marklogic/contentpump/RDFReader.java:749-756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/RDFReader.java:708` it does not close everything it opens, so those 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) src/main/java/com/marklogic/contentpump/ThreadManager.java:293 — src/main/java/com/marklogic/contentpump/ThreadManager.java:293-300 | src/main/java/com/marklogic/contentpump/ThreadManager.java:411-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:416 — src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:416-424 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:458-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:416` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:466` calls `init` and `src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:425` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) src/main/java/com/marklogic/tree/ExpandedTree.java:638 — src/main/java/com/marklogic/tree/ExpandedTree.java:638-645 | src/main/java/com/marklogic/tree/ExpandedTree.java:652-659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/tree/ExpandedTree.java:638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/marklogic/tree/ExpandedTree.java:661` calls `atomString` and `src/main/java/com/marklogic/tree/ExpandedTree.java:646` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:2576 — src/main/java/com/marklogic/contentpump/Command.java:2576-2582 | src/main/java/com/marklogic/contentpump/Command.java:2599-2605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:2576` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/contentpump/TransformWriter.java:380 — src/main/java/com/marklogic/contentpump/TransformWriter.java:380-386 | src/main/java/com/marklogic/contentpump/TransformWriter.java:401-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/TransformWriter.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.
  • Duplicated block (7 lines × 2) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:625 — src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:625-631 | src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:253-259 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:625` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/mapreduce/utilities/LegacyAssignmentPolicy.java:68 — src/main/java/com/marklogic/mapreduce/utilities/LegacyAssignmentPolicy.java:68-74 | src/main/java/com/marklogic/mapreduce/utilities/LegacyAssignmentPolicy.java:84-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/utilities/LegacyAssignmentPolicy.java:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) src/main/java/com/marklogic/contentpump/TransformWriter.java:545 — src/main/java/com/marklogic/contentpump/TransformWriter.java:545-551 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:788-798 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:229 — src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:229-241 | src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:398-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:229` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/contentpump/Command.java:1047 — src/main/java/com/marklogic/contentpump/Command.java:1047-1059 | src/main/java/com/marklogic/contentpump/Command.java:1500-1512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:1047` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:125 — src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:125-137 | src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:212-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:138` calls `setNewVariable`, `Boolean` and `src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:225` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:140 — src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:140-152 | src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:225-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:140` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:138` calls `setNewVariable`, `Boolean` and `src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:224` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×4
  • Duplicated block (9 lines × 2) src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:270 — src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:270-278 | src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:109-117 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java` and `src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:270` it begins part-way through the construct above it, so those exact lines 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) src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:213 — src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:213-221 | src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:230-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/main/java/com/marklogic/mapreduce/MarkLogicInputSplit.java:135 — src/main/java/com/marklogic/mapreduce/MarkLogicInputSplit.java:135-143 | src/main/java/com/marklogic/mapreduce/utilities/ForestInfo.java:87-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/mapreduce/MarkLogicInputSplit.java:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) REDACTED:616 — REDACTED:616-624 | REDACTED:632-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:616` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×4
  • Duplicated block (6 lines × 2) src/main/java/com/marklogic/dom/NodeImpl.java:335 — src/main/java/com/marklogic/dom/NodeImpl.java:335-340 | src/main/java/com/marklogic/dom/NodeImpl.java:344-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/dom/NodeImpl.java:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:99 — src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:99-104 | src/main/java/com/marklogic/contentpump/RDFReader.java:200-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) src/main/java/com/marklogic/mapreduce/NodeOutputFormat.java:59 — src/main/java/com/marklogic/mapreduce/NodeOutputFormat.java:59-64 | src/main/java/com/marklogic/mapreduce/PropertyOutputFormat.java:66-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/NodeOutputFormat.java:59` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) src/main/java/com/marklogic/mapreduce/functions/ElemValueCooccurrences.java:76 — src/main/java/com/marklogic/mapreduce/functions/ElemValueCooccurrences.java:76-81 | src/main/java/com/marklogic/mapreduce/functions/FieldValueCooccurrences.java:72-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×3
  • Edited copy of a member (15 corresponding lines) REDACTED:610 — REDACTED:610-624 | REDACTED:626-640 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:158 — src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:158-172 | src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:175-191 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/main/java/com/marklogic/mapreduce/DOMDocument.java:128 — src/main/java/com/marklogic/mapreduce/DOMDocument.java:128-142 | src/main/java/com/marklogic/mapreduce/DOMDocument.java:145-162 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×3
  • Edited copy of a member (11 corresponding lines) src/main/java/com/marklogic/dom/AttrImpl.java:146 — src/main/java/com/marklogic/dom/AttrImpl.java:146-156 | src/main/java/com/marklogic/dom/ElementImpl.java:273-284 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/main/java/com/marklogic/contentpump/DocumentMetadata.java:360 — src/main/java/com/marklogic/contentpump/DocumentMetadata.java:360-370 | src/main/java/com/marklogic/contentpump/DocumentMetadata.java:371-384 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/main/java/com/marklogic/contentpump/CompressedRDFInputFormat.java:42 — src/main/java/com/marklogic/contentpump/CompressedRDFInputFormat.java:42-52 | src/main/java/com/marklogic/contentpump/RDFInputFormat.java:48-58 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) src/main/java/com/marklogic/mapreduce/functions/ValueMatch.java:69 — src/main/java/com/marklogic/mapreduce/functions/ValueMatch.java:69-76 | src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java:102-109 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/main/java/com/marklogic/contentpump/DelimitedJSONReader.java:126 — src/main/java/com/marklogic/contentpump/DelimitedJSONReader.java:126-133 | src/main/java/com/marklogic/contentpump/GzipDelimitedJSONReader.java:41-49 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/main/java/com/marklogic/mapreduce/DOMDocument.java:196 — src/main/java/com/marklogic/mapreduce/DOMDocument.java:196-203 | src/main/java/com/marklogic/mapreduce/JSONDocument.java:139-146 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:974 — src/main/java/com/marklogic/contentpump/Command.java:974-989 | src/main/java/com/marklogic/contentpump/Command.java:1848-1863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/main/java/com/marklogic/contentpump/RDFReader.java:465 — src/main/java/com/marklogic/contentpump/RDFReader.java:465-480 | src/main/java/com/marklogic/contentpump/RDFReader.java:497-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (16 lines × 2) src/main/java/com/marklogic/mapreduce/DOMDocument.java:70 — src/main/java/com/marklogic/mapreduce/DOMDocument.java:70-85 | src/main/java/com/marklogic/mapreduce/JSONDocument.java:50-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:125 — src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:125-138 | src/main/java/com/marklogic/contentpump/RDFWritable.java:121-134 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java` and `src/main/java/com/marklogic/contentpump/RDFWritable.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/RDFWritable.java:116` calls `setGraph`, `setPermissions` and `src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:123` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:194 — src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:194-207 | src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:173-186 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java` and `src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/main/java/com/marklogic/contentpump/LocalJobRunner.java:204 — src/main/java/com/marklogic/contentpump/LocalJobRunner.java:204-217 | src/main/java/com/marklogic/contentpump/LocalJobRunner.java:383-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/LocalJobRunner.java:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/marklogic/contentpump/LocalJobRunner.java:397` calls `set` and `src/main/java/com/marklogic/contentpump/LocalJobRunner.java:218` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:605 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:605-616 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:691-702 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:461-472 — 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 `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:605` it begins part-way through the construct above it, so those exact lines 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) src/main/java/com/marklogic/contentpump/InputType.java:306 — src/main/java/com/marklogic/contentpump/InputType.java:306-317 | src/main/java/com/marklogic/contentpump/RDFReader.java:603-614 | src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java:110-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/InputType.java:306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:81 — src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:81-92 | src/main/java/com/marklogic/mapreduce/examples/LinkCountCooccurrences.java:91-102 | src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java:82-93 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/examples/LinkCount.java` and `src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:182 — src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:182-193 | src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:305-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:182` it does not close everything it opens, so those exact lines 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) src/main/java/com/marklogic/contentpump/ThreadManager.java:304 — src/main/java/com/marklogic/contentpump/ThreadManager.java:304-315 | src/main/java/com/marklogic/contentpump/ThreadManager.java:421-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/ThreadManager.java:304` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:658 — src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:658-669 | src/main/java/com/marklogic/mapreduce/MarkLogicOutputFormat.java:188-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:658` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:95 — src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:95-104 | src/main/java/com/marklogic/contentpump/CompressedDelimitedTextReader.java:77-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `ZipInputStream` names `com.marklogic.contentpump.utilities.ZipInputStream` in one and `java.util.zip.ZipInputStream` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10–11 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:410 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:410-420 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:646-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:410` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:165 — src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:165-175 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:206-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×3
  • Duplicated block (8 lines × 3) src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:168 — src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:168-175 | src/main/java/com/marklogic/contentpump/RDFWritable.java:145-152 | src/main/java/com/marklogic/contentpump/examples/SimpleSequenceFileValue.java:75-82 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java` and `src/main/java/com/marklogic/contentpump/RDFWritable.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:167` calls `writeString` and `src/main/java/com/marklogic/contentpump/examples/SimpleSequenceFileValue.java:74` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) src/main/java/com/marklogic/contentpump/RDFReader.java:678 — src/main/java/com/marklogic/contentpump/RDFReader.java:678-685 | src/main/java/com/marklogic/contentpump/RDFReader.java:727-734 | src/main/java/com/marklogic/contentpump/RDFReader.java:767-774 — 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 `src/main/java/com/marklogic/contentpump/RDFReader.java:678` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/RDFReader.java:677` calls `write` and `src/main/java/com/marklogic/contentpump/RDFReader.java:726` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) src/main/java/com/marklogic/contentpump/DatabaseContentOutputFormat.java:40 — src/main/java/com/marklogic/contentpump/DatabaseContentOutputFormat.java:40-47 | src/main/java/com/marklogic/contentpump/DatabaseTransformOutputFormat.java:39-46 | src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:352-360 — 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 `src/main/java/com/marklogic/contentpump/DatabaseContentOutputFormat.java:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:108 — src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:108-131 | src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:75-88 | src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:68-91 | src/main/java/com/marklogic/contentpump/CompressedDelimitedTextReader.java:60-74 | src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:90-102 | src/main/java/com/marklogic/contentpump/RDFReader.java:209-282 | src/main/java/com/marklogic/contentpump/SequenceFileReader.java:63-78 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:159 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:159-356 | src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:360-457 | src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:57-201 | src/main/java/com/marklogic/contentpump/TransformWriter.java:205-307 | src/main/java/com/marklogic/contentpump/TransformWriter.java:649-739 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:618-737 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:802-887 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:109 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:109-139 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:225-253 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) src/main/java/com/marklogic/contentpump/RDFReader.java:821 — src/main/java/com/marklogic/contentpump/RDFReader.java:821-849 | src/main/java/com/marklogic/contentpump/RDFReader.java:859-887 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) src/main/java/com/marklogic/mapreduce/NodeOpType.java:70 — src/main/java/com/marklogic/mapreduce/NodeOpType.java:70-89 | src/main/java/com/marklogic/mapreduce/PropertyOpType.java:59-88 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:142 — src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:142-163 | src/main/java/com/marklogic/contentpump/examples/SimpleSequenceFileValue.java:52-71 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×2
  • Edited copy of a member (10 corresponding lines) src/main/java/com/marklogic/io/BiendianDataInputStream.java:133 — src/main/java/com/marklogic/io/BiendianDataInputStream.java:133-142 | src/main/java/com/marklogic/io/BiendianDataInputStream.java:144-155 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:166 — src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:166-176 | src/main/java/com/marklogic/contentpump/examples/SimpleSequenceFileValue.java:74-83 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×2
  • Edited copy of a member (14 corresponding lines) REDACTED:126 — REDACTED:126-139 | REDACTED:460-473 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:102 — src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:102-116 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:96-109 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) src/main/java/com/marklogic/contentpump/ImportRecordReader.java:117 — src/main/java/com/marklogic/contentpump/ImportRecordReader.java:117-132 | src/main/java/com/marklogic/mapreduce/ForestReader.java:229-247 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:167 — src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:167-182 | src/main/java/com/marklogic/mapreduce/utilities/URIUtil.java:86-101 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×2
  • Edited copy of a member (12 corresponding lines) src/main/java/com/marklogic/contentpump/utilities/FileIterator.java:52 — src/main/java/com/marklogic/contentpump/utilities/FileIterator.java:52-63 | src/main/java/com/marklogic/contentpump/utilities/FileIterator.java:65-78 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/main/java/com/marklogic/mapreduce/DOMDocument.java:175 — src/main/java/com/marklogic/mapreduce/DOMDocument.java:175-186 | src/main/java/com/marklogic/mapreduce/JSONDocument.java:110-123 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×2
  • Edited copy of a member (9 corresponding lines) REDACTED:314 — REDACTED:314-322 | REDACTED:325-333 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/main/java/com/marklogic/mapreduce/MarkLogicNode.java:65 — src/main/java/com/marklogic/mapreduce/MarkLogicNode.java:65-73 | src/main/java/com/marklogic/mapreduce/examples/LinkCountHDFS.java:135-143 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×2
  • Edited copy of a member (7 corresponding lines) src/main/java/com/marklogic/mapreduce/examples/BinaryReader.java:48 — src/main/java/com/marklogic/mapreduce/examples/BinaryReader.java:48-55 | REDACTED:62-68 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/main/java/com/marklogic/contentpump/utilities/XMLUtil.java:51 — src/main/java/com/marklogic/contentpump/utilities/XMLUtil.java:51-57 | src/main/java/com/marklogic/mapreduce/NodePath.java:80-87 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:309 — src/main/java/com/marklogic/contentpump/Command.java:309-328 | src/main/java/com/marklogic/contentpump/Command.java:1861-1879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–20 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:203 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:203-222 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:361-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:81 — src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:81-98 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:74-92 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java` and `src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18–19 lines × 2) src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java:81 — src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java:81-98 | src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java:82-100 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java` and `src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) src/main/java/com/marklogic/contentpump/CompressedDelimitedTextReader.java:97 — src/main/java/com/marklogic/contentpump/CompressedDelimitedTextReader.java:97-105 | src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:114-122 | src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:163-171 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DelimitedTextReader.java` and `src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) src/main/java/com/marklogic/contentpump/RDFReader.java:681 — src/main/java/com/marklogic/contentpump/RDFReader.java:681-689 | src/main/java/com/marklogic/contentpump/RDFReader.java:829-837 | src/main/java/com/marklogic/contentpump/RDFReader.java:867-875 — 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 `src/main/java/com/marklogic/contentpump/RDFReader.java:681` it begins part-way through the construct above it, so those 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 × 4) · ×2
  • Duplicated block (8 lines × 4) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:299 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:299-307 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:602-609 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:671-678 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:688-695 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:610` calls `init` and `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:308` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 4) src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:60 — src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:60-67 | src/main/java/com/marklogic/mapreduce/examples/LinkCountCooccurrences.java:69-76 | src/main/java/com/marklogic/mapreduce/examples/LinkCountHDFS.java:74-81 | src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java:61-68 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/examples/LinkCount.java` and `src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:119 — src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:119-123 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:112-116 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java` and `src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) src/main/java/com/marklogic/dom/AttrImpl.java:69 — src/main/java/com/marklogic/dom/AttrImpl.java:69-73 | src/main/java/com/marklogic/dom/ElementImpl.java:224-228 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) src/main/java/com/marklogic/mapreduce/test/BinaryLoader.java:122 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/main/java/com/marklogic/mapreduce/examples/ContentLoader.java:138 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D1 · Cyclomatic Complexity · CompressedTreeDecoder.decode (cyclomatic 99) · ×1
  • CompressedTreeDecoder.decode (cyclomatic 99) src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:114 — CompressedTreeDecoder.decode has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 1.applyConfigOptions (cyclomatic 96) · ×1
  • 1.applyConfigOptions (cyclomatic 96) src/main/java/com/marklogic/contentpump/Command.java:469 — 1.applyConfigOptions has cyclomatic complexity 96 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · 3.applyConfigOptions (cyclomatic 58) · ×1
  • 3.applyConfigOptions (cyclomatic 58) src/main/java/com/marklogic/contentpump/Command.java:1533 — 3.applyConfigOptions has cyclomatic complexity 58 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MarkLogicInputFormat.getSplits (cyclomatic 55) · ×1
  • MarkLogicInputFormat.getSplits (cyclomatic 55) src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:293 — MarkLogicInputFormat.getSplits has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseContentWriter.write (cyclomatic 52) · ×1
  • DatabaseContentWriter.write (cyclomatic 52) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:158 — DatabaseContentWriter.write has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformWriter.addValue (cyclomatic 46) · ×1
  • TransformWriter.addValue (cyclomatic 46) src/main/java/com/marklogic/contentpump/TransformWriter.java:351 — TransformWriter.addValue has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AggregateXMLReader.processStartElement (cyclomatic 44) · ×1
  • AggregateXMLReader.processStartElement (cyclomatic 44) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:228 — AggregateXMLReader.processStartElement has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseTransformWriter.write (cyclomatic 44) · ×1
  • DatabaseTransformWriter.write (cyclomatic 44) src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:56 — DatabaseTransformWriter.write has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpandedTree.write (cyclomatic 38) · ×1
  • ExpandedTree.write (cyclomatic 38) src/main/java/com/marklogic/tree/ExpandedTree.java:452 — ExpandedTree.write has cyclomatic complexity 38 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · ContentPump.runCommand (cyclomatic 36) · ×1
  • ContentPump.runCommand (cyclomatic 36) src/main/java/com/marklogic/contentpump/ContentPump.java:84 — ContentPump.runCommand has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkLogicRecordReader.init (cyclomatic 36) · ×1
  • MarkLogicRecordReader.init (cyclomatic 36) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:256 — MarkLogicRecordReader.init has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 2.applyConfigOptions (cyclomatic 34) · ×1
  • 2.applyConfigOptions (cyclomatic 34) src/main/java/com/marklogic/contentpump/Command.java:1075 — 2.applyConfigOptions has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DatabaseContentReader.nextKeyValue (cyclomatic 34) · ×1
  • DatabaseContentReader.nextKeyValue (cyclomatic 34) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:552 — DatabaseContentReader.nextKeyValue has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DelimitedTextReader.nextKeyValue (cyclomatic 34) · ×1
  • DelimitedTextReader.nextKeyValue (cyclomatic 34) src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:167 — DelimitedTextReader.nextKeyValue has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentOutputFormat.initialize (cyclomatic 33) · ×1
  • ContentOutputFormat.initialize (cyclomatic 33) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:393 — ContentOutputFormat.initialize has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentWriter.<init> (cyclomatic 32) · ×1
  • ContentWriter.<init> (cyclomatic 32) src/main/java/com/marklogic/mapreduce/ContentWriter.java:202 — ContentWriter.<init> has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForestInputFormat.getSplits (cyclomatic 32) · ×1
  • ForestInputFormat.getSplits (cyclomatic 32) src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:98 — ForestInputFormat.getSplits has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkLogicInputFormat.getForestSplits (cyclomatic 31) · ×1
  • MarkLogicInputFormat.getForestSplits (cyclomatic 31) src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:161 — MarkLogicInputFormat.getForestSplits has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentWriter.write (cyclomatic 30) · ×1
  • ContentWriter.write (cyclomatic 30) src/main/java/com/marklogic/mapreduce/ContentWriter.java:617 — ContentWriter.write has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpandedTree.readFields (cyclomatic 29) · ×1
  • ExpandedTree.readFields (cyclomatic 29) src/main/java/com/marklogic/tree/ExpandedTree.java:295 — ExpandedTree.readFields has cyclomatic complexity 29 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · FCheck.decodeTreeData (cyclomatic 28) · ×1
  • FCheck.decodeTreeData (cyclomatic 28) src/main/java/com/marklogic/mapreduce/test/FCheck.java:494 — FCheck.decodeTreeData has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseContentReader.init (cyclomatic 27) · ×1
  • DatabaseContentReader.init (cyclomatic 27) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:142 — DatabaseContentReader.init has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseContentReader.parseMetadata (cyclomatic 27) · ×1
  • DatabaseContentReader.parseMetadata (cyclomatic 27) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:440 — DatabaseContentReader.parseMetadata has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentOutputFormat.queryForestInfo (cyclomatic 27) · ×1
  • ContentOutputFormat.queryForestInfo (cyclomatic 27) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:541 — ContentOutputFormat.queryForestInfo has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseContentWriter.close (cyclomatic 26) · ×1
  • DatabaseContentWriter.close (cyclomatic 26) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:359 — DatabaseContentWriter.close has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InternalUtilities.assignResultValue (cyclomatic 26) · ×1
  • InternalUtilities.assignResultValue (cyclomatic 26) REDACTED:386 — InternalUtilities.assignResultValue has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ContentOutputFormat.checkOutputSpecs (cyclomatic 26) · ×1
  • ContentOutputFormat.checkOutputSpecs (cyclomatic 26) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:156 — ContentOutputFormat.checkOutputSpecs has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentWriter.insertBatch (cyclomatic 26) · ×1
  • ContentWriter.insertBatch (cyclomatic 26) src/main/java/com/marklogic/mapreduce/ContentWriter.java:482 — ContentWriter.insertBatch has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompressedTreeDecoder.assignOrdinals (cyclomatic 25) · ×1
  • CompressedTreeDecoder.assignOrdinals (cyclomatic 25) src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:755 — CompressedTreeDecoder.assignOrdinals has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AggregateXMLReader.nextKeyValue (cyclomatic 24) · ×1
  • AggregateXMLReader.nextKeyValue (cyclomatic 24) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:469 — AggregateXMLReader.nextKeyValue has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArchiveWriter.write (cyclomatic 24) · ×1
  • ArchiveWriter.write (cyclomatic 24) src/main/java/com/marklogic/contentpump/ArchiveWriter.java:97 — ArchiveWriter.write has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformWriter.write (cyclomatic 23) · ×1
  • TransformWriter.write (cyclomatic 23) src/main/java/com/marklogic/contentpump/TransformWriter.java:204 — TransformWriter.write has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentWriter.close (cyclomatic 22) · ×1
  • ContentWriter.close (cyclomatic 22) src/main/java/com/marklogic/mapreduce/ContentWriter.java:801 — ContentWriter.close has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForestReader.applyFilter (cyclomatic 22) · ×1
  • ForestReader.applyFilter (cyclomatic 22) src/main/java/com/marklogic/mapreduce/ForestReader.java:249 — ForestReader.applyFilter has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ThreadPoller.run (cyclomatic 21) · ×1
  • ThreadPoller.run (cyclomatic 21) src/main/java/com/marklogic/contentpump/ThreadManager.java:566 — ThreadPoller.run has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentWriter.createContent (cyclomatic 21) · ×1
  • ContentWriter.createContent (cyclomatic 21) src/main/java/com/marklogic/mapreduce/ContentWriter.java:381 — ContentWriter.createContent has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForestReader.getNextTree (cyclomatic 21) · ×1
  • ForestReader.getNextTree (cyclomatic 21) src/main/java/com/marklogic/mapreduce/ForestReader.java:304 — ForestReader.getNextTree has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformWriter.insertBatch (cyclomatic 20) · ×1
  • TransformWriter.insertBatch (cyclomatic 20) src/main/java/com/marklogic/contentpump/TransformWriter.java:561 — TransformWriter.insertBatch has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LocalJobRunner.run (cyclomatic 19) · ×1
  • LocalJobRunner.run (cyclomatic 19) src/main/java/com/marklogic/contentpump/LocalJobRunner.java:92 — LocalJobRunner.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SplitDelimitedTextReader.nextKeyValue (cyclomatic 19) · ×1
  • SplitDelimitedTextReader.nextKeyValue (cyclomatic 19) src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:67 — SplitDelimitedTextReader.nextKeyValue has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FCheck.checkTreeIndex (cyclomatic 19) · ×1
  • FCheck.checkTreeIndex (cyclomatic 19) src/main/java/com/marklogic/mapreduce/test/FCheck.java:612 — FCheck.checkTreeIndex has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AggregateXMLReader.processEndElement (cyclomatic 18) · ×1
  • AggregateXMLReader.processEndElement (cyclomatic 18) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:397 — AggregateXMLReader.processEndElement has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Command.applyFilteringConfigOptions (cyclomatic 18) · ×1
  • Command.applyFilteringConfigOptions (cyclomatic 18) src/main/java/com/marklogic/contentpump/Command.java:2557 — Command.applyFilteringConfigOptions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 1.applyUriId (cyclomatic 18) · ×1
  • 1.applyUriId (cyclomatic 18) src/main/java/com/marklogic/contentpump/Command.java:409 — 1.applyUriId has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SingleDocumentWriter.write (cyclomatic 18) · ×1
  • SingleDocumentWriter.write (cyclomatic 18) src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:74 — SingleDocumentWriter.write has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformWriter.close (cyclomatic 18) · ×1
  • TransformWriter.close (cyclomatic 18) src/main/java/com/marklogic/contentpump/TransformWriter.java:648 — TransformWriter.close has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 2.init (cyclomatic 18) · ×1
  • 2.init (cyclomatic 18) src/main/java/com/marklogic/dom/NodeImpl.java:469 — 2.init has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompressedAggXMLReader.nextKeyValue (cyclomatic 17) · ×1
  • CompressedAggXMLReader.nextKeyValue (cyclomatic 17) src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:159 — CompressedAggXMLReader.nextKeyValue has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileAndDirectoryInputFormat.getSplits (cyclomatic 17) · ×1
  • FileAndDirectoryInputFormat.getSplits (cyclomatic 17) src/main/java/com/marklogic/contentpump/FileAndDirectoryInputFormat.java:72 — FileAndDirectoryInputFormat.getSplits has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 6.applyConfigOptions (cyclomatic 17) · ×1
  • 6.applyConfigOptions (cyclomatic 17) src/main/java/com/marklogic/contentpump/InputType.java:244 — 6.applyConfigOptions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeImpl.isEqualNode (cyclomatic 17) · ×1
  • NodeImpl.isEqualNode (cyclomatic 17) src/main/java/com/marklogic/dom/NodeImpl.java:312 — NodeImpl.isEqualNode has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseContentWriter.newContentCreateOptions (cyclomatic 16) · ×1
  • DatabaseContentWriter.newContentCreateOptions (cyclomatic 16) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:95 — DatabaseContentWriter.newContentCreateOptions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RDFReader.writeValue (cyclomatic 16) · ×1
  • RDFReader.writeValue (cyclomatic 16) src/main/java/com/marklogic/contentpump/RDFReader.java:974 — RDFReader.writeValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeImpl.builtinNSPrefix (cyclomatic 16) · ×1
  • NodeImpl.builtinNSPrefix (cyclomatic 16) src/main/java/com/marklogic/dom/NodeImpl.java:518 — NodeImpl.builtinNSPrefix has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D17 · Explicit Debt · HackComment · ×1
  • HackComment src/main/java/com/marklogic/contentpump/RDFReader.java:943 — // HACK: fix this! — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · CompressedTreeDecoder.decode (cognitive 166) · ×1
  • CompressedTreeDecoder.decode (cognitive 166) src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:114 — CompressedTreeDecoder.decode has cognitive complexity 166 (threshold 15). Drivers by points: if/else 66 (121 pts), loops 13 (26 pts), match/switch 4 (12 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 1.applyConfigOptions (cognitive 137) · ×1
  • 1.applyConfigOptions (cognitive 137) src/main/java/com/marklogic/contentpump/Command.java:469 — 1.applyConfigOptions has cognitive complexity 137 (threshold 15). Drivers by points: if/else 102 (131 pts), boolean chains 6 (nesting depth added 29). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DatabaseContentWriter.write (cognitive 124) · ×1
  • DatabaseContentWriter.write (cognitive 124) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:158 — DatabaseContentWriter.write has cognitive complexity 124 (threshold 15). Drivers by points: if/else 35 (81 pts), boolean chains 12, loops 3 (12 pts), error handling 4 (11 pts), ternaries 4 (8 pts) (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DatabaseContentReader.nextKeyValue (cognitive 117) · ×1
  • DatabaseContentReader.nextKeyValue (cognitive 117) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:552 — DatabaseContentReader.nextKeyValue has cognitive complexity 117 (threshold 15). Drivers by points: if/else 23 (73 pts), error handling 6 (27 pts), loops 4 (12 pts), boolean chains 5 (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkLogicInputFormat.getSplits (cognitive 113) · ×1
  • MarkLogicInputFormat.getSplits (cognitive 113) src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:293 — MarkLogicInputFormat.getSplits has cognitive complexity 113 (threshold 15). Drivers by points: if/else 37 (79 pts), loops 9 (18 pts), boolean chains 9, error handling 3 (6 pts), ternaries 1 (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DatabaseTransformWriter.write (cognitive 100) · ×1
  • DatabaseTransformWriter.write (cognitive 100) src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:56 — DatabaseTransformWriter.write has cognitive complexity 100 (threshold 15). Drivers by points: if/else 23 (57 pts), boolean chains 13, error handling 3 (11 pts), ternaries 5 (10 pts), loops 2 (9 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DatabaseContentWriter.close (cognitive 96) · ×1
  • DatabaseContentWriter.close (cognitive 96) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:359 — DatabaseContentWriter.close has cognitive complexity 96 (threshold 15). Drivers by points: if/else 15 (59 pts), loops 4 (19 pts), error handling 2 (11 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 70). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MarkLogicRecordReader.init (cognitive 87) · ×1
  • MarkLogicRecordReader.init (cognitive 87) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:256 — MarkLogicRecordReader.init has cognitive complexity 87 (threshold 15). Drivers by points: if/else 29 (61 pts), error handling 4 (11 pts), ternaries 4 (11 pts), boolean chains 3, loops 1 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MarkLogicInputFormat.getForestSplits (cognitive 78) · ×1
  • MarkLogicInputFormat.getForestSplits (cognitive 78) src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java:161 — MarkLogicInputFormat.getForestSplits has cognitive complexity 78 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 6 (13 pts), boolean chains 2, ternaries 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AggregateXMLReader.processStartElement (cognitive 77) · ×1
  • AggregateXMLReader.processStartElement (cognitive 77) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:228 — AggregateXMLReader.processStartElement has cognitive complexity 77 (threshold 15). Drivers by points: if/else 32 (56 pts), boolean chains 11, loops 4 (8 pts), ternaries 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformWriter.addValue (cognitive 76) · ×1
  • TransformWriter.addValue (cognitive 76) src/main/java/com/marklogic/contentpump/TransformWriter.java:351 — TransformWriter.addValue has cognitive complexity 76 (threshold 15). Drivers by points: if/else 37 (66 pts), loops 2 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWriter.close (cognitive 74) · ×1
  • ContentWriter.close (cognitive 74) src/main/java/com/marklogic/mapreduce/ContentWriter.java:801 — ContentWriter.close has cognitive complexity 74 (threshold 15). Drivers by points: if/else 13 (44 pts), loops 3 (13 pts), error handling 2 (11 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ContentWriter.write (cognitive 73) · ×1
  • ContentWriter.write (cognitive 73) src/main/java/com/marklogic/mapreduce/ContentWriter.java:617 — ContentWriter.write has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 4 (13 pts), error handling 2 (7 pts), boolean chains 5 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWriter.insertBatch (cognitive 70) · ×1
  • ContentWriter.insertBatch (cognitive 70) src/main/java/com/marklogic/mapreduce/ContentWriter.java:482 — ContentWriter.insertBatch has cognitive complexity 70 (threshold 15). Drivers by points: if/else 22 (57 pts), loops 4 (9 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 3.applyConfigOptions (cognitive 67) · ×1
  • 3.applyConfigOptions (cognitive 67) src/main/java/com/marklogic/contentpump/Command.java:1533 — 3.applyConfigOptions has cognitive complexity 67 (threshold 15). Drivers by points: if/else 57 (65 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ContentOutputFormat.queryForestInfo (cognitive 62) · ×1
  • ContentOutputFormat.queryForestInfo (cognitive 62) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:541 — ContentOutputFormat.queryForestInfo has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (51 pts), boolean chains 5, loops 2 (5 pts), error handling 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExpandedTree.write (cognitive 59) · ×1
  • ExpandedTree.write (cognitive 59) src/main/java/com/marklogic/tree/ExpandedTree.java:452 — ExpandedTree.write has cognitive complexity 59 (threshold 15). Drivers by points: loops 14 (28 pts), if/else 22, boolean chains 9 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · TransformWriter.write (cognitive 58) · ×1
  • TransformWriter.write (cognitive 58) src/main/java/com/marklogic/contentpump/TransformWriter.java:204 — TransformWriter.write has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (40 pts), error handling 2 (7 pts), loops 2 (7 pts), boolean chains 4 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseContentReader.init (cognitive 57) · ×1
  • DatabaseContentReader.init (cognitive 57) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:142 — DatabaseContentReader.init has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (42 pts), error handling 4 (11 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForestInputFormat.getSplits (cognitive 57) · ×1
  • ForestInputFormat.getSplits (cognitive 57) src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:98 — ForestInputFormat.getSplits has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (45 pts), loops 3 (5 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelimitedTextReader.nextKeyValue (cognitive 55) · ×1
  • DelimitedTextReader.nextKeyValue (cognitive 55) src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:167 — DelimitedTextReader.nextKeyValue has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 8, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformWriter.close (cognitive 54) · ×1
  • TransformWriter.close (cognitive 54) src/main/java/com/marklogic/contentpump/TransformWriter.java:648 — TransformWriter.close has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 3 (10 pts), error handling 2 (9 pts), boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentOutputFormat.initialize (cognitive 53) · ×1
  • ContentOutputFormat.initialize (cognitive 53) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:393 — ContentOutputFormat.initialize has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 10 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentOutputFormat.checkOutputSpecs (cognitive 52) · ×1
  • ContentOutputFormat.checkOutputSpecs (cognitive 52) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:156 — ContentOutputFormat.checkOutputSpecs has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentPump.runCommand (cognitive 51) · ×1
  • ContentPump.runCommand (cognitive 51) src/main/java/com/marklogic/contentpump/ContentPump.java:84 — ContentPump.runCommand has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 8, error handling 5 (7 pts), loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FCheck.decodeTreeData (cognitive 51) · ×1
  • FCheck.decodeTreeData (cognitive 51) src/main/java/com/marklogic/mapreduce/test/FCheck.java:494 — FCheck.decodeTreeData has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 5 (12 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWriter.<init> (cognitive 50) · ×1
  • ContentWriter.<init> (cognitive 50) src/main/java/com/marklogic/mapreduce/ContentWriter.java:202 — ContentWriter.<init> has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (34 pts), loops 6 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArchiveWriter.write (cognitive 47) · ×1
  • ArchiveWriter.write (cognitive 47) src/main/java/com/marklogic/contentpump/ArchiveWriter.java:97 — ArchiveWriter.write has cognitive complexity 47 (threshold 15). Drivers by points: if/else 28 (46 pts), ternaries 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseContentWriter.newContentCreateOptions (cognitive 44) · ×1
  • DatabaseContentWriter.newContentCreateOptions (cognitive 44) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:95 — DatabaseContentWriter.newContentCreateOptions has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 3 (12 pts), boolean chains 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TransformWriter.insertBatch (cognitive 44) · ×1
  • TransformWriter.insertBatch (cognitive 44) src/main/java/com/marklogic/contentpump/TransformWriter.java:561 — TransformWriter.insertBatch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedTreeDecoder.assignOrdinals (cognitive 44) · ×1
  • CompressedTreeDecoder.assignOrdinals (cognitive 44) src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:755 — CompressedTreeDecoder.assignOrdinals has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 6 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseContentReader.parseMetadata (cognitive 42) · ×1
  • DatabaseContentReader.parseMetadata (cognitive 42) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:440 — DatabaseContentReader.parseMetadata has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalJobRunner.run (cognitive 42) · ×1
  • LocalJobRunner.run (cognitive 42) src/main/java/com/marklogic/contentpump/LocalJobRunner.java:92 — LocalJobRunner.run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (25 pts), error handling 5 (11 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SingleDocumentWriter.write (cognitive 42) · ×1
  • SingleDocumentWriter.write (cognitive 42) src/main/java/com/marklogic/contentpump/SingleDocumentWriter.java:74 — SingleDocumentWriter.write has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpandedTree.readFields (cognitive 42) · ×1
  • ExpandedTree.readFields (cognitive 42) src/main/java/com/marklogic/tree/ExpandedTree.java:295 — ExpandedTree.readFields has cognitive complexity 42 (threshold 15). Drivers by points: loops 14 (28 pts), if/else 14 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ThreadPoller.run (cognitive 41) · ×1
  • ThreadPoller.run (cognitive 41) src/main/java/com/marklogic/contentpump/ThreadManager.java:566 — ThreadPoller.run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (33 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 2.applyConfigOptions (cognitive 40) · ×1
  • 2.applyConfigOptions (cognitive 40) src/main/java/com/marklogic/contentpump/Command.java:1075 — 2.applyConfigOptions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 34 (40 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ContentOutputFormat.getSourceMap (cognitive 40) · ×1
  • ContentOutputFormat.getSourceMap (cognitive 40) src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:287 — ContentOutputFormat.getSourceMap has cognitive complexity 40 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (10 pts), error handling 2 (8 pts), ternaries 1 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionsFileUtil.expandArguments (cognitive 39) · ×1
  • OptionsFileUtil.expandArguments (cognitive 39) src/main/java/com/marklogic/contentpump/utilities/OptionsFileUtil.java:53 — OptionsFileUtil.expandArguments has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 2 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Command.applyFilteringConfigOptions (cognitive 36) · ×1
  • Command.applyFilteringConfigOptions (cognitive 36) src/main/java/com/marklogic/contentpump/Command.java:2557 — Command.applyFilteringConfigOptions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 2 (6 pts), ternaries 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InternalUtilities.getInputSslOptions (cognitive 35) · ×1
  • InternalUtilities.getInputSslOptions (cognitive 35) REDACTED:141 — InternalUtilities.getInputSslOptions has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), error handling 2 (10 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (InternalUtilities.getOutputSslOptions) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · InternalUtilities.getOutputSslOptions (cognitive 35) · ×1
  • InternalUtilities.getOutputSslOptions (cognitive 35) REDACTED:200 — InternalUtilities.getOutputSslOptions has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), error handling 2 (10 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (InternalUtilities.getInputSslOptions) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · RDFReader.writeValue (cognitive 33) · ×1
  • RDFReader.writeValue (cognitive 33) src/main/java/com/marklogic/contentpump/RDFReader.java:974 — RDFReader.writeValue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForestReader.applyFilter (cognitive 33) · ×1
  • ForestReader.applyFilter (cognitive 33) src/main/java/com/marklogic/mapreduce/ForestReader.java:249 — ForestReader.applyFilter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelimitedJSONReader.findUriInJSON (cognitive 32) · ×1
  • DelimitedJSONReader.findUriInJSON (cognitive 32) src/main/java/com/marklogic/contentpump/DelimitedJSONReader.java:191 — DelimitedJSONReader.findUriInJSON has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 6.applyConfigOptions (cognitive 32) · ×1
  • 6.applyConfigOptions (cognitive 32) src/main/java/com/marklogic/contentpump/InputType.java:244 — 6.applyConfigOptions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 3 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadManager.scaleOutThreadPool (cognitive 32) · ×1
  • ThreadManager.scaleOutThreadPool (cognitive 32) src/main/java/com/marklogic/contentpump/ThreadManager.java:248 — ThreadManager.scaleOutThreadPool has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 2.init (cognitive 32) · ×1
  • 2.init (cognitive 32) src/main/java/com/marklogic/dom/NodeImpl.java:469 — 2.init has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWriter.createContent (cognitive 32) · ×1
  • ContentWriter.createContent (cognitive 32) src/main/java/com/marklogic/mapreduce/ContentWriter.java:381 — ContentWriter.createContent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (29 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileAndDirectoryInputFormat.getSplits (cognitive 31) · ×1
  • FileAndDirectoryInputFormat.getSplits (cognitive 31) src/main/java/com/marklogic/contentpump/FileAndDirectoryInputFormat.java:72 — FileAndDirectoryInputFormat.getSplits has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (9 pts), boolean chains 3, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedAggXMLReader.nextKeyValue (cognitive 29) · ×1
  • CompressedAggXMLReader.nextKeyValue (cognitive 29) src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:159 — CompressedAggXMLReader.nextKeyValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileAndDirectoryInputFormat.simpleListStatus (cognitive 29) · ×1
  • FileAndDirectoryInputFormat.simpleListStatus (cognitive 29) src/main/java/com/marklogic/contentpump/FileAndDirectoryInputFormat.java:221 — FileAndDirectoryInputFormat.simpleListStatus has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (9 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SplitDelimitedTextReader.nextKeyValue (cognitive 29) · ×1
  • SplitDelimitedTextReader.nextKeyValue (cognitive 29) src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:67 — SplitDelimitedTextReader.nextKeyValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeImpl.compareDocumentPosition (cognitive 29) · ×1
  • NodeImpl.compareDocumentPosition (cognitive 29) src/main/java/com/marklogic/dom/NodeImpl.java:107 — NodeImpl.compareDocumentPosition has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ForestReader.getNextTree (cognitive 29) · ×1
  • ForestReader.getNextTree (cognitive 29) src/main/java/com/marklogic/mapreduce/ForestReader.java:304 — ForestReader.getNextTree has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, ternaries 1 (3 pts), error handling 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelimitedJSONReader.nextKeyValue (cognitive 28) · ×1
  • DelimitedJSONReader.nextKeyValue (cognitive 28) src/main/java/com/marklogic/contentpump/DelimitedJSONReader.java:137 — DelimitedJSONReader.nextKeyValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultithreadedMapper.run (cognitive 27) · ×1
  • MultithreadedMapper.run (cognitive 27) src/main/java/com/marklogic/contentpump/MultithreadedMapper.java:222 — MultithreadedMapper.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (11 pts), error handling 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Command.applyCopyConfigOptions (cognitive 26) · ×1
  • Command.applyCopyConfigOptions (cognitive 26) src/main/java/com/marklogic/contentpump/Command.java:2491 — Command.applyCopyConfigOptions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22 (26 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · 1.applyUriId (cognitive 26) · ×1
  • 1.applyUriId (cognitive 26) src/main/java/com/marklogic/contentpump/Command.java:409 — 1.applyUriId has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelimitedTextInputFormat.getSplits (cognitive 26) · ×1
  • DelimitedTextInputFormat.getSplits (cognitive 26) src/main/java/com/marklogic/contentpump/DelimitedTextInputFormat.java:75 — DelimitedTextInputFormat.getSplits has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (9 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadManager.assignIdleThreads (cognitive 26) · ×1
  • ThreadManager.assignIdleThreads (cognitive 26) src/main/java/com/marklogic/contentpump/ThreadManager.java:384 — ThreadManager.assignIdleThreads has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 2 (6 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadManager.scaleInThreadPool (cognitive 26) · ×1
  • ThreadManager.scaleInThreadPool (cognitive 26) src/main/java/com/marklogic/contentpump/ThreadManager.java:321 — ThreadManager.scaleInThreadPool has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InternalUtilities.assignResultValue (cognitive 26) · ×1
  • InternalUtilities.assignResultValue (cognitive 26) REDACTED:386 — InternalUtilities.assignResultValue has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, boolean chains 12. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ContentWriter.getSession (cognitive 26) · ×1
  • ContentWriter.getSession (cognitive 26) src/main/java/com/marklogic/mapreduce/ContentWriter.java:744 — ContentWriter.getSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FCheck.checkTreeIndex (cognitive 25) · ×1
  • FCheck.checkTreeIndex (cognitive 25) src/main/java/com/marklogic/mapreduce/test/FCheck.java:612 — FCheck.checkTreeIndex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeImpl.isEqualNode (cognitive 24) · ×1
  • NodeImpl.isEqualNode (cognitive 24) src/main/java/com/marklogic/dom/NodeImpl.java:312 — NodeImpl.isEqualNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AggregateXMLReader.nextKeyValue (cognitive 23) · ×1
  • AggregateXMLReader.nextKeyValue (cognitive 23) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:469 — AggregateXMLReader.nextKeyValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AggregateXMLReader.processEndElement (cognitive 23) · ×1
  • AggregateXMLReader.processEndElement (cognitive 23) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:397 — AggregateXMLReader.processEndElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ShutdownHook.run (cognitive 23) · ×1
  • ShutdownHook.run (cognitive 23) src/main/java/com/marklogic/contentpump/ContentPump.java:421 — ShutdownHook.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (5 pts), loops 4 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RDFWritable.getContent (cognitive 23) · ×1
  • RDFWritable.getContent (cognitive 23) src/main/java/com/marklogic/contentpump/RDFWritable.java:75 — RDFWritable.getContent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Command.applyCommonOutputConfigOptions (cognitive 22) · ×1
  • Command.applyCommonOutputConfigOptions (cognitive 22) src/main/java/com/marklogic/contentpump/Command.java:2697 — Command.applyCommonOutputConfigOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedAggXMLReader.initStreamReader (cognitive 22) · ×1
  • CompressedAggXMLReader.initStreamReader (cognitive 22) src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:93 — CompressedAggXMLReader.initStreamReader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3 (7 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedRDFReader.initStream (cognitive 22) · ×1
  • CompressedRDFReader.initStream (cognitive 22) src/main/java/com/marklogic/contentpump/CompressedRDFReader.java:64 — CompressedRDFReader.initStream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AttributeNodeMapImpl.item (cognitive 22) · ×1
  • AttributeNodeMapImpl.item (cognitive 22) src/main/java/com/marklogic/dom/AttributeNodeMapImpl.java:117 — AttributeNodeMapImpl.item has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileIterator.next (cognitive 21) · ×1
  • FileIterator.next (cognitive 21) src/main/java/com/marklogic/contentpump/utilities/FileIterator.java:86 — FileIterator.next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (8 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CombineDocumentInputFormat.getSplits (cognitive 21) · ×1
  • CombineDocumentInputFormat.getSplits (cognitive 21) src/main/java/com/marklogic/contentpump/CombineDocumentInputFormat.java:60 — CombineDocumentInputFormat.getSplits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedDelimitedTextReader.nextKeyValue (cognitive 21) · ×1
  • CompressedDelimitedTextReader.nextKeyValue (cognitive 21) src/main/java/com/marklogic/contentpump/CompressedDelimitedTextReader.java:109 — CompressedDelimitedTextReader.nextKeyValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedDocumentReader.nextKeyValue (cognitive 21) · ×1
  • CompressedDocumentReader.nextKeyValue (cognitive 21) src/main/java/com/marklogic/contentpump/CompressedDocumentReader.java:127 — CompressedDocumentReader.nextKeyValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompressedRDFReader.nextKeyValue (cognitive 21) · ×1
  • CompressedRDFReader.nextKeyValue (cognitive 21) src/main/java/com/marklogic/contentpump/CompressedRDFReader.java:143 — CompressedRDFReader.nextKeyValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformOutputFormat.getMimetypesMap (cognitive 21) · ×1
  • TransformOutputFormat.getMimetypesMap (cognitive 21) src/main/java/com/marklogic/contentpump/TransformOutputFormat.java:68 — TransformOutputFormat.getMimetypesMap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FCheck.checkTreeData (cognitive 20) · ×1
  • FCheck.checkTreeData (cognitive 20) src/main/java/com/marklogic/mapreduce/test/FCheck.java:431 — FCheck.checkTreeData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BucketAssignmentPolicy.initBucketsTable (cognitive 20) · ×1
  • BucketAssignmentPolicy.initBucketsTable (cognitive 20) src/main/java/com/marklogic/mapreduce/utilities/BucketAssignmentPolicy.java:47 — BucketAssignmentPolicy.initBucketsTable has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (9 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AuditUtil.auditMlcpFinish (cognitive 19) · ×1
  • AuditUtil.auditMlcpFinish (cognitive 19) src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:66 — AuditUtil.auditMlcpFinish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (5 pts), error handling 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RDFReader.initialize (cognitive 19) · ×1
  • RDFReader.initialize (cognitive 19) src/main/java/com/marklogic/contentpump/RDFReader.java:208 — RDFReader.initialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RDFReader.nextStreamingQuadKeyValueWithCollections (cognitive 19) · ×1
  • RDFReader.nextStreamingQuadKeyValueWithCollections (cognitive 19) src/main/java/com/marklogic/contentpump/RDFReader.java:889 — RDFReader.nextStreamingQuadKeyValueWithCollections has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkLogicRecordReader.nextKeyValue (cognitive 19) · ×1
  • MarkLogicRecordReader.nextKeyValue (cognitive 19) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:440 — MarkLogicRecordReader.nextKeyValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseContentReader.readPermission (cognitive 18) · ×1
  • DatabaseContentReader.readPermission (cognitive 18) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:714 — DatabaseContentReader.readPermission has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalMapTask.call (cognitive 18) · ×1
  • LocalMapTask.call (cognitive 18) src/main/java/com/marklogic/contentpump/LocalJobRunner.java:326 — LocalMapTask.call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 5 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RDFReader.initExistingMapPerms (cognitive 18) · ×1
  • RDFReader.initExistingMapPerms (cognitive 18) src/main/java/com/marklogic/contentpump/RDFReader.java:550 — RDFReader.initExistingMapPerms has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), error handling 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FCheck.checkListData (cognitive 18) · ×1
  • FCheck.checkListData (cognitive 18) src/main/java/com/marklogic/mapreduce/test/FCheck.java:202 — FCheck.checkListData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForestDocument.setContentOptions (cognitive 18) · ×1
  • ForestDocument.setContentOptions (cognitive 18) src/main/java/com/marklogic/mapreduce/ForestDocument.java:198 — ForestDocument.setContentOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpandedTree.putNode (cognitive 17) · ×1
  • ExpandedTree.putNode (cognitive 17) src/main/java/com/marklogic/tree/ExpandedTree.java:597 — ExpandedTree.putNode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CombineDocumentReader.nextKeyValue (cognitive 16) · ×1
  • CombineDocumentReader.nextKeyValue (cognitive 16) src/main/java/com/marklogic/contentpump/CombineDocumentReader.java:78 — CombineDocumentReader.nextKeyValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseContentReader.queryNakedProperties (cognitive 16) · ×1
  • DatabaseContentReader.queryNakedProperties (cognitive 16) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:318 — DatabaseContentReader.queryNakedProperties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RDFReader.initParser (cognitive 16) · ×1
  • RDFReader.initParser (cognitive 16) src/main/java/com/marklogic/contentpump/RDFReader.java:295 — RDFReader.initParser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SplitDelimitedTextReader.initParser (cognitive 16) · ×1
  • SplitDelimitedTextReader.initParser (cognitive 16) src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java:132 — SplitDelimitedTextReader.initParser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (38 shared lines) · ×1
  • Near-duplicate member pair (38 shared lines) src/main/java/com/marklogic/contentpump/Command.java:1012 — src/main/java/com/marklogic/contentpump/Command.java:1012-1072 | src/main/java/com/marklogic/contentpump/Command.java:1475-1530 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) src/main/java/com/marklogic/contentpump/ThreadManager.java:248 — src/main/java/com/marklogic/contentpump/ThreadManager.java:248-315 | src/main/java/com/marklogic/contentpump/ThreadManager.java:384-432 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) src/main/java/com/marklogic/mapreduce/examples/BinaryReader.java:58 — src/main/java/com/marklogic/mapreduce/examples/BinaryReader.java:58-81 | src/main/java/com/marklogic/mapreduce/examples/ContentLoader.java:56-78 | REDACTED:71-95 | src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:70-97 | src/main/java/com/marklogic/mapreduce/examples/LinkCountCooccurrences.java:79-111 | src/main/java/com/marklogic/mapreduce/examples/LinkCountHDFS.java:84-107 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:126-149 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:119-144 | src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java:71-98 | src/main/java/com/marklogic/mapreduce/examples/RevisionGrouper.java:57-78 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) src/main/java/com/marklogic/mapreduce/functions/ElementValueMatch.java:58 — src/main/java/com/marklogic/mapreduce/functions/ElementValueMatch.java:58-68 | src/main/java/com/marklogic/mapreduce/functions/ElementValues.java:58-68 | src/main/java/com/marklogic/mapreduce/functions/ElementWordMatch.java:58-68 | src/main/java/com/marklogic/mapreduce/functions/ElementWords.java:58-68 | src/main/java/com/marklogic/mapreduce/functions/FieldValueMatch.java:55-65 | src/main/java/com/marklogic/mapreduce/functions/FieldValues.java:55-65 | src/main/java/com/marklogic/mapreduce/functions/FieldWordMatch.java:55-65 | src/main/java/com/marklogic/mapreduce/functions/FieldWords.java:57-67 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:135 — src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:135-144 | src/main/java/com/marklogic/mapreduce/NodeWriter.java:48-68 | src/main/java/com/marklogic/mapreduce/functions/CooccurrencesFunction.java:40-79 | src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java:56-98 | src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java:57-100 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValueMatch.java:69 — src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValueMatch.java:69-89 | src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValues.java:68-88 | src/main/java/com/marklogic/mapreduce/functions/ElementAttributeWordMatch.java:69-89 | src/main/java/com/marklogic/mapreduce/functions/ElementAttributeWords.java:70-90 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) REDACTED:141 — REDACTED:141-198 | REDACTED:200-257 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) src/main/java/com/marklogic/contentpump/RDFReader.java:707 — src/main/java/com/marklogic/contentpump/RDFReader.java:707-746 | src/main/java/com/marklogic/contentpump/RDFReader.java:748-796 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) src/main/java/com/marklogic/io/Decoder.java:237 — src/main/java/com/marklogic/io/Decoder.java:237-259 | src/main/java/com/marklogic/io/Decoder.java:263-285 | src/main/java/com/marklogic/io/Decoder.java:289-311 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) src/main/java/com/marklogic/contentpump/RDFReader.java:459 — src/main/java/com/marklogic/contentpump/RDFReader.java:459-488 | src/main/java/com/marklogic/contentpump/RDFReader.java:490-520 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:155 — src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:155-179 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:192-221 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) src/main/java/com/marklogic/dom/AttrImpl.java:119 — src/main/java/com/marklogic/dom/AttrImpl.java:119-142 | src/main/java/com/marklogic/dom/ElementImpl.java:230-258 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) src/main/java/com/marklogic/mapreduce/examples/HelloWorld.java:128 — src/main/java/com/marklogic/mapreduce/examples/HelloWorld.java:128-151 | src/main/java/com/marklogic/mapreduce/examples/ZipContentLoader.java:58-80 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) src/main/java/com/marklogic/dom/ElementImpl.java:323 — src/main/java/com/marklogic/dom/ElementImpl.java:323-339 | src/main/java/com/marklogic/dom/ElementImpl.java:342-358 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) src/main/java/com/marklogic/io/BiendianDataInputStream.java:96 — src/main/java/com/marklogic/io/BiendianDataInputStream.java:96-107 | src/main/java/com/marklogic/io/BiendianDataInputStream.java:109-119 | src/main/java/com/marklogic/io/BiendianDataInputStream.java:121-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) src/main/java/com/marklogic/mapreduce/DocumentReader.java:67 — src/main/java/com/marklogic/mapreduce/DocumentReader.java:67-79 | src/main/java/com/marklogic/mapreduce/ValueReader.java:75-88 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (34 lines × 3) · ×1
  • Duplicated block (34 lines × 3) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:412 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:412-445 | src/main/java/com/marklogic/contentpump/TransformWriter.java:683-716 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:836-869 — 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 `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:93 — src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:93-123 | src/main/java/com/marklogic/contentpump/TransformWriter.java:231-261 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java` and `src/main/java/com/marklogic/contentpump/TransformWriter.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:238 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:238-266 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:333-361 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:113 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:113-139 | src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:228-253 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) src/main/java/com/marklogic/contentpump/ThreadManager.java:263 — src/main/java/com/marklogic/contentpump/ThreadManager.java:263-290 | src/main/java/com/marklogic/contentpump/ThreadManager.java:325-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/ThreadManager.java:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:99 — src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:99-123 | src/main/java/com/marklogic/contentpump/CompressedRDFReader.java:71-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:99` it does not close everything it opens, so those 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 first that the copies are not typed on the same thing: `ZipInputStream` names `com.marklogic.contentpump.utilities.ZipInputStream` in one and `java.util.zip.ZipInputStream` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (24 lines × 4) · ×1
  • Duplicated block (24 lines × 4) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:293 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:293-316 | src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:116-139 | src/main/java/com/marklogic/contentpump/TransformWriter.java:254-277 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:675-698 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java` and `src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/marklogic/contentpump/TransformWriter.java:278` calls `getAdhocQuery` and `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:109 — src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:109-131 | src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:69-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16–22 lines × 3) · ×1
  • Duplicated block (16–22 lines × 3) src/main/java/com/marklogic/contentpump/ThreadManager.java:269 — src/main/java/com/marklogic/contentpump/ThreadManager.java:269-290 | src/main/java/com/marklogic/contentpump/ThreadManager.java:331-350 | src/main/java/com/marklogic/contentpump/ThreadManager.java:393-408 — 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 `src/main/java/com/marklogic/contentpump/ThreadManager.java:269` it begins part-way through the construct above it, so those 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 (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:242 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:242-263 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:645-666 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) src/main/java/com/marklogic/contentpump/RDFReader.java:829 — src/main/java/com/marklogic/contentpump/RDFReader.java:829-849 | src/main/java/com/marklogic/contentpump/RDFReader.java:867-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/RDFReader.java:829` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18–20 lines × 4) · ×1
  • Duplicated block (18–20 lines × 4) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317-334 | src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:140-158 | src/main/java/com/marklogic/contentpump/TransformWriter.java:279-298 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:699-717 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java` and `src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/TransformWriter.java:278` calls `getAdhocQuery` and `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:316` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:372 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:372-391 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:814-833 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValueMatch.java:71 — src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValueMatch.java:71-89 | src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValues.java:70-88 | src/main/java/com/marklogic/mapreduce/functions/ElementAttributeWordMatch.java:71-89 | src/main/java/com/marklogic/mapreduce/functions/ElementAttributeWords.java:72-90 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValueMatch.java` and `src/main/java/com/marklogic/mapreduce/functions/ElementAttributeValues.java` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) src/main/java/com/marklogic/mapreduce/functions/CooccurrencesFunction.java:41 — src/main/java/com/marklogic/mapreduce/functions/CooccurrencesFunction.java:41-59 | src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java:58-76 | src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java:60-78 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java` and `src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–18 lines × 3) · ×1
  • Duplicated block (14–18 lines × 3) src/main/java/com/marklogic/contentpump/RDFWritable.java:204 — src/main/java/com/marklogic/contentpump/RDFWritable.java:204-217 | src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java:126-143 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:283-296 — 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:668 — src/main/java/com/marklogic/contentpump/Command.java:668-685 | src/main/java/com/marklogic/contentpump/Command.java:1583-1599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:668` it begins part-way through the construct above it, so those 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 (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:145 — src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java:145-162 | src/main/java/com/marklogic/contentpump/RDFWritable.java:176-193 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/ContentWithFileNameWritable.java` and `src/main/java/com/marklogic/contentpump/RDFWritable.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:1023 — src/main/java/com/marklogic/contentpump/Command.java:1023-1039 | src/main/java/com/marklogic/contentpump/Command.java:1478-1492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:1023` it does not close everything it opens, so those 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 (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:1131 — src/main/java/com/marklogic/contentpump/Command.java:1131-1147 | src/main/java/com/marklogic/contentpump/Command.java:1690-1706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:1131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) src/main/java/com/marklogic/contentpump/Command.java:311 — src/main/java/com/marklogic/contentpump/Command.java:311-325 | src/main/java/com/marklogic/contentpump/Command.java:1862-1876 | src/main/java/com/marklogic/contentpump/Command.java:2324-2338 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/Command.java:2323` calls `configFilteringOptions` and `src/main/java/com/marklogic/contentpump/Command.java:309` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:161 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:161-174 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:619-633 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (12–14 lines × 7) · ×1
  • Duplicated block (12–14 lines × 7) src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317 — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317-328 | src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:427-439 | src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:140-152 | src/main/java/com/marklogic/contentpump/TransformWriter.java:279-292 | src/main/java/com/marklogic/contentpump/TransformWriter.java:698-710 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:699-711 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:851-863 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java` and `src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:317` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/marklogic/contentpump/TransformWriter.java:278` calls `getAdhocQuery` and `src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:316` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:601 — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:601-614 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:670-683 | src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:687-700 — 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.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) src/main/java/com/marklogic/contentpump/TransformWriter.java:612 — src/main/java/com/marklogic/contentpump/TransformWriter.java:612-620 | src/main/java/com/marklogic/mapreduce/ContentWriter.java:554-566 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 `src/main/java/com/marklogic/contentpump/TransformWriter.java:612` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) src/main/java/com/marklogic/contentpump/Command.java:72 — src/main/java/com/marklogic/contentpump/Command.java:72-83 | src/main/java/com/marklogic/contentpump/Command.java:1841-1851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/Command.java:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8–9 lines × 10) · ×1
  • Duplicated block (8–9 lines × 10) src/main/java/com/marklogic/mapreduce/examples/BinaryReader.java:59 — src/main/java/com/marklogic/mapreduce/examples/BinaryReader.java:59-66 | src/main/java/com/marklogic/mapreduce/examples/ContentLoader.java:57-64 | REDACTED:72-79 | src/main/java/com/marklogic/mapreduce/examples/LinkCount.java:71-78 | src/main/java/com/marklogic/mapreduce/examples/LinkCountCooccurrences.java:80-88 | src/main/java/com/marklogic/mapreduce/examples/LinkCountHDFS.java:85-92 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInDoc.java:127-134 | src/main/java/com/marklogic/mapreduce/examples/LinkCountInProperty.java:120-127 | src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java:72-79 | src/main/java/com/marklogic/mapreduce/examples/RevisionGrouper.java:58-65 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/examples/LinkCount.java` and `src/main/java/com/marklogic/mapreduce/examples/LinkCountValue.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) src/main/java/com/marklogic/mapreduce/functions/ElementValueMatch.java:60 — src/main/java/com/marklogic/mapreduce/functions/ElementValueMatch.java:60-68 | src/main/java/com/marklogic/mapreduce/functions/ElementValues.java:60-68 | src/main/java/com/marklogic/mapreduce/functions/ElementWordMatch.java:60-68 | src/main/java/com/marklogic/mapreduce/functions/ElementWords.java:60-68 | src/main/java/com/marklogic/mapreduce/functions/FieldValueMatch.java:57-65 | src/main/java/com/marklogic/mapreduce/functions/FieldValues.java:57-65 | src/main/java/com/marklogic/mapreduce/functions/FieldWordMatch.java:57-65 | src/main/java/com/marklogic/mapreduce/functions/FieldWords.java:59-67 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/functions/ElementValueMatch.java` and `src/main/java/com/marklogic/mapreduce/functions/ElementValues.java` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/functions/ElementValueMatch.java:60` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 7) · ×1
  • Duplicated block (7–8 lines × 7) src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:123 — src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:123-129 | src/main/java/com/marklogic/contentpump/ArchiveRecordReader.java:80-86 | src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:82-89 | src/main/java/com/marklogic/contentpump/CompressedDelimitedTextReader.java:65-71 | src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:94-100 | src/main/java/com/marklogic/contentpump/RDFReader.java:249-256 | src/main/java/com/marklogic/contentpump/SequenceFileReader.java:68-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:137 — src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:137-144 | src/main/java/com/marklogic/mapreduce/NodeWriter.java:60-66 | src/main/java/com/marklogic/mapreduce/functions/CooccurrencesFunction.java:47-53 | src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java:64-70 | src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java:66-72 — before extracting anything, compare `src/main/java/com/marklogic/mapreduce/functions/ValueOrWordMatchFunction.java` and `src/main/java/com/marklogic/mapreduce/functions/ValuesOrWordsFunction.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:137` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) src/main/java/com/marklogic/dom/ElementImpl.java:234 — src/main/java/com/marklogic/dom/ElementImpl.java:234-238 | src/main/java/com/marklogic/dom/ElementImpl.java:328-332 | src/main/java/com/marklogic/dom/ElementImpl.java:347-351 — 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 `src/main/java/com/marklogic/dom/ElementImpl.java:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) src/main/java/com/marklogic/contentpump/ArchiveOutputFormat.java:49 — src/main/java/com/marklogic/contentpump/ArchiveOutputFormat.java:49-59 | src/main/java/com/marklogic/contentpump/SingleDocumentOutputFormat.java:51-61 | src/main/java/com/marklogic/mapreduce/MarkLogicOutputFormat.java:115-125 — before extracting anything, compare `src/main/java/com/marklogic/contentpump/ArchiveOutputFormat.java` and `src/main/java/com/marklogic/contentpump/SingleDocumentOutputFormat.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/marklogic/contentpump/ArchiveOutputFormat.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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) src/main/java/com/marklogic/mapreduce/utilities/AssignmentManager.java:95 — src/main/java/com/marklogic/mapreduce/utilities/AssignmentManager.java:95-101 | src/main/java/com/marklogic/mapreduce/utilities/AssignmentManager.java:106-112 | src/main/java/com/marklogic/mapreduce/utilities/AssignmentManager.java:117-123 — 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.
Minor — 144 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×116
  • Orphaned file src/main/java/com/marklogic/contentpump/TransformWriter.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/tree/ExpandedTree.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/AggregateXMLReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/ContentPump.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/InputType.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/ConfigConstants.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/mapreduce/ForestReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/dom/ElementImpl.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/dom/DocumentImpl.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/mapreduce/ForestInputFormat.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/FileAndDirectoryInputFormat.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/DocumentMetadata.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/io/Decoder.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/utilities/AuditUtil.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/CompressedAggXMLReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/ArchiveWriter.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/DelimitedJSONReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/RDFWritable.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/mapreduce/examples/LinkCountHDFS.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/ImportRecordReader.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/mapreduce/MarkLogicOutputFormat.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/main/java/com/marklogic/contentpump/OutputArchive.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 91 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×10
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:195 — `(!fastLoad) && ((!needCommit) || committed)` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java, src/main/java/com/marklogic/contentpump/TransformWriter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:351 — `(!fastLoad) && ((inserted && (!needCommit)) || committed)` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java, src/main/java/com/marklogic/mapreduce/ContentWriter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/mapreduce/BinaryDocument.java:37 — `copyCollections || copyMetadata || copyQuality` appears character-identically in 3 files — src/main/java/com/marklogic/mapreduce/BinaryDocument.java, src/main/java/com/marklogic/mapreduce/DOMDocument.java, src/main/java/com/marklogic/mapreduce/JSONDocument.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DatabaseContentReader.java:118 — `hostNames == null || hostNames.length < 1` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/DatabaseContentReader.java, src/main/java/com/marklogic/mapreduce/MarkLogicRecordReader.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:278 — `message != null && message.contains(INVALID_TOKEN_DELIMITER_ERROR)` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/DelimitedTextReader.java, src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java:115 — `needCommit && stmtCounts[sid] == txnSize` appears character-identically in 3 files — src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java, src/main/java/com/marklogic/contentpump/TransformWriter.java, src/main/java/com/marklogic/mapreduce/ContentWriter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java:292 — `needCommit && stmtCounts[sid] >= txnSize` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/DatabaseContentWriter.java, src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/InputType.java:252 — `outputHosts == null || outputHosts.length == 0` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/InputType.java, src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/contentpump/DelimitedTextReader.java:168 — `parser == null || parserIterator == null` appears character-identically in 2 files — src/main/java/com/marklogic/contentpump/DelimitedTextReader.java, src/main/java/com/marklogic/contentpump/SplitDelimitedTextReader.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java:197 — `restrictHostsString!=null && !restrictHostsString.isEmpty()` appears character-identically in 2 files — src/main/java/com/marklogic/mapreduce/ContentOutputFormat.java, src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file src/main/java/com/marklogic/contentpump/Command.java:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file src/main/java/com/marklogic/mapreduce/MarkLogicConstants.java:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file src/main/java/com/marklogic/tree/CompressedTreeDecoder.java:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: src/main/java/com/marklogic/contentpump/DatabaseTransformWriter.java. Pair on, review, or document these before any departure.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found REDACTED:127 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 127).
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 119 of 134 significant files have no living knowledge, while the repository is still being changed at a low rate (25 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 119 separate risks. Counted over 134 of the 213 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, 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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P1 · CI/CD gates · CI build step not evidenced · ×1
  • CI build step not evidenced — A CI pipeline exists but no build step was matched — changes may merge without the build ever running. A build step may be invoked directly as a command, or declared as a task that a runner named in the pipeline resolves.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:4 — 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 was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation REDACTED:311 — `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/12 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
Minor — 55 finding(s)
D12 · Dependency Hygiene · Outdated (compile) · ×46
  • Outdated (compile): org.apache.hadoop:hadoop-yarn-common — org.apache.hadoop:hadoop-yarn-common 3.4.0 → 3.5.0 available.
  • Outdated (compile): org.apache.logging.log4j:log4j-slf4j-impl — org.apache.logging.log4j:log4j-slf4j-impl 2.17.1 → 2.26.1 available.
  • Outdated (compile): org.slf4j:slf4j-api — org.slf4j:slf4j-api 1.7.32 → 2.0.20 available.
  • Outdated (compile): com.sun.jersey:jersey-core — com.sun.jersey:jersey-core 1.19.3 → 1.19.4 available.
  • Outdated (compile): com.fasterxml.jackson.core:jackson-databind — com.fasterxml.jackson.core:jackson-databind 2.17.1 → 2.23.0 available.
  • Outdated (compile): org.apache.hadoop:hadoop-client — org.apache.hadoop:hadoop-client 3.4.0 → 3.5.0 available.
  • Outdated (compile): org.apache.logging.log4j:log4j-1.2-api — org.apache.logging.log4j:log4j-1.2-api 2.17.1 → 2.26.1 available.
  • Outdated (compile): org.apache.hadoop:hadoop-yarn-api — org.apache.hadoop:hadoop-yarn-api 3.4.0 → 3.5.0 available.
  • Outdated (compile): org.apache.jena:jena-arq — org.apache.jena:jena-arq 4.9.0 → 6.2.0 available.
  • Outdated (compile): org.apache.hadoop:hadoop-annotations — org.apache.hadoop:hadoop-annotations 3.4.0 → 3.5.0 available.
  • Outdated (compile): org.apache.commons:commons-compress — org.apache.commons:commons-compress 1.26.1 → 1.28.0 available.
  • Outdated (compile): com.google.guava:failureaccess — com.google.guava:failureaccess 1.0.1 → 1.0.3 available.
  • Outdated (compile): org.apache.jena:jena-base — org.apache.jena:jena-base 4.9.0 → 6.2.0 available.
  • Outdated (compile): jakarta.xml.soap:jakarta.xml.soap-api — jakarta.xml.soap:jakarta.xml.soap-api 3.0.1 → 3.0.2 available.
  • Outdated (compile): org.apache.commons:commons-lang3 — org.apache.commons:commons-lang3 3.5 → 3.22.0 available.
  • Outdated (compile): org.apache.commons:commons-csv — org.apache.commons:commons-csv 1.13.0 → 1.14.1 available.
  • Outdated (compile): org.apache.logging.log4j:log4j-core — org.apache.logging.log4j:log4j-core 2.17.1 → 2.26.1 available.
  • Outdated (compile): org.apache.hadoop:hadoop-auth — org.apache.hadoop:hadoop-auth 3.4.0 → 3.5.0 available.
  • Outdated (compile): org.apache.logging.log4j:log4j-jcl — org.apache.logging.log4j:log4j-jcl 2.17.1 → 2.26.1 available.
  • Outdated (compile): org.apache.hadoop:hadoop-yarn-client — org.apache.hadoop:hadoop-yarn-client 3.4.0 → 3.5.0 available.
  • Outdated (compile): com.sun.xml.ws:jaxws-rt — com.sun.xml.ws:jaxws-rt 4.0.0 → 4.0.5 available.
  • Outdated (compile): org.apache.hadoop:hadoop-hdfs — org.apache.hadoop:hadoop-hdfs 3.4.0 → 3.5.0 available.
  • Outdated (compile): com.fasterxml.jackson.core:jackson-annotations — com.fasterxml.jackson.core:jackson-annotations 2.17.1 → 2.23 available.
  • Outdated (compile): org.apache.hadoop:hadoop-common — org.apache.hadoop:hadoop-common 3.4.0 → 3.5.0 available.
  • Outdated (compile): org.apache.hadoop:hadoop-mapreduce-client-core — org.apache.hadoop:hadoop-mapreduce-client-core 3.4.0 → 3.5.0 available.
  • + 21 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (runtime) · ×6
  • Outdated (runtime): xml-apis:xml-apis — xml-apis:xml-apis 1.0.b2 → 2.0.2 available.
  • Outdated (runtime): org.apache.commons:commons-collections4 — org.apache.commons:commons-collections4 4.5.0-M2 → 4.6.0 available.
  • Outdated (runtime): org.apache.thrift:libthrift — org.apache.thrift:libthrift 0.17.0 → 0.25.0 available.
  • Outdated (runtime): commons-codec:commons-codec — commons-codec:commons-codec 1.16.1 → 1.23.0 available.
  • Outdated (runtime): org.slf4j:jcl-over-slf4j — org.slf4j:jcl-over-slf4j 2.0.12 → 2.0.20 available.
  • Outdated (runtime): com.github.ben-manes.caffeine:caffeine — com.github.ben-manes.caffeine:caffeine 3.1.6 → 3.3.1 available.
D12 · Dependency Hygiene · Outdated (test) · ×2
  • Outdated (test): com.google.guava:guava — com.google.guava:guava 32.1.2-jre → 33.8.0-android available.
  • Outdated (test): junit:junit — junit:junit 4.13.1 → 4.13.2 available.
D12 · Dependency Hygiene · Outdated (system) · ×1
  • Outdated (system): com.marklogic:marklogic-xcc — com.marklogic:marklogic-xcc 12.1.0 → 12.1.0.1 available.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-1754156de10e48e19a290af16bc44546/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-1754156de10e48e19a290af16bc44546/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-1754156de10e48e19a290af16bc44546/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=12800" --report-format json --report-path /tmp/watchdog-gitleaks-1754156de10e48e19a290af16bc44546/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=17000 --max-count=3692" --report-format json --report-path /tmp/watchdog-gitleaks-1754156de10e48e19a290af16bc44546/history-4.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-4.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-1754156de10e48e19a290af16bc44546/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .7artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .8artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1e4df-3668-7d10-bb94-a4cb44bf8e53 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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